POV-Ray : Newsgroups : povray.off-topic : Probability question : Re: Probability question Server Time
4 Sep 2024 11:22:01 EDT (-0400)
  Re: Probability question  
From: Invisible
Date: 8 Feb 2010 04:56:08
Message: <4b6fdfb8$1@news.povray.org>
scott wrote:
> If a weighted coin is tossed N times, count the times it lands heads as 
> H. The probability of landing heads is P(H).

I presume by this you explicitly mean that P(H) /= 50%?

> I assume the expected value of H is N*P(H).

Yes. That would be the definition of "probability". (Assuming all the 
trails are independent.)

> But how do I find out what range of H is X% likely to happen?  For 
> example, I want to be able to say that in 90% of cases H will be in the 
> range (A,B).

Now you're talking about probability distributions. If you can decide 
what probability distribution this experiment has, you can [potentially] 
directly compute the result you're after.

Wikipedia informs me that what you're looking for is a "binomial 
distribution". According to this, we have the probability of getting 
exactly K heads as

   (N choose K) * P(H)^K * (1 - P(H))^(N-K)

More usefully for you, the cumulative probability - the probability of K 
heads OR LESS, is given by

   I[1 - P(H)] (N - K, N + K)

where I[x](a, b) represents the regularised incomplete beta function,

http://en.wikipedia.org/wiki/Regularized_incomplete_beta_function

Unless Excel has a built-in function to compute I(), I would suggest it 
would be simpler and easier to directly compute the sum over the 
individual probabilities. (Especially since you want the probability for 
a value between K1 and K2, not between K1 and 0.)

You can also compute the cumulative probability by the integral

   (N - K) (N choose K) integral[0 .. 1-P(H)] t^(N-K-1) (1 - t)^K dt

But I'm guessing Excel can't do that.

Apparently you can also estimate the maximum probability by

   exp( -2 * (N * P(H) - K)^2 / N )

(The true cumulative probability is less than or equal to this. 
Apparently for P(H) = 50% it's quite a good approximation, but I'm not 
sure for other values.)


Post a reply to this message

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