Binomial probability calculator

Probability of exactly k, at most k and at least k successes in a run of independent trials.

Inputs

Binomial probability calculator

4 fields

Results are reference estimates. Verify the inputs before making important decisions.

Fill in the fields and the result will appear here automatically.

Computes probabilities for a run of independent trials with the same chance of success each time. The formula C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ has three factors doing different jobs: how many ways the successes can be arranged among the trials, how likely those successes are, and how likely the remaining failures are. Alongside the probability of exactly k it shows the cumulative «at most» and «at least» probabilities — in practice those are the ones usually wanted — plus the expected value and standard deviation of the run.

FAQ
5 questions
Freshness
formula-based

How it works

Formula and logic

The probability of exactly k successes is C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ. Cumulative values come from summing over the relevant k. The expected value is n·p and the deviation the root of n·p·(1−p). The supported range is 1–1000 trials; n and k are integers with 0 ≤ k ≤ n. Combinations use exact integer arithmetic, while displayed probabilities are rounded. Small nonzero probabilities use scientific notation; an unrepresentable selected result produces a range error.

Example

Exactly three heads in ten tosses of a fair coin has probability 0.1172 — about 11.72% of runs.

Fields and units

  • Number of trials — unitless
  • Number of successes — unitless
  • Probability of success in one trial — unitless
  • What to calculate — list option

How to use

  • — Enter the number of trials in the run.
  • — Enter the number of successes the probability is wanted for.
  • — Enter the probability of success in a single trial, from 0 to 1.
  • — Choose the probability of exactly k or a cumulative probability.

Method and limitations

Calculation method
Formula and logic
Limitation
Computes probabilities for a run of independent trials with the same chance of success each time. If trials influence each other the model does not fit.

FAQ

When does this formula apply?

When trials are independent, their number is fixed and the chance of success is the same each time. If trials influence each other the model does not fit.

How does «at most k» differ from «exactly k»?

The cumulative probability sums every outcome up to and including k. In practice the question is usually «no more than how many», not «exactly this many».

Why are combinations not computed from factorials?

Successive multiplication and exact integer division produce C(n,k) without evaluating two large factorials. This makes the count exact, not the displayed probability. The claim that 20! must already lose precision is incorrect: 20!, 21! and 22! are exactly representable; 23! is the first inexact factorial in binary64.

What happens at a probability of 0 or 1?

The outcome becomes certain: at p = 1 every trial succeeds, at p = 0 none does. The standard deviation is zero in both cases.

Why can successes not exceed trials?

Because no such outcome exists. Formally the probability is zero, but in practice it is a typo, so the calculation stops.