Binomial Distribution Calculator

Compute P(X = k), cumulative probabilities, mean, and variance for a binomial experiment.

Try: n=10, p=0.5, k=5 · n=20, p=0.3, k=6 · n=100, p=0.25, k=25


About the binomial distribution

What is a binomial distribution?

A random variable X follows a binomial distribution B(n, p) when it counts the number of successes in n independent Bernoulli trials, each with probability p of success. The four conditions required are: fixed number of trials n, each trial is independent, each trial has exactly two outcomes (success/failure), and the probability p is constant across trials.

Probability mass function (PMF)

The probability of obtaining exactly k successes in n trials is: \[P(X=k)=\binom{n}{k}p^k(1-p)^{n-k},\quad k=0,1,\ldots,n\] The term \(\binom{n}{k}\) counts the arrangements, \(p^k\) is the probability of k successes, and \((1-p)^{n-k}\) is the probability of the n−k failures.

Cumulative distribution function (CDF)

The probability of at most k successes is the cumulative sum: \[P(X\le k)=\sum_{i=0}^{k}\binom{n}{i}p^i(1-p)^{n-i}\] From this, \(P(X>k)=1-P(X\le k)\).

Mean and variance

The expected value and variance of B(n, p) have elegant closed forms: \[\mu = np \qquad \sigma^2 = np(1-p) \qquad \sigma = \sqrt{np(1-p)}\] The distribution is symmetric around its mean when p = 0.5, right-skewed when p < 0.5, and left-skewed when p > 0.5.


Frequently asked questions

Four conditions must hold: (1) fixed number of trials n, (2) each trial is independent, (3) each trial has exactly two outcomes (success or failure), (4) the probability of success p is constant from trial to trial. A classic example is flipping a fair coin n times and counting heads.
The PMF (probability mass function) gives the probability of obtaining exactly k successes: P(X = k). The CDF (cumulative distribution function) gives the probability of obtaining at most k successes: P(X ≤ k). The CDF is the running sum of PMF values.
The mode of B(n, p) is ⌊(n+1)p⌋ or ⌊(n+1)p⌋ − 1 when (n+1)p is an integer. When np is an integer, both np and np−1 are modes. The mode coincides with the mean when the distribution is symmetric (p = 0.5).
By the Central Limit Theorem, B(n, p) approaches a normal distribution N(np, np(1−p)) as n grows large. A common rule of thumb is that the normal approximation is adequate when np ≥ 5 and n(1−p) ≥ 5.
A Bernoulli distribution B(1, p) is a single trial with outcomes 0 or 1. A binomial distribution B(n, p) counts the total number of successes in n independent Bernoulli trials. The binomial distribution is the sum of n independent Bernoulli random variables with parameter p.


Send your feedback