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.


  • $\begingroup$ I guess you mean 2^{-100}, but you are correct. To estimate this number you can use Stirling's formula: en.wikipedia.org/wiki/Stirling's_approximation $\endgroup$ – Qiaochu Yuan Nov 29 '10 at 14:15
  • $\begingroup$ oh yes.. thanks for poiting out the typo... $\endgroup$ – Rajan Nov 30 '10 at 7:48

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}$.

  • $\begingroup$ 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. $\endgroup$ – karakfa Jun 13 '12 at 20:58

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.

  • $\begingroup$ yes John, thanks for pointing out the typo... $\endgroup$ – Rajan Nov 30 '10 at 7:48

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;
gap> time;
gap> Binomial(100000,50000)/2^100000;
<<an integer too large to be printed>>/<<an integer too large to be printed>>
gap> time;

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:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.