# Software to Calculate Binomial Distribution Formula, Probability of Multiple Successes in a Number of Trials

## By Ion Saliu,Founder of Probability Theory of Life

Published on January 27, 2001. O tempora! O mores!

FORMULA has been upgraded to calculate also the Binomial Distribution Formula (BDF). This formula calculates the probability of exactly M successes in N trials, when the probability p is constant. It deals with a sequence of events, such as a number of coin tosses. It proves that what happened in the past is relevant to the next trial. For example, we want to determine the probability of getting exactly 5 heads in 10 tosses. We tossed the coin 7 times and recorded 5 heads. We toss the coin for the 8th time and get another heads (the 6th). We must stop the tossing; the experiment failed. We can no longer get exactly 5 heads in 10 tosses. It is obvious that the previous events influenced the coin toss number 9.

Sequence of events means that the events do not take place at the same time: They occur serially, one after another.

The Binomial Distribution Formula shows some interesting facts. For example, the probability to toss EXACTLY 1 tails in 10 tosses is only 0.98%. It is quite difficult to get only 1 tails and 9 heads in 10 tosses.

The probability to toss EXACTLY 5 heads in 10 tosses is 24.6%. It is not that usual to get exactly 5 heads in 10 trials, even if the individual chance is 50%! We might have thought that we would get quite often 5 heads and 5 tails in 10 coin tosses. After all, it is a 50-50 proposition. NOT! The chance is even slimmer to get 500 heads and 500 tails in 1000 tosses: 2.52%.

The probability to get 5 heads in 5 tosses represents, actually, the probability of 5 heads in a row (3.125%).

We can work with complicated case scenarios as well. Let's take, as an example, roulette. (Methinks you're here mainly because of a strong interest in gambling mathematics.)

• The roulette probabilities p of Red (R) and Black (B) are equal: p=18/37. What is the chance of this 4-spin pattern: B-R-B-R or R-B-R-B?
• Calculate the degree of certainty for EXACTLY 2 successes in 4 trials (spins): 37.4% or 1 in 2.7
• There are 2^4 possible B-R outcomes: 16
• The final chance for one B-R-B-R pattern: 0.374 / 16 = 0.023 = 1 in 43 spins.
• The R-B-R-B pattern has the same degree of certainty: 1 in 43 spins.
• It happens quite frequently in 1 to 1 gambling games. The Asians “secretly” apply these types of patterns in baccarat — and win BIG bucks… without knowing the formula!

The software has a data size limit. The number of trials N must not be larger than 1500. N! (N factorial) for numbers larger than 1500 leads to impossible-to-handle amounts for today's PCs. There will be an overflow if you use very large numbers...

Axiomatic one, here is the generalized formula for exactly M successes in N trials:

BDF = C(N, M) * pM * (1 — p)N — M

BDF = probability, chance of exactly M successes in N trials;
p = the individual probability of the phenomenon (e.g. p = 0.5 to get heads in coin tossing);
M = the exact number of successes (e.g. exactly 5 tails in 10 coin tosses);
N = the number of trials (e.g. exactly 5 tails in 10 trials).

• If we can calculate the probability for multiple successes as exactly, we can also calculate probabilities as at least and as at most. Instead of formulas (one-step calculations), we apply algorithms (multiple-step calculations).
• at least M successes: add up the probabilities for M, M+1, M+2, etc. ... up to N.
• at most M successes: add up the probabilities for 0, 1, 2, etc. ... up to M inclusively.

• Axiomatic one, the 16-bit Formula program was superseded (or greatly upgraded) to 32-bit software that runs on all 32-bit/64-bit Windows versions, including Windows 10. Application name: SuperFormula (see screenshot below).
• The Binomial Distribution Formula is in the function E = Exactly M Successes in N Trials.
• I upgraded this formula even further by adding two more useful functions: L = At Least M Successes in N Trials and M = At Most M Successes in N Trials.
• As we saw previously, the chance to toss exactly 5 heads in 10 tosses is 24.6%.
• The chance to get at least 5 heads in 10 tosses is higher, of course: 62.3%.
• The chance to get at most 5 heads in 10 tosses is higher, of course: 62.3%.
• The at least and at most formulas are together convincing proof of the fallacy of gambler's fallacy: Long losing streaks are probabilistically-equal to long winning streaks. Casinos and many gambling "authors" want to convince you otherwise, especially when trying to combat Ion Saliu's gambling theory. They want gamblers to see only long losses so that you would abandon all mathematical systems.

## Resources in Theory of Probability, Mathematics, Statistics, Standard Deviation, Software

See a comprehensive directory of the pages and materials on the subject of theory of probability, mathematics, statistics, standard deviation, plus software.