Probability of picking $z-n$ uniquely colored balls successively and $n$ repeats without replacement

conditional probabilityprobability

A follow up on this post.

In a bucket, there are $x$ different colors of balls, $y$ of each color
($x \cdot y$ total balls). If you pick $z$ balls at random without replacement, what is the probability that you pick a different colored ball each time?

Generalized answer by Bram28:

$x$: number of colors

$y$: number of balls per color

$z$: number of picks

$P$: chance of all $z$ picks having a different color

Now, if $z > x$, then obviously $P = 0$.

Otherwise (i.e. if $z \leq x$):
$$
P = \frac{\binom{X}{Z} \cdot Y^Z}{\binom{X \cdot Y}{Z}}
$$

Question:

Lets say $n$ of the picks $z$ are repeated colors, how would I get the probability to pick $z-n$ unique colors and $n$ repeated colors? I'm having trouble including the number of balls per color $y$ to calculate the probability, since I want $n$ repeats but there are only $y$ balls per color.

(This problem is "without replacement", and the repeats I'm trying to calculate come from the colors having multiple balls.)

Finally, I want to add all probabilities with $0 \leq n \leq y$.

.

.

Also, I plotted $P$ as $x$ increases and I get values greater than $1$, I don't understand how that can happen for this problem.

Best Answer

The solution to the modified problem is: $$ P = \frac{\binom{x}{1}\binom yn\cdot \binom{x-1}{z-n}\binom y1^{z-n}}{\binom{x \cdot y}{z}},\tag1 $$ where $1<n\le y$ is assumed.


The general case

The most general statement of the problem would be the following: what is the probability of the event that the drawn balls are of $k$ (unspecified) colors with the number of balls for each of these colors being represented by the multiset $Z=\{z_1,z_2,\dots,z_k\}$ with $z_i>0$ and $\sum z_i=z$.

The probability in question will be (equal number $y$ of balls of each color is assumed, generalization is obvious): $$ P_Z=\frac{\binom xk\prod\limits_{i=1}^k\binom{y}{z_i}}{\binom{x \cdot y}{z}}M(Z),\tag2 $$ with $M (Z) $ being the number of ways to permute the elements of $Z$: $$ M(Z)=\frac{k!}{\prod\limits_{i\in Z}\mu_Z(i)!},\tag3 $$ where $\mu_Z(i)$ is the multiplicity of the number $i$ in the multiset $Z$.

All previously considered cases are particular instances of the formula (2). The formula can be slightly simplified if one adds $x-k$ $0$'s to the multiset $Z$.