AbraCalc

Binomial Probability Calculator

Calculate the exact binomial probability P(X = k) for n trials with probability p.

Embed this tool on your site

How to use this tool

  1. Enter trials (n), successes (k) and probability of success (p) in the fields above.
  2. Results update instantly as you type โ€” or click Calculate.
  3. Read your p(x = k) and the full breakdown beneath it.

P(X = k) = C(n,k) ร— p^k ร— (1โˆ’p)^(nโˆ’k). Calculated using log-space arithmetic to avoid overflow for large n.

Formula

P(X = k) = C(n, k) ร— pk ร— (1 โˆ’ p)n โˆ’ k

Where C(n, k) = n! / (k! ร— (n โˆ’ k)!) is the binomial coefficient. Computed in log-space to avoid overflow: ln P = ln C(n,k) + k ln p + (nโˆ’k) ln(1โˆ’p).

How it works

This calculator gives the exact probability of obtaining exactly k successes in n independent Bernoulli trials, each with success probability p.

To avoid numerical overflow for large n, the binomial coefficient and powers are computed using logarithms of factorials and then exponentiated. The model assumes each trial is independent and the probability p is constant across all trials.

Worked example

Worked example

  1. Inputs: n = 10 trials, k = 3 successes, p = 0.5.
  2. Binomial coefficient: C(10, 3) = 10! / (3! ร— 7!) = 120.
  3. Powers: pยณ = 0.5ยณ = 0.125; (1โˆ’p)โท = 0.5โท = 0.0078125.
  4. P(X = 3) = 120 ร— 0.125 ร— 0.0078125 = 120 ร— 0.000976563 โ‰ˆ 0.1172.

P(X = 3) = 0.1172

Key terms

Binomial distribution
A discrete probability distribution counting the number of successes in n independent trials, each with the same probability p of success.
Binomial coefficient C(n, k)
The number of distinct ways to choose k items from n items without regard to order; also written as n-choose-k or (n k).
Bernoulli trial
A single experiment with exactly two possible outcomes (success or failure), each with fixed probabilities p and 1 โˆ’ p.
Independence
The assumption that the outcome of one trial does not affect any other trial; required for the binomial model to apply.
Expected value
The mean number of successes in a binomial experiment: E[X] = n ร— p.

Frequently asked questions

What is the binomial distribution?
The binomial distribution models the number of successes in n independent yes/no trials, each with the same probability p of success. Classic examples: coin flips, pass/fail tests.

References & sources