Binomial Distribution Formula Calculator
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator computes the exact probability of getting a specific number of successes in a fixed number of independent trials, using the binomial distribution formula. You enter the number of trials (n), the probability of success per trial (p), and the number of successes you want (k), and it returns the probability P(X = k) along with the cumulative probability P(X ≤ k). The calculator also shows the expected value and standard deviation, so you can understand the full shape of the distribution at a glance.
Formula
The binomial distribution gives the probability of exactly k successes in n independent trials, where each trial has the same probability p of success. The formula is:
P(X = k) = C(n, k) × pk × (1 − p)n−k
Where:
- n = number of trials (a positive integer)
- k = number of successes (integer from 0 to n)
- p = probability of success on a single trial (between 0 and 1)
- C(n, k) = the binomial coefficient, “n choose k�, which counts how many ways k successes can be arranged among n trials. It equals n! / (k! × (n−k)!)
The cumulative probability P(X ≤ k) is the sum of P(X = i) for i = 0 to k. The expected value (mean) is n×p, and the standard deviation is √(n×p×(1−p)).
Worked Example
Using the default values from the calculator: n = 10 trials, p = 0.5, and we want exactly k = 3 successes.
- Calculate the binomial coefficient: C(10, 3) = 10! / (3! × 7!) = 120
- Compute pk = 0.53 = 0.125
- Compute (1−p)n−k = 0.57 = 0.0078125
- Multiply: 120 × 0.125 × 0.0078125 = 0.1171875
So P(X = 3) = 0.1171875, which rounds to 0.117188 as shown in the calculator. The cumulative probability P(X ≤ 3) is the sum of P(X=0) + P(X=1) + P(X=2) + P(X=3) = 0.000977 + 0.009766 + 0.043945 + 0.117188 = 0.171875. The expected value is 10 × 0.5 = 5, and the standard deviation is √(10 × 0.5 × 0.5) = √2.5 ≈ 1.5811.
When to Use the Binomial Distribution
The binomial distribution applies when all of the following conditions hold:
- There is a fixed number of trials (n).
- Each trial has only two possible outcomes: success or failure.
- The probability of success (p) is the same for every trial.
- The trials are independent – the outcome of one trial does not affect any other.
Common real-world examples include: flipping a coin 20 times and counting heads, checking 50 randomly selected products for defects where each has a 2% defect rate, or counting how many patients in a group of 30 respond to a treatment with a known response rate. If any condition fails – for example, the population is small and sampling is without replacement – the binomial may not be appropriate; the hypergeometric distribution might be better.
How to Read the Results
The calculator gives you two main probabilities:
- P(X = k) – the probability of getting exactly k successes. This is useful when you need a precise count, like “exactly 3 heads in 10 flips.�
- P(X ≤ k) – the probability of getting k or fewer successes. This is the cumulative probability, which answers questions like “what is the chance of 3 or fewer defective items?�
For example, if you are quality-checking a batch where 5% of items are defective and you sample 20 items, the probability of finding exactly 2 defects is about 0.1887, and the probability of finding 2 or fewer is about 0.9245. That tells you it’s quite likely to see 2 or fewer defects by chance alone.
Common Mistakes and Misconceptions
One frequent error is entering the probability as a percentage (e.g., 50 instead of 0.5). Always convert percentages to decimals before using the formula. Another mistake is confusing “exactly k� with “at most k� – the calculator provides both, but you must choose the right one for your question. Also, remember that n and k must be integers; the calculator will round if you enter decimals, but that is not mathematically meaningful. Finally, the binomial distribution assumes independence; if trials are not independent (e.g., drawing cards without replacement from a deck), the probabilities will be off.
Limits of the Formula
The binomial formula is exact for the conditions it assumes, but those conditions are often violated in practice. For large n (say, over 1000) and p not too close to 0 or 1, the normal approximation to the binomial is often used instead, because computing factorials for huge n becomes impractical. The calculator handles n up to a few thousand without issue, but beyond that, the factorial calculations may overflow. Also, the binomial distribution only works for discrete counts – it cannot model continuous outcomes or events with more than two outcomes per trial.
Alternatives to the Binomial Distribution
When the situation doesn’t fit the binomial assumptions, consider these alternatives:
- Hypergeometric distribution – used when sampling without replacement from a finite population, so trials are not independent.
- Poisson distribution – models the number of rare events in a fixed interval of time or space, when n is large and p is very small (e.g., number of car accidents in a day).
- Negative binomial distribution – counts the number of trials needed to achieve a fixed number of successes (e.g., how many shots until you make 5 free throws).
- Multinomial distribution – extends binomial to more than two outcomes per trial (e.g., rolling a die with six outcomes).
Frequently Asked Questions
What is the difference between binomial and normal distribution?
The binomial distribution is discrete – it gives probabilities for exact counts (like 3 successes). The normal distribution is continuous and describes many natural phenomena. When n is large and p is not too close to 0 or 1, the binomial distribution can be approximated by a normal distribution with mean np and variance np(1−p), but the binomial is exact for counting successes.
Can I use the binomial distribution for percentages?
Yes, but you must convert the percentage to a decimal. For example, if the probability of success is 25%, enter 0.25. The formula uses p as a decimal between 0 and 1.
What if the number of trials is very large?
For n above a few thousand, the factorial calculations may become too large for the calculator to handle. In such cases, use the normal approximation or a statistical software package. The rule of thumb is that the normal approximation works well when np ≥ 5 and n(1−p) ≥ 5.
Why does the calculator show a cumulative probability?
The cumulative probability P(X ≤ k) is often what you need for real decisions, like “what is the chance of 3 or fewer defects?� It saves you from adding up individual probabilities manually. It is also used in hypothesis testing and confidence intervals.
What does the expected value mean in a binomial distribution?
The expected value (mean) is the average number of successes you would get if you repeated the experiment many times. For example, if you flip a fair coin 10 times, the expected number of heads is 5. It is calculated as n × p.
Is the binomial distribution the same as the Bernoulli distribution?
A Bernoulli distribution is a special case of the binomial with n = 1 trial. It models a single success/failure outcome. The binomial distribution is the sum of n independent Bernoulli trials.
Related
Formula used
in n | Number of trials | - | 10 | 0 in p | Probability of success | - | 0.5 | 0 in k | Number of successes | - | 3 | 0 out prob | P(X = k) | - | ncr(n,k) * p^k * (1-p)^(n-k) | 6 out cum | P(X ≤ k) | - | sum(ncr(n,i) * p^i * (1-p)^(n-i), i, 0, k) | 6 out mean | Expected value | - | n * p | 2 out sd | Standard deviation | - | sqrt(n * p * (1-p)) | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.