Binomial Probability Distribution Calculator
Calculate binomial probabilities P(X=k), cumulative CDF, mean, variance, and visualize the full distribution for any n trials and probability p.
Full Distribution Table
| k | P(X = k) | P(X ≤ k) |
|---|
About
The binomial distribution models the number of successes in a fixed number of independent Bernoulli trials, each with the same probability p. Miscalculating cumulative probabilities leads to flawed hypothesis tests, incorrect confidence intervals, and bad quality-control decisions. This calculator computes the exact probability mass function P(X = k) and all cumulative probabilities using log-gamma arithmetic to prevent floating-point overflow for large n. It handles up to 10,000 trials without approximation.
Results include the mean ฮผ = np, variance ฯ2 = np(1 โ p), and a full distribution chart rendered on canvas. The tool assumes independence between trials and a constant probability per trial. For n > 1,000 the chart uses a Normal approximation for rendering speed while exact numeric results remain log-gamma based. Pro tip: verify your expected value against sample data before trusting any model. Real processes often violate the independence assumption.
Formulas
The probability of observing exactly k successes in n independent trials, each with success probability p:
The cumulative distribution function (CDF) gives the probability of at most k successes:
To avoid factorial overflow, the calculator uses the log-gamma function internally:
Descriptive statistics of the distribution:
Where n = number of trials (positive integer), k = number of successes (0 โค k โค n), p = probability of success on a single trial (0 โค p โค 1), ฮ = gamma function (continuous extension of factorial), ฮผ = expected value (mean), ฯ = standard deviation.
Reference Data
| Scenario | n | p | Mean (ฮผ) | Std Dev (ฯ) | P(X = 0) | Skewness |
|---|---|---|---|---|---|---|
| Coin flip (fair, 10 flips) | 10 | 0.5 | 5.0 | 1.581 | 0.000977 | 0.000 |
| Quality control (1% defect) | 100 | 0.01 | 1.0 | 0.995 | 0.366 | 0.985 |
| Drug efficacy trial | 50 | 0.7 | 35.0 | 3.240 | ≈0 | โ0.390 |
| Free throw shooting | 20 | 0.85 | 17.0 | 1.597 | ≈0 | โ0.439 |
| Survey response rate | 200 | 0.3 | 60.0 | 6.481 | ≈0 | 0.062 |
| Dice roll (getting a 6) | 12 | 0.1667 | 2.0 | 1.291 | 0.112 | 0.516 |
| Email open rate | 500 | 0.22 | 110.0 | 9.261 | ≈0 | 0.060 |
| Genetic trait (recessive) | 4 | 0.25 | 1.0 | 0.866 | 0.3164 | 0.577 |
| Server uptime (99.9%) | 365 | 0.001 | 0.365 | 0.604 | 0.694 | 1.630 |
| A/B test conversion | 1000 | 0.05 | 50.0 | 6.892 | ≈0 | 0.130 |
| Insurance claims | 10000 | 0.002 | 20.0 | 4.470 | ≈0 | 0.223 |
| Rare disease screening | 5000 | 0.0001 | 0.5 | 0.707 | 0.6065 | 1.413 |
| Election polling sample | 1500 | 0.48 | 720.0 | 19.35 | ≈0 | 0.005 |
| Manufacturing yield | 250 | 0.95 | 237.5 | 3.446 | ≈0 | โ0.261 |
| Lottery (6 from 49 approx) | 49 | 0.1224 | 6.0 | 2.294 | 0.0012 | 0.346 |