2

Please help me to verify my solution of the following problem:

Imagine we have a box with $n$ balls, each ball has unique color (or number) from $1$ to $n$. We take one ball from the box $m \geq n$ times, track the color and put the ball back into the box. What is the probability that each color will be tracked at least once? The answer should depend on $m$ and $n$.

My attempt:

I will consider ordered sequences since it looks like it is easer to deal with them in this case. We have $n^m$ sequences of choices in total. Let us consider a sequences where each colour is tracked at least once. How many such sequences are there? It looks like there are ${m \choose n}n!n^{m-n}$, so $$P=\frac{{m \choose n}n!n^{m-n}}{ n^m}=\frac{m!}{(m-n)!n^n}$$

Is my solution valid? If it is so, can you please provide the solution with unordered sequences, giving the same probability?

Thanks a lot for your help!

Hedgehog
  • 1,722
  • This is related to/a rephrasing of the coupon collector problem. There should be a post somewhere already on this site discussing the probability that all colors have been seen at least once within $m$ pulls. – JMoravitz Jan 07 '18 at 22:29
  • 2
  • @JMoravitz agreed that the questions are related, but that one's asking for expected value of $m$ such that all $n$ colours are chosen, whereas this asks for probability all $n$ are chosen given $m$. – Colm Bhandal Jan 07 '18 at 22:37
  • @ColmBhandal In the linked question, the OP specifically wanted to use the probability distribution in order to calculate the expected value. The answer and discussions in the comments above give information as to the probability that the $m$'th pull was the one to get the $n$'th color, but the approach could be modified quickly and easily (and even was already done so on the linked question) to get instead the formula for it requiring at most $m$ pulls to get all $n$ colors (which corresponds with the probability asked for here). – JMoravitz Jan 07 '18 at 22:50
  • @JMoravitz yep totally agree that there's a quick and easy transformation from one problem to the next- but it's worth keeping this question open, in my opinion, because it's still asking a different thing. Even if the answer is just "look at the other Question!". This is for people searching the internet in the future. – Colm Bhandal Jan 07 '18 at 23:07

1 Answers1

1

Unfortunately your solution is not valid at this equation for the number of desirable sequences:

$${m \choose n}n!n^{m-n}$$

You are saying here "Choose the n balls from the $m$ turns. Multiply by $n!$ to account for all the different orderings. Now multiple by $n^{m-n}$ to account for all the possible choices for the "gaps". Problem is, your method of constructing a desirable state here is not unique i.e. in general you're counting too many objects.

Let me be more concrete. $n=2$, $m=3$. Let me show you how you could get the same object counted twice by your method. The object is the sequence $1, 2, 1$, where the balls are just represented by $\{1, 2\}$. You could get this by either:

  • Choosing the first two elements and going with the order $1, 2$, then choosing the third element to be $1$.
  • Choosing the last two elements with order $2, 1$ and then choosing the first element to be $1$.
Colm Bhandal
  • 4,649