I used the formulas for the binomial distribution from the CRC Math Handbook, which is the exact same formula quoted by BKerbs on page 3 of this thread. The probability of observing exactly x heads in N tosses is:
C(N,x) * p^x * (1-p)^(n-x),
In this formula, p is the probability of the...