3
$\begingroup$

folks,

i am new to this forum and not a math expert. so please bear with me if am asking silly questions.

The question is "probability of getting 50 heads from tossing a coin 100 times".

So the answer for this is, I guess, ${100 \choose 50} (2 ^{-100})$.

So all am trying to get is easier way to calculate ${100 \choose 50}$, or another approach to the parent problem only.

Thanks all, appreciate that.

raj

  • 0
    I guess you mean 2^{-100}, but you are correct. To estimate this number you can use Stirling's formula: http://en.wikipedia.org/wiki/Stirling's_approximation2010-11-29
  • 0
    oh yes.. thanks for poiting out the typo...2010-11-30

3 Answers 3

5

The coefficient ${2n \choose n}$ for $n$ large can be approximated well (using Stirling's formula) by ${2n \choose n} \approx 4^n / \sqrt{n \pi} $. In particular, letting $n=50$ gives ${100 \choose 50} \approx 4^{50}/ \sqrt {50 \pi}$.

  • 0
    Another approach is approximating the binomial with a normal distribution, i.e. N(np,np(1-p))=N(50,25) and interpolating the desired value from a standard normal distribution.2012-06-13
4

See How to calculate binomial probabilities for how to calculate these probabilities while avoiding numerical overflow or underflow.

Also, I believe you meant to type 2^-100 instead of 2^-10 in your question.

  • 0
    yes John, thanks for pointing out the typo...2010-11-30
0

The numbers in question here, of course, can be computed exactly. For example, using bignum or GAP (or even WolframAlpha -- the exactly link won't work on here, but I'm sure you can type in "(100 choose 50)*2^(-100)" yourself).

On my home computer, in GAP, it took less than a millisecond. To make it more interesting, I also computed ${100000 \choose 50000} \cdot 2^{-100000}$, which took a bit more than 17 seconds.

gap> Binomial(100,50)/2^100;
12611418068195524166851562157/158456325028528675187087900672
gap> time;
0
gap> Binomial(100000,50000)/2^100000;
<>/<>
gap> time;
17266

In fact, provided the coin has probability 1/2, the probability will always have a terminating decimal expansion (since binomial coefficients are integers, and 2 divides 10). Here it is in this case:

0.0795892373871787614981270502421704614029315404247333213573478705171737601631321012973785400390625