User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Integer from 1 to 10,000
Integer from 0 to n
Value from 0 to 1
Presets:
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

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.

binomial distribution probability calculator statistics CDF PMF binomial coefficient discrete probability

Formulas

The probability of observing exactly k successes in n independent trials, each with success probability p:

P(X = k) = n!k! (n โˆ’ k)! โ‹… pk โ‹… (1 โˆ’ p)n โˆ’ k

The cumulative distribution function (CDF) gives the probability of at most k successes:

P(X โ‰ค k) = kโˆ‘i=0 n!i! (n โˆ’ i)! โ‹… pi โ‹… (1 โˆ’ p)n โˆ’ i

To avoid factorial overflow, the calculator uses the log-gamma function internally:

ln P(X = k) = lnฮ“(n + 1) โˆ’ lnฮ“(k + 1) โˆ’ lnฮ“(n โˆ’ k + 1) + k โ‹… ln(p) + (n โˆ’ k) โ‹… ln(1 โˆ’ p)

Descriptive statistics of the distribution:

ฮผ = np , ฯƒ2 = np(1 โˆ’ p) , ฯƒ = โˆšnp(1 โˆ’ p)

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

ScenarionpMean (ฮผ)Std Dev (ฯƒ)P(X = 0)Skewness
Coin flip (fair, 10 flips)100.55.01.5810.0009770.000
Quality control (1% defect)1000.011.00.9950.3660.985
Drug efficacy trial500.735.03.240≈0โˆ’0.390
Free throw shooting200.8517.01.597≈0โˆ’0.439
Survey response rate2000.360.06.481≈00.062
Dice roll (getting a 6)120.16672.01.2910.1120.516
Email open rate5000.22110.09.261≈00.060
Genetic trait (recessive)40.251.00.8660.31640.577
Server uptime (99.9%)3650.0010.3650.6040.6941.630
A/B test conversion10000.0550.06.892≈00.130
Insurance claims100000.00220.04.470≈00.223
Rare disease screening50000.00010.50.7070.60651.413
Election polling sample15000.48720.019.35≈00.005
Manufacturing yield2500.95237.53.446≈0โˆ’0.261
Lottery (6 from 49 approx)490.12246.02.2940.00120.346

Frequently Asked Questions

Instead of computing n! directly (which overflows JavaScript's Number at roughly n > 170), the calculator works in log-space. It computes ln(P) using the log-gamma function: ln ฮ“(n+1) โˆ’ ln ฮ“(k+1) โˆ’ ln ฮ“(nโˆ’k+1) + kยทln(p) + (nโˆ’k)ยทln(1โˆ’p), then exponentiates the result. This keeps intermediate values within floating-point range for n up to 10,000 and beyond.
The standard rule of thumb requires both np โ‰ฅ 5 and n(1โˆ’p) โ‰ฅ 5. Under these conditions, the binomial distribution is well-approximated by a Normal distribution with mean ฮผ = np and variance ฯƒยฒ = np(1โˆ’p). For more precise work, apply a continuity correction: P(X โ‰ค k) โ‰ˆ ฮฆ((k + 0.5 โˆ’ ฮผ)/ฯƒ). This calculator uses exact log-gamma computation for numeric results regardless of n, but the chart rendering uses Normal density for n > 1,000 to maintain rendering speed.
When p = 0, every trial fails. P(X = 0) = 1 and P(X = k) = 0 for all k > 0. When p = 1, every trial succeeds. P(X = n) = 1 and P(X = k) = 0 for all k < n. The calculator handles these edge cases explicitly before entering the log-gamma pathway, since ln(0) is undefined.
Skewness equals (1 โˆ’ 2p) / โˆš(np(1โˆ’p)). When p = 0.5, skewness is zero and the distribution is perfectly symmetric. When p < 0.5, the distribution is right-skewed (tail extends toward higher k). When p > 0.5, it is left-skewed. Extreme skewness (p near 0 or 1 with small n) means the Normal approximation is unreliable.
No. The binomial distribution is a discrete distribution defined only for integer values of k from 0 to n. If you enter a non-integer, the calculator rounds to the nearest integer and displays a warning. For continuous analogs, consider the Beta distribution or Normal approximation.
A Bernoulli distribution is a special case of the binomial with n = 1. It models a single trial with outcomes 0 (failure) or 1 (success). The binomial distribution is the sum of n independent Bernoulli random variables, each with the same probability p. Setting n = 1 in this calculator gives you Bernoulli probabilities directly.
They overlap at k. P(X โ‰ค k) + P(X โ‰ฅ k) = 1 + P(X = k). The complementary pairs are P(X โ‰ค k) + P(X > k) = 1 and P(X < k) + P(X โ‰ฅ k) = 1. The calculator displays all five probabilities to prevent this common confusion.