I have two different biased coins with probabilities $p_1$ and $p_2$. Coin 1 I toss $n$ times. I would like to know how often I should toss coin 2 to be $p_3$% sure I'll have more heads from coin 2 than from coin 1.

I have read up on binomial distributions and I could figure out the answer by summing those from a guessed starting point and going up or down by trial and error on the computer, but I'm hoping there is an easier way.

Context: Actually the coin flips are archers in a computer game facing off against opposing archers, each having a chance to incapacitate an opponent, I expect there will be anywhere from 1 to 1000 archers on each side. A cautious artificial intelligence wants to know how many archers it has to take so it's reasonably save to go near and have a positive outcome where fewer of his archers fall than those of the enemy.

  • The problem is complicated. One could get answers by simulation. If the $p_i$ are not very far away from $1/2$ (and for example $0.2$ is not far away), and the numbers of tosses involved are large, one can use the normal approximation to get good explicit estimates. – André Nicolas Mar 7 '14 at 18:17
up vote 2 down vote accepted

This is essentially finding the probability mass function for the difference of two independent binomial random variables (and then finding the cdf and evaluating it at zero). This involves hypergeometric functions - see, for example, here: Difference of two binomial random variables

An approximation could be developed using normal distributions, where $$P[B<A] =P[B-A<0]= \Phi \left( {\mu_A - \mu_B } \over {\sqrt{\sigma^2_A + \sigma^2_B}} \right)$$

However, this could be problematic for some parameter values of interest to you.

  • Thank you for the approximation and the link to an interesting solution, and especially for providing the correct terminology so I could find out more about this topic, I found a site that suggested adding a continuity correction, by finding good values for that in a spreadsheet I've managed to get accurate to the coin toss results over 90% of the time, 99% within 1 and the rest tend to be cases not very relevant for me. – Rinze Smits Mar 8 '14 at 3:07
  • You're very welcome - glad to hear you've already found the continuity correction - I should have mentioned that. – soakley Mar 8 '14 at 3:25

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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