Question regarding hypergeometric distribution Suppose I have a bag with $A$ balls, out of them, $B$ are black.
What is the probabilty to get $n$ balls out until I get $m$ black ones? (without putting the balls back after each time)
I thought of using hypergeometric distribution but I think something is missing.

Your thought of using the hypergeometric distribution is correct, but you need to slightly adjust it to calculate the required probability. You should consider a sample of size $n-1$ and not $n$, determine the probability of $m-1$ black balls in the $n-1$ sample and then stipulate that the next ball will be black.
To that end, consider the number $X$ of black balls that are drawn which follows the hypergeometric with parameters 


*

*$A=$ population size,

*$B=$ successes in the population,

*$n-1$ sample size.


Thus the probability of $x=m-1$ successes is equal to $$P(X=m-1)=\frac{\dbinom{B}{m-1}\dbinom{A-B}{n-1-(m-1)}}{\dbinom{A}{n-1}}$$ Now you need that the next ball is necessarily black. Observe that conditional on the event that you have drawn $m-1$ black balls in the $n-1$ first draws, in the bag there are 


*

*$A-(n-1)$ balls in total,

*$B-(m-1)$ black balls


So the probability that the next ball will be black is equal to $$\frac{B-(m-1)}{A-(n-1)}$$ Combining the above, and by using the product (or chain) rule the required probability is equal to $$P(X=m-1)\cdot\frac{B-(m-1)}{A-(n-1)}=\frac{\dbinom{B}{m-1}\dbinom{A-B}{n-m}}{\dbinom{A}{n-1}}\cdot\frac{B-(m-1)}{A-(n-1)}$$
