0

I'm trying to solve another complex question but I need understand first this problem:

There are $N$ empty bins and infinitely many balls. How many balls in mean do I need to choose, in random way, to fill each of the $N$ bins with least one ball?

I made this in experimental form, and I get approximately 54 when N=16. but Why? Could you help me please?

juaninf
  • 1,264
  • N balls, one per bin? Seems like there are some informations missing here. – Surb Apr 01 '15 at 13:22
  • yes one per bin. – juaninf Apr 01 '15 at 13:22
  • Your question is not clear to me. At the beginning bins are empty or not? If it is the case, when you take a ball what is the process that puts it in a bin or another? – Surb Apr 01 '15 at 13:24
  • are empty and the process in randomly – juaninf Apr 01 '15 at 13:24
  • 1
    Is there a maximum number of balls each bin can hold? – Laars Helenius Apr 01 '15 at 13:26
  • I'm not good at probability, but to be 100% sure that every bin contains at least one ball, I'd say infinitely many balls (they may all go in the first bin) – Surb Apr 01 '15 at 13:26
  • Do you mean exactly one ball or at least one ball? – N. F. Taussig Apr 01 '15 at 13:27
  • sorry ... with least one ball, – juaninf Apr 01 '15 at 13:30
  • Is the process the next? I get a ball, and choose randomly a bin and try to take the ball into the chosen bin. If the bin is full, I throw away the ball, if the bin isn't full, I take the ball into it. – Leonhardt von M Apr 01 '15 at 13:31
  • yes .... @LeonhardtvonM – juaninf Apr 01 '15 at 13:33
  • And what is the question? Surb is right, if the choices of bins are independent and identically distributed, then there is a bin such that the choosing that bin N times has a positive probability for every N. Are you curious to know, how many balls do you need to choose in mean? – Leonhardt von M Apr 01 '15 at 13:37
  • yes @LeonhardtvonM the choices of bins are independent and identically distributed, and I need the how many balls I need to choose in mean. – juaninf Apr 01 '15 at 13:40
  • If you choose the bins independently and identically distributed, then you can consider this game as a Markov chain, and in that case you can compute the expected time of the filling of $N$ bins recursively. Would you like me to explain it in an answer? – Leonhardt von M Apr 01 '15 at 13:44
  • yes, please ... @LeonhardtvonM – juaninf Apr 01 '15 at 13:52
  • Your experimental result is good enough because $16H_{16}=54 \frac{4129}{45045}$. – Leonhardt von M Apr 01 '15 at 14:39

2 Answers2

3

The average is $$N\left(\frac 11+\frac 12+\frac13+\cdots+\frac1N\right)\\ \approx N(\ln N +\gamma)$$ where gamma is the Euler-Mascharoni constant, and is a bit more than 0.577.
The reason is that it takes, on average, $N/(N-k)$ balls to go from $k$ filled bins to $k+1$ filled bins.
Let $T$ be the average time it takes to go from $k$ filled bins to $k+1$ filled bins. On the next throw, there is $k/N$ chance the ball is wasted, and $1-(k/N)$ chance the ball fills a new bin. So the average number of throws to fill a new bin is $$T=(k/N)(1+T)+(1-(k/N))1\\T(1-(k/N))=1$$

Empy2
  • 50,853
1

We have $N$ bins and the distribution of the choice of a been is uniform. Let $m_k$ is the expected time of filling the every bin assumed $k$ bin is still full. Obviously $m_N$=0.

Since the time of choosing the last bin when the other bins are full is geometrically distributed $m_{N-1}=N$. The law of total expectation shows, that $$m_{k-1}=\frac{k(m_{k-1}+1)+(N-k)(m_k+1)}{N}\; (k=N-1,\,N-2,\,\ldots)$$ because the expected value of the filling of the bins is assumed $k-1$ is filled is $m_{k-1}+1$ assuming that we next time choose a chosen bin, and $m_k+1$ when we assume, our next choice is an empty bin. We get by ordering $$m_{k-1}=m_k+\frac{N}{N-k} $$ Hence $$m_0=N\cdot H_N$$ is the expected time of filling of every bin where $H_N=\sum_{k=1}^N\frac{1}{k}\sim \log N$.