What the Binomial Distribution Models
The binomial distribution models the number of successes in a fixed number of independent trials. Each trial must have exactly two possible outcomes, usually called success and failure, and the probability of success must stay the same for every trial.
In the formula, n is the number of trials, k is the number of successes, and p is the probability of success on each trial.
What Each Input Means
| Input | Meaning | Example |
|---|---|---|
| n | Total number of trials. | 10 coin flips. |
| k | Number of successes you want to test. | 6 heads. |
| p | Probability of success on one trial. | 0.5 for a fair coin. |
| b | Upper value used only for between mode. | P(6 ≤ X ≤ 8). |
Probability Types
| Mode | Meaning | Formula idea |
|---|---|---|
| Exact | Exactly k successes. | P(X = k) |
| Less than | Fewer than k successes. | P(X < k) |
| At most | k or fewer successes. | P(X ≤ k) |
| At least | k or more successes. | P(X ≥ k) |
| More than | More than k successes. | P(X > k) |
| Between | From k to b successes, inclusive. | P(k ≤ X ≤ b) |
Why This Calculator Avoids Direct Factorials
The old textbook formula uses factorials such as n!, k!, and (n−k)!. This is fine by hand for small numbers, but factorials grow extremely fast. In JavaScript, direct factorial calculations can overflow or lose precision.
This calculator uses logarithms and log-sum-exp when summing probabilities. That makes the calculation more stable for larger n than a recursive factorial method.
Example: Coin Flips
Suppose you flip a fair coin 10 times and want the probability of exactly 6 heads.
n = 10 k = 6 p = 0.5 P(X = 6) = C(10,6) × 0.5⁶ × 0.5⁴ C(10,6) = 210 P(X = 6) = 210 × 0.015625 × 0.0625 P(X = 6) ≈ 0.205078
Mean, Variance, and Standard Deviation
A binomial distribution has simple summary values:
Variance = n × p × (1 − p)
Standard Deviation = √[n × p × (1 − p)]
When a Binomial Model Makes Sense
- The number of trials is fixed before the experiment starts.
- Each trial has two outcomes: success or failure.
- The probability of success is the same for every trial.
- The trials are independent.
Common Mistakes
- Using a binomial model when trials are not independent.
- Changing p from trial to trial but still using a simple binomial formula.
- Entering a percentage like 50 instead of probability 0.5.
- Using a decimal value for k, even though successes must be a whole number.
- Confusing “at least k” with “more than k.”
Frequently Asked Questions
What is a binomial distribution?
It is a probability distribution for the number of successes in a fixed number of independent trials with the same probability of success.
Can p be 0 or 1?
Yes. If p = 0, success never occurs. If p = 1, every trial is a success.
Can k be larger than n?
No. You cannot have more successes than total trials. The calculator will show an input error.
What does C(n,k) mean?
C(n,k), also called n choose k, is the number of ways to choose k successful positions from n trials.
What is the difference between binomial and Poisson distributions?
The binomial distribution counts successes in a fixed number of trials. The Poisson distribution counts events in a fixed interval when events happen at an average rate.