acalculator

Binomial distribution: how likely is k?

Enter the number of trials, the chance of success on each, and a number of successes to get every binomial probability at once.

Your numbers

P(X = k)
0.246094

With 10 trials and p = 0.5, the chance of exactly 5 successes is 0.246094, and of at most 5 is 0.623047.

P(X < k)
0.376953
P(X ≤ k)
0.623047
P(X > k)
0.376953
P(X ≥ k)
0.623047
Mean (np)
5
Variance np(1 − p)
2.5
Standard deviation
1.581139

P(X = k): 0.246094. With 10 trials and p = 0.5, the chance of exactly 5 successes is 0.246094, and of at most 5 is 0.623047.

How likely is each number of successes?

How to calculate

Computes exact binomial probabilities P(X = k), P(X < k), P(X ≤ k), P(X > k), and P(X ≥ k) for n trials with success probability p, with the mean and standard deviation.

Example with the default inputs (Number of trials (n) 10, Probability of success (p) 0.5, Number of successes (k) 5): With 10 trials and p = 0.5, the chance of exactly 5 successes is 0.246094, and of at most 5 is 0.623047.

Method: P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ; P(X ≤ k) = Σ P(X = j) for j = 0 … k; mean = np; variance = np(1 − p).

  • The n trials are independent, and each has the same probability p of success.
  • Every probability is summed exactly from the decimal p you type, then rounded once, so tiny tails keep full precision.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Number of trials (n) 10, Probability of success (p) 0.5, Number of successes (k) 5 gives P(X = k) 0.246094, P(X < k) 0.376953, P(X ≤ k) 0.623047, P(X > k) 0.376953, Mean (np) 5, Standard deviation 1.581139.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm
  2. Number of trials (n) 20, Probability of success (p) 0.41, Number of successes (k) 12 gives P(X ≤ k) 0.973785, Mean (np) 8.2, Variance np(1 − p) 4.838, Standard deviation 2.199545.Source: OpenStax, Introductory Statistics 2e, §4.3 Binomial Distribution. https://openstax.org/books/introductory-statistics-2e/pages/4-3-binomial-distribution, Example 4.13 (P(x ≤ 12) = 0.9738, mean 8.2, standard deviation 2.20)
  3. Number of trials (n) 200, Probability of success (p) 0.015, Number of successes (k) 8 gives P(X ≤ k) 0.996496, Mean (np) 3.Source: OpenStax, Introductory Statistics 2e, §4.3 Binomial Distribution. https://openstax.org/books/introductory-statistics-2e/pages/4-3-binomial-distribution, Example 4.15 (P(x ≤ 8) = 0.9965, mean 3)
  4. Number of trials (n) 1,000, Probability of success (p) 0.001, Number of successes (k) 10 gives P(X ≥ k) 0, P(X = k) 0.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm
  5. Number of trials (n) 5, Probability of success (p) 0.1, Number of successes (k) 0 gives P(X = k) 0.59049, P(X < k) 0, P(X ≥ k) 1, P(X > k) 0.40951.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm
  6. Number of trials (n) 4, Probability of success (p) 0.3, Number of successes (k) 7 gives P(X = k) 0, P(X ≤ k) 1, P(X ≥ k) 0.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm

How it works

X is the number of successes in n independent trials, each a success with probability p.

  • P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ, with C(n, k) = n! ÷ (k! × (n − k)!).
  • P(X ≤ k) = P(X = 0) + P(X = 1) + … + P(X = k).
  • P(X < k) = P(X ≤ k) − P(X = k).
  • P(X > k) = 1 − P(X ≤ k).
  • P(X ≥ k) = 1 − P(X ≤ k) + P(X = k).
  • Mean = n × p. Variance = n × p × (1 − p). Standard deviation = √variance.

Exact arithmetic

The p you type is read as an exact decimal a ÷ D (0.41 is 41 ÷ 100). Then every probability above is a whole number divided by Dⁿ, and the calculator adds those whole numbers exactly. Each result is rounded once to the nearest 64-bit float, so a far tail such as 1.07 × 10⁻⁷ keeps all its digits and the five probabilities are consistent (P(X ≤ k) + P(X > k) = 1). The mean and variance are exact the same way; the standard deviation is the square root of the rounded variance.

Rules

  • n is a whole number from 1 to 1,000. p is from 0 to 1. k is a whole number from 0 to 1,000.
  • If k is more than n, k successes are impossible: P(X = k) = 0, P(X < k) = P(X ≤ k) = 1, and P(X > k) = P(X ≥ k) = 0.
  • With p = 0 every trial fails (P(X = 0) = 1); with p = 1 every trial succeeds (P(X = n) = 1).
  • Results show up to 6 decimal places (6 significant digits below 0.0001), with halves rounded up.

Worked examples by hand

5 heads in 10 fair coin tosses (n = 10, p = 0.5, k = 5). C(10, 5) = 252 and 0.5¹⁰ = 1/1024, so P(X = 5) = 252/1024 = 0.246094. The counts for 0 to 4 heads are 1, 10, 45, 120, 210, which add up to 386, so P(X < 5) = 386/1024 = 0.376953 and P(X ≤ 5) = 638/1024 = 0.623047. By symmetry P(X > 5) = 0.376953. Mean = 5, standard deviation = √2.5 = 1.581139.

20 students, p = 0.41, at most 12 (OpenStax Example 4.13). Adding P(X = 0) through P(X = 12) gives P(X ≤ 12) = 0.973785 (OpenStax: 0.9738). Mean = 20 × 0.41 = 8.2; variance = 8.2 × 0.59 = 4.838; standard deviation = 2.199545.

200 trials, p = 0.015, at most 8 (OpenStax Example 4.15). P(X ≤ 8) = 0.996496 (OpenStax: 0.9965). Mean = 200 × 0.015 = 3.

Rare events, n = 1,000, p = 0.001, at least 10. P(X ≥ 10) = 1 − P(X ≤ 9). With p = 1/1000 each term is a whole number over 1000¹⁰⁰⁰; the exact sum gives P(X ≥ 10) = 1.07428 × 10⁻⁷ and P(X = 10) = 9.78284 × 10⁻⁸.

No successes, n = 5, p = 0.1. P(X = 0) = 0.9⁵ = 0.59049, so P(X ≥ 0) = 1, P(X < 0) = 0, and P(X > 0) = 1 − 0.59049 = 0.40951.

k above n (n = 4, p = 0.3, k = 7): 7 successes in 4 trials cannot happen, so P(X = 7) = 0 and P(X ≤ 7) = 1.

Other questions people ask

What is a binomial distribution?

It counts the successes in a fixed number n of independent trials, when each trial has the same chance p of success, such as heads in 10 coin tosses or defective parts in a batch of 200. The number of successes X can be any whole number from 0 to n.

How do I calculate a binomial probability?

Use P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ, where C(n, k) = n! ÷ (k! (n − k)!) counts the ways to place k successes among n trials. For 5 heads in 10 fair tosses: C(10, 5) = 252, and 252 × 0.5¹⁰ = 252 ÷ 1024 = 0.246094.

What is the difference between P(X ≤ k) and P(X < k)?

P(X ≤ k) includes k itself; P(X < k) stops at k − 1. They differ by exactly P(X = k). The same holds for P(X ≥ k) and P(X > k).

How do I find the probability of at least one success?

Use P(X ≥ 1) = 1 − P(X = 0) = 1 − (1 − p)ⁿ. Enter k = 1 and read P(X ≥ 1). With p = 0.1 and 10 trials it is 1 − 0.9¹⁰ = 0.651322.

What are the mean and standard deviation of a binomial distribution?

The mean is n × p and the standard deviation is √(n × p × (1 − p)). For 20 trials with p = 0.41, the mean is 8.2 and the standard deviation is √4.838 = 2.1995.

When can I use the normal distribution instead?

A common rule is when both n × p and n × (1 − p) are at least 5 (some books say 10). This calculator does not need the approximation: it adds up the exact probabilities for up to 1,000 trials.