Binomial Distribution Calculator
When the same trial is repeated and you count the successes — heads in 10 coin tosses, defective items in a sample of 20, correct guesses on a quiz — the count X follows a binomial distribution, written X ~ B(n, p). This calculator finds the probability of exactly k successes, the cumulative probability of at most or at least k, and the distribution’s mean and standard deviation, showing every step in exact fractions. Pick a mode and press the buttons; there is almost nothing to type. For the topic taught in full, see the Binomial distribution lesson; or ask the question in your own words on the Arithly home page — hints first, then the whiteboard. Free, no sign-up.
P(X = k) = C(n, k) pk (1 − p)n−k: one exact count of successes.
A cumulative probability adds one term for every count in the range — P(X ≤ k) adds X = 0 up to X = k; P(X ≥ k) adds X = k up to X = n.
Mean = np and variance = npq, with q = 1 − p; the standard deviation is √(npq). No k is needed for this mode.
The result appears here as you change the numbers.
The binomial formula
The probability of exactly k successes in n trials is
P(X = k) = C(n, k) × pk × (1 − p)n−k
- n is the number of trials — how many times the trial is repeated.
- k is the number of successes you are asking about.
- p is the probability of success on one trial, and q = 1 − p is the probability of failure on one trial.
- C(n, k) counts the ways of choosing WHICH k of the n trials are the successes; pk is the k success factors multiplied together, and qn−k is the failure factors for the remaining trials.
When the binomial model applies
X ~ B(n, p) is the right model only when all four of these conditions hold:
- There is a fixed number n of trials, decided before you start.
- The trials are independent — one trial’s result does not change another’s chances.
- Each trial has exactly two outcomes: success or failure.
- The probability p of success is the same on every trial.
Sampling without replacement from a small group breaks the last two conditions (the chances change after each draw) — that is a different distribution, and this calculator does not use it.
How the calculator works
- Exactly k. One term of the formula. The combination C(n, k) is cancelled down before multiplying out, and the answer is an exact fraction — a decimal echo is added when p was typed as a decimal or a percent.
- Cumulative. Every term in the range is worked out and added: P(X ≤ 2) = P(X = 0) + P(X = 1) + P(X = 2). Because each term is exact, the total is exact too.
- Mean & standard deviation. Mean = np (the count you expect on average), variance = npq, and the standard deviation is the square root of the variance.
- The same engine. The calculator and the Solve box share one verified solver: every probability here is checked by adding up the WHOLE distribution — all n + 1 terms must come to exactly 1 — before the answer is shown.
Every answer can be checked in words: the Solve box solves the same questions with hints and a whiteboard, and the three worked examples below are its own output, word for word.
Think first
Arithly gives hints before the answer. For the first worked example below, the hints are:
- P(X = k) = C(n, k) p^k q^(n−k), with q = 1 − p.
- Cancel inside C(n, k) before multiplying out.
- The answer is 393216/1953125 (≈ 0.2013).
Worked examples
A basketball player makes 80% of her free throws. She takes 10 free throws. Find the probability that she makes exactly 7
- X counts the number of successes in n independent trials, each with the same success probability p — a BINOMIAL distribution, X ~ B(n, p). Here n = 10 and p = 4/5 (X ~ B(10, 80%)).
- The probability of failure on one trial is q = 1 − p = 1 − 4/5 = 1/5.
- The binomial formula: P(X = k) = C(n, k) × p^k × q^(n−k) — C(n, k) chooses WHICH k of the n trials succeed, p^k is the k success factors multiplied together, and q^(n−k) is the failure factors for the remaining trials.
- Choosing which 7 trials succeed is the same as choosing which 3 fail, so C(10, 7) = C(10, 3) — work with the smaller number, 3.
- C(10, 7) = (10 × 9 × 8) / (3 × 2 × 1) — the falling product of 3 factors over 3!. Cancel common factors BEFORE multiplying out.
- Cancelling: 9 ÷ 3 = 3 (the 3 below cancels into the 9 above); 10 ÷ 2 = 5 (the 2 below cancels into the 10 above). This leaves 5 × 3 × 8.
- C(10, 7) = 5 × 3 × 8 = 120.
- The success factors: p^7 = (4/5)^7 = 16384/78125. The failure factors: q^3 = (1/5)^3 = 1/125.
- Multiply the three parts: P(X = 7) = 120 × 16384/78125 × 1/125 = 1966080/9765625 = 393216/1953125.
Answer: 393216/1953125 (≈ 0.2013)
Try it in the calculator above: mode Exactly k, n = 10, p = 80% (type it as 0.8 or 80%), k = 7 — the same answer, worked the same way.
A fair coin is tossed 8 times. What is the probability of getting at most 2 heads?
- X counts the number of successes in n independent trials, each with the same success probability p — a BINOMIAL distribution, X ~ B(n, p). Here n = 8 and p = 1/2 (a fair coin tossed 8 times (success = the face asked about)).
- The probability of failure on one trial is q = 1 − p = 1 − 1/2 = 1/2.
- The binomial formula: P(X = k) = C(n, k) × p^k × q^(n−k) — C(n, k) chooses WHICH k of the n trials succeed, p^k is the k success factors multiplied together, and q^(n−k) is the failure factors for the remaining trials.
- The asked range is X from 0 to 2 — add the probability of EACH count in the range (each term uses the same binomial formula):
- P(X = 0) = 1/256; P(X = 1) = 1/32; P(X = 2) = 7/64.
- Add them: P(X ≤ 2) = 37/256.
Answer: 37/256
That one is mode Cumulative with At most k: n = 8, p = 0.5, k = 2.
Find the mean and standard deviation of a binomial distribution with n = 20 and p = 0.4
- In a binomial distribution X ~ B(n, p): n is the number of independent trials and p is the probability of success on each trial. Here n = 20 and p = 2/5 (X ~ B(20, 0.4)).
- The failure probability is q = 1 − p = 1 − 2/5 = 3/5 — q is the probability that a trial does NOT succeed.
- Mean = np — the number of trials times the success probability: mean = 20 × 2/5 = 8.
- Variance = npq: variance = 20 × 2/5 × 3/5 = 24/5.
- Standard deviation = √variance: SD ≈ 2.1909.
Answer: Mean = 8; Standard deviation ≈ 2.1909
And that one is mode Mean & standard deviation: n = 20, p = 0.4.
Ask it in words
Every shape below is one the Arithly Solve box answers today, with the same hints, steps and checking as the examples above:
- In symbols — “X ~ B(10, 0.3). Find P(X = 4)”, ranges like P(2 ≤ X ≤ 5), the probability of at least one success, and E(X) and Var(X) in the B(n, p) dress.
- Coins and dice — “A fair coin is tossed 6 times. Find the probability of 3 or more heads”, “In 4 rolls of a fair die, find the probability of at least one six”, counts written as words (“exactly one six”, “at most twice”) as well as digits.
- Word problems — samples and batches with a stated defect rate (“20% of items are faulty. A sample of 10 items is taken”), percents of a group, free throws and shots at a stated percentage, multiple-choice guessing, and the expected number of successes.
- Backwards — “The mean of a binomial distribution is 6 and its variance is 4.2. Find n and p”: the two facts together pin down both parameters.
- The ideas themselves — “What is a binomial distribution?”, the formula, all four conditions for using one, what B(n, p) means, and the mean, variance and standard deviation formulas.
Honest notes: exact probabilities are worked for up to 30 trials and cumulative ones for up to 20 — the same limits as the solver, because every answer is added up exactly rather than rounded from a table. Counts of failures (“at least one failure”) and draws without replacement are different questions and are not quietly answered as if they were this one; for large n the usual next step is the normal approximation, a separate topic.
Practice
Each question opens in the Arithly solver — try it yourself first, then compare:
- A multiple choice test has 10 questions. Each question has 4 options. A student guesses every answer. Find the probability of getting exactly 3 correct Try it in the solver →
- For X ~ B(10, 0.3), find the probability of at least one success Try it in the solver →
- The mean of a binomial distribution is 6 and its variance is 4.2. Find n and p Try it in the solver →
Related topics
Binomial distribution
The topic taught as a lesson: the formula built up from coin tosses, a worked example and the mean and variance.
Probability Calculator
One event, complements, two events and repeated trials — exact fractions with steps.
Z-Score Calculator
Turn a value into a z-score, a z-score back into a value, and read off its percentile.
Permutations and combinations
C(n, k) itself: choosing which trials succeed is a combination — order does not matter.
More topics: all maths topics · Next topic: Integer Calculator
Arithly — free maths help, hints first. About · Privacy · Licence (CC BY-NC 4.0)