N balls in a jar where the probability of the i_{th} ball being chosen is P_{i}. M students choosing one ball each with replacement. Probability?

103 Views Asked by At

So this question was given to my class by our CS Professor as a challenge. It goes as follows:

There is a jar which contains $N$ balls and there are $M$ students. The probability of the $i$th ball being chosen is $P_i$. Each student selects only one ball independently with replacement (the number of balls remain the same after choosing). Find the probability that atleast two students will select the same ball.

My approach:
First of all, if $N<M$, then the probability has to be $1$ because there are more students than balls.

Now, in the case when $N \geqslant M$:

Let's suppose the set of all probabilities of the balls is $P = \{P_1, P_2, P_3, \ldots , P_n\}$ and there are $M$ students to choose them. We'll calculate the Probability $P(E)$ which represents the probability of each student selecting a unique ball.

So, the final answer would be $1 - P(E)$. Now, let us consider $perm_i$ to be a subsequence of $P$ containing $M$ elements (unique choice of balls made by each student). And we calculate the possible ways to create all the $perm_i$ subsequences. The number of ways to do it is $^N\!C_M$. This way, we create an array named $perm$ which contains all $^N\!C_M$ number of $perm_i$.

Here we consider one subsequence, suppose $perm_1$ which contains $M$ elements. For the first ball, there may be $M$ students who choose it. Again, for the second ball, there are $M-1$ unique students left to choose it. As we go on, for the $M$th ball, only 1 unique student is left.

So, the probability for this permutation is: $(P_1 \times M) \times (P_2 \times (M - 1)) \times \cdots \times (P_M \times 1)$.

Or, simplified as : $P_1 \cdots P_M \times M!$. Again, we would have to do this $^NC_M$ number of times over the set $perm$ for every possible $perm_i$.

Thus,
$$ P(E) = \sum_{i=1}^{^N\!C_M} \prod perm_i M! $$

Is this the correct way to do it, or am I wrong somewhere? Could this solution be simplified more?

1

There are 1 best solutions below

12
On BEST ANSWER

As you say, the main catch is that each ball has a possibly different probability of being chosen, but your answer is not correct.

There is only one trial, and the probability is to be assessed for that one trial.

With $N>M$,there will be $\binom{N}{M}$ distinct combinations (no repeats) of $M$ elements, thus P(get a distinct combo) $=\frac{\binom{N}{M}}{N^M}$

Arranging the elements of the distinct combo obtained (say $j_{th}$ combo) in ascending order, the combo's probability is $$P_j= P_{j_1}*P_{j_2}*...P_{j_M}$$
and since the elements can be assigned to people in $M!$ ways,

P(distinct elements drawn $\cap$ no assigned element common )$= M!P_j\frac{\binom{N}{M}}{N^M}$,

and finally, P(at least two people draw a common element $$= 1 - M!P_j\frac{\binom{N}{M}}{N^M}$$


Added

If you say that the intention is repeated trials, (in which case we are actually computing expected probability, your answer is correct, I'd only change the terminology perm_i to combo_i as they are combinations. (Better still, make it $C_i$)

Also, I'd suggest that you put $1- P(E)$ at the end as the final answer