Binomial Distribution Calculator
The binomial distribution is the discrete probability distribution that models the number of successes in n independent trials. Every trial has only two outcomes (success/failure) and the success probability p stays the same throughout: how many of 20 products come out defective, how many heads appear in 10 tosses, and how many of 50 patients respond to treatment are all computed with this distribution.
After giving P(X = k) for a single value of k, this calculator returns the cumulative probabilities (P(X ≤ k), P(X < k), P(X ≥ k), P(X > k)), the probability of any range [a, b] you choose, and the mean (n·p), variance (n·p·(1−p)), standard deviation, and mode of the distribution. It also checks the np ≥ 5 and n(1−p) ≥ 5 criterion and tells you whether the normal approximation may be used with these parameters.
Binomial Distribution Formulas
Mass function: P(X = k) = C(n, k) · pᵏ · (1 − p)ⁿ⁻ᵏ, k = 0, 1, …, n Combination: C(n, k) = n! / [k! · (n − k)!] Cumulative: P(X ≤ k) = Σᵢ₌₀ᵏ C(n, i) · pⁱ · (1 − p)ⁿ⁻ⁱ Upper tail: P(X ≥ k) = 1 − P(X ≤ k − 1) Range: P(a ≤ X ≤ b) = P(X ≤ b) − P(X ≤ a − 1) Mean: μ = n · p Variance: σ² = n · p · (1 − p) Standard dev.: σ = √[n · p · (1 − p)] Mode: ⌊(n + 1) · p⌋ Normal approx.: if n·p ≥ 5 and n·(1 − p) ≥ 5 then X ≈ N(n·p, n·p·(1 − p))
Cumulative probabilities are evaluated with the regularized incomplete beta function (I₁₋ₚ(n − k, k + 1)) rather than a summation loop, which keeps the result exact and fast even for very large n. The normal approximation is only for hand calculation — this calculator always returns the exact binomial value.
How to Calculate
- Enter the number of trials (n): how many independent repetitions were made.
- Enter the success probability of a single trial (p) between 0 and 1; write 0.3 for 30 percent.
- Enter the number of successes (k) whose probability you are interested in.
- If you like, set the range bounds (a and b); the calculator also returns P(a ≤ X ≤ b).
- Read the exact, cumulative, and tail probabilities on the result card, then the mean, variance, standard deviation, and mode.
- Check the normal approximation criterion and the mass chart to judge the shape and symmetry of the distribution.
Worked Examples
6 successes in 20 trials
With n = 20 and p = 0.3, the probability of exactly 6 successes is P(X = 6) = 0.1916. The probability of at most 6 successes is 0.6080 and of at least 6 successes 0.5836. The mean is 6 successes, the standard deviation is 2.0494, and P(4 ≤ X ≤ 8) = 0.7796. Since n·p = 6 and n·(1−p) = 14, the normal approximation is also suitable.
Exactly 6 successes — P(X = 6): 0.1916 · At most 6 successes — P(X ≤ 6): 0.6080 · Fewer than 6 — P(X < 6): 0.4164
Quality control: no defects among 50 products
When 50 products are drawn from a line with a 2% defect rate, the probability of finding no defective item is P(X = 0) = 0.3642. The probability of finding at least one defect is P(X > 0) = 0.6358, and the probability of at most one defect is P(0 ≤ X ≤ 1) = 0.7358. On average 1 defective product is expected; because n·p = 1 < 5 the normal approximation is not suitable and the calculator issues a warning.
Exactly 0 successes — P(X = 0): 0.3642 · At most 0 successes — P(X ≤ 0): 0.3642 · Fewer than 0 — P(X < 0): 0
Number of heads in 10 tosses
With a fair coin, the probability of exactly 5 heads in 10 tosses is P(X = 5) = 0.2461. The probability of getting between 4 and 6 heads is P(4 ≤ X ≤ 6) = 0.6562. At p = 0.5 the distribution is symmetric: the mean is 5, the standard deviation is 1.5811, and the mode is 5.
Exactly 5 successes — P(X = 5): 0.2461 · At most 5 successes — P(X ≤ 5): 0.6230 · Fewer than 5 — P(X < 5): 0.3770