From: Paolo Capriotti Date: 2005-07-17T20:36:12+09:00 Subject: Re: [QUIZ] Sampling (#39) On 7/17/05, ruby quiz wrote: > > I got the probability of getting exactly one number in > a specific interval to be as follows: > Probability of one *specific* number in the interval > 1/20 > Probability of all the other 19 OUT of that interval > (19/20)**19 > But we have 20 specific numbers to consider, so: > 20 * 1/20 * (19/20)**19 > or > (19.0/20)**19 > which gives a remarkably similar 0.3773536 (don't know > if this is a co-incidence. My brain hurts :-) When multiplying probabilities, one has to be careful about event independence. In this particular case (hypergeometric distribution), it turns out that the best way to compute this probability is to use the very definition of uniform distribution of samplings: probability = (# of samplings satisfying this property) / (total # of samplings). Since these numbers are huge, it is better to compute their logarithms (and use stirling approximation to estimate binomial coefficients), obtaining 1e-10875 as an upper bound. The result that I posted before was instead the probability that _all_ numbers fall in each of the 200-numbers intervals (sorry for that, I had misunderstood the question). Here is the exact probability: 200**20 * binom(10**9 - 4000, 5*10**6 - 20) / binom(10**9, 5*10**6). Paolo