POV-Ray : Newsgroups : povray.off-topic : Problem of the day : Re: Problem of the day Server Time
6 Sep 2024 13:18:11 EDT (-0400)
  Re: Problem of the day  
From: Invisible
Date: 17 Dec 2008 09:01:49
Message: <4949064d$1@news.povray.org>
scott wrote:
> If you have a box with N balls numbered 1 to N, and you repeatedly pull 
> one out at random (replacing it each time), on average how many times 
> would you expect to pull out a ball until you have seen all the balls 1 
> to N?

N is trivially the lower bound.

Each ball appears with probability 1/N, so the probability for all balls 
to appear (given that these events are clearly independent) in N trials 
would be (1/N)^N, which is 1/(N^N).

Hmm, but wait! This does not count for ordering. There are N! 
permutations of N events, so taking *that* into account, we now actually 
have N! / N^N.

Now, if we perform K trails, the probability of seeing all the balls is 
(N! + (K-N)!) / N^N. (Assuming K >= N.)

Assuming that by "on average" you mean "with probability > 50%", it is 
now a matter of choosing K such that the above formula comes out to more 
than 0.5.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.