Binomial Distribution Calculator
Calculate binomial distribution probabilities, PMF, CDF, mean, variance, and visualize the distribution with an interactive chart.
About
Miscalculating binomial probabilities leads to flawed A/B tests, incorrect quality control decisions, and unreliable risk models. The binomial distribution models the number of successes X in n independent Bernoulli trials, each with success probability p. This calculator computes exact point probabilities P(X = k), cumulative probabilities P(X โค k) and P(X โฅ k), and range probabilities using log-gamma arithmetic to avoid overflow for trials up to n = 10,000. It also derives the mean ฮผ = np, variance ฯ2 = np(1 โ p), and skewness. This tool approximates using IEEE 754 double-precision floating point. For n > 1,000 with extreme p, probabilities below 10โ15 may round to zero.
Formulas
The probability mass function (PMF) of the binomial distribution gives the probability of exactly k successes in n trials:
where n = number of independent trials, k = number of successes (0 โค k โค n), p = probability of success on a single trial, and (1 โ p) = probability of failure, often denoted q.
The cumulative distribution function (CDF) sums probabilities up to k:
To avoid factorial overflow for large n, computation uses log-space arithmetic via the Lanczos approximation of the log-gamma function:
Descriptive statistics derived from the parameters:
where q = 1 โ p.
Reference Data
| Scenario | n | p | Mean (ฮผ) | Variance (ฯ2) | Std Dev (ฯ) | Skewness | Application |
|---|---|---|---|---|---|---|---|
| Coin Flips (Fair) | 10 | 0.50 | 5.00 | 2.50 | 1.58 | 0.00 | Probability teaching |
| Quality Control | 100 | 0.02 | 2.00 | 1.96 | 1.40 | 0.69 | Defect rate monitoring |
| Drug Efficacy Trial | 50 | 0.80 | 40.00 | 8.00 | 2.83 | โ0.21 | Clinical trials |
| Survey Response | 200 | 0.30 | 60.00 | 42.00 | 6.48 | 0.06 | Market research |
| Network Packet Loss | 1000 | 0.01 | 10.00 | 9.90 | 3.15 | 0.31 | Network reliability |
| Free Throw Shooting | 20 | 0.75 | 15.00 | 3.75 | 1.94 | โ0.26 | Sports analytics |
| Email Open Rate | 500 | 0.22 | 110.00 | 85.80 | 9.26 | 0.06 | Email marketing |
| Genetic Inheritance | 4 | 0.25 | 1.00 | 0.75 | 0.87 | 0.58 | Mendelian genetics |
| A/B Test Conversion | 1000 | 0.05 | 50.00 | 47.50 | 6.89 | 0.13 | Web optimization |
| Insurance Claims | 10000 | 0.001 | 10.00 | 9.99 | 3.16 | 0.32 | Actuarial science |
| Dice Rolling (6) | 12 | 0.167 | 2.00 | 1.67 | 1.29 | 0.52 | Gaming probability |
| Election Poll Sample | 400 | 0.52 | 208.00 | 99.84 | 9.99 | โ0.004 | Political forecasting |
| Rare Disease Screening | 5000 | 0.0005 | 2.50 | 2.50 | 1.58 | 0.63 | Epidemiology |
| Server Uptime (daily) | 365 | 0.999 | 364.63 | 0.37 | 0.60 | โ1.63 | SLA compliance |
| Lottery (match 1 number) | 6 | 0.102 | 0.61 | 0.55 | 0.74 | 1.07 | Gambling odds |