Math
Binomial Distribution Calculator
Compute binomial PMF and CDF for n trials and success probability p. Returns P(X=k), P(X<=k), P(X>=k), range probability, mean, variance, and mode.
Binomial distribution inputs
Enter n as a whole number from 1 to 10,000, p as a decimal between 0 and 1, and k as a whole number from 0 to n.
P(X = k)
0.246094
24.6094%
Probability of exactly k successes in n independent trials.
P(X = k)
0.246094
P(X <= k)
0.623047
P(X > k)
0.376953
P(X >= k)
0.623047
Mean (n p)
5
Variance
2.5
Std deviation
1.5811
Mode (most likely k)
5
Frequently Asked Questions about the Binomial Distribution Calculator
What is a binomial distribution?
It models the number of successes in n independent yes-or-no trials where each trial has the same probability p of success. Coin flips, free-throw streaks, and pass-or-fail quality checks are classic examples.
What is the formula for P(X = k)?
P(X = k) = C(n, k) x p^k x (1 - p)^(n - k), where C(n, k) is the binomial coefficient n! / (k! (n - k)!). For n = 10, p = 0.5, k = 5 this gives 252 x 0.5^10 = 0.2461.
How does the calculator handle very large n without overflow?
It evaluates the PMF in log space using log-gamma: log P(X = k) = lgamma(n + 1) - lgamma(k + 1) - lgamma(n - k + 1) + k ln(p) + (n - k) ln(1 - p), then exponentiates. That keeps every term finite for n up to 10,000.
What are the mean, variance, and mode of a binomial?
Mean = n x p, variance = n x p x (1 - p), and the mode is floor((n + 1) x p). For n = 20, p = 0.3 you get mean 6.0, variance 4.2, std deviation about 2.05, and mode 6.
When should I use the binomial versus a normal approximation?
Use the binomial directly whenever you can. The normal approximation is only a shortcut for hand calculation when n is large and p is not too close to 0 or 1 (a common rule is np and n(1-p) both at least 5). This calculator computes the exact binomial probabilities.