Bernoulli Trial Calculator

A Bernoulli trial is a single yes/no experiment with success probability p. Run n independent trials and the count of successes follows the binomial distribution. Enter the number of trials, the success probability, and a target number of successes k. The calculator returns the exact probability of exactly k successes, the cumulative probability of at most k successes, and the distribution's mean and variance. These four numbers cover the most common questions about coin flips, quality testing, conversion rates, and any repeated pass/fail process.

0.00
0.00
0.00
0.00

Binomial probability formula

P(X = k) = C(n, k) * p^k * (1 - p)^(n - k)
C(n, k) = n! / (k! * (n - k)!)
P(X <= k) = sum of P(X = i) for i = 0 to k
Mean = n * p
Variance = n * p * (1 - p)

The probability of exactly k successes multiplies the number of ways to choose which trials succeed by the probability of each specific success/failure pattern. The cumulative probability sums the mass from 0 up to k.

Worked examples

  • With n = 10, p = 0.5, k = 5: P(exactly 5) = 252 times 0.5^10 = 0.246 (about 24.61 percent).
  • The mean number of heads in 10 fair flips is 10 times 0.5 = 5.
  • The variance is 10 times 0.5 times 0.5 = 2.50.
  • Setting p = 1 makes P(exactly n) equal to 1, as every trial succeeds.
  • The cumulative output answers "what is the chance of k or fewer successes".

Bernoulli trial: frequently asked questions

What is a Bernoulli trial?

A Bernoulli trial is a single random experiment with exactly two outcomes, success (probability p) and failure (probability 1 minus p). Repeating n independent Bernoulli trials with the same p gives a binomial experiment, and the number of successes follows the binomial distribution.

What does this calculator return?

Given the number of trials n, the success probability p, and a target number of successes k, it returns the exact probability of exactly k successes, the probability of at most k successes (the cumulative probability), the mean n times p, and the variance n times p times (1 minus p).

What is the formula for exactly k successes?

The binomial probability mass function is P(X = k) = C(n,k) times p to the power k times (1 minus p) to the power (n minus k), where C(n,k) is the binomial coefficient n! divided by k! times (n minus k)!.

What is the mean and variance of a binomial distribution?

The mean (expected number of successes) is n times p. The variance is n times p times (1 minus p), and the standard deviation is the square root of the variance. These follow directly from the sum of n independent Bernoulli variables.

Are the inputs restricted?

The probability p must be between 0 and 1. The number of trials n must be a non-negative whole number, and the target k must be a whole number between 0 and n. Values outside these ranges return n/a.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.