What this calculator does
This is a pure-math probability tool based on the binomial distribution. It tells you how likely a specific outcome is to occur exactly m times across n independent trials, where each trial succeeds with probability p. The classic example is rolling a fair six-sided die: a single chosen face appears with probability \(p = 1/6\) on each roll. The math is universal, though - any per-trial success probability between 0 and 1 works (coin flips, free-throw makes, defect rates, and more).
How to use it
Enter the number of trials n (1 to 500), the probability per trial p, and a target number of successes m. You may type p as a decimal such as 0.1667 or as a fraction such as 1/6; the calculator evaluates the fraction to a decimal automatically. Importantly, p is a probability in the range 0 to 1, not a percentage - enter 1/6, not 16.67. The result shows \(P(X = m)\) plus a full table of \(P(X = m)\) for every m from 0 to n, the cumulative \(P(X \le m)\) and \(P(X \ge m)\), the mean, and the variance.
The formula explained
The probability of exactly m successes is $$P(X = m) = \binom{\text{Trials }n}{\text{Successes }m} \, p^{\,m} \left(1-p\right)^{n-m}$$ where \(C(n, m) = n! / (m! (n - m)!)\) is the binomial coefficient ("n choose m"). The mean is \(\mu = n\cdot p\) and the variance is \(\sigma^{2} = n\cdot p\cdot(1 - p)\). For large n the calculator works in log-space using the log-gamma function to avoid factorial overflow.
Worked example
Roll a die \(n = 10\) times; what is the chance a chosen face shows up exactly \(m = 2\) times? Here \(p = 1/6\). \(C(10, 2) = 45\), \(p^{2} = 1/36 \approx 0.027778\), and \((5/6)^8 \approx 0.232557\). So $$P(X = 2) = 45 \times 0.027778 \times 0.232557 \approx 0.29071,$$ about 29.07%. The mean is \(10/6 \approx 1.667\) and the variance is \(10 \times (1/6) \times (5/6) \approx 1.389\).
FAQ
Is p a percentage? No. p is a probability between 0 and 1. For a die face use 1/6 or about 0.1667, not 16.67.
How do I get "at least once"? Use \(P(X \ge 1) = 1 - P(X = 0)\). For 3 dice and a specific face: \(1 - (5/6)^{3} = 1 - 0.578704 \approx 0.4213\), or about 42.13%.
Why do the table probabilities add to 1? Every trial must produce some number of successes from 0 to n, so the probabilities of all mutually exclusive outcomes sum to exactly 1 - a handy sanity check.