Written and maintained by CASRAI Editorial Board
Last updated
The expected value of a binomial distribution is E(X) = np: the number of trials n multiplied by the probability of success p on each trial. For 20 trials with p = 0.3, the expected number of successes is 20 × 0.3 = 6. This guide gives the formula symbol by symbol, a short derivation, a worked example with the arithmetic shown, a reading guide for comparing an observed count with np, and Excel, R and Python snippets that confirm the result.
Expected Value of a Binomial Distribution: Definition in One Paragraph
A binomial random variable X counts the successes in n trials. The NIST/SEMATECH e-Handbook of Statistical Methods says the binomial distribution is used “when there are exactly two mutually exclusive outcomes of a trial” and that it “assumes that p is fixed for all trials.” The expected value (the mean) of X is the long-run average number of successes you would see if the same n-trial experiment were repeated many times. It describes the probability model, not any one experiment. For the general idea of a probability-weighted average, see the expected value formula guide.
Formula for the Expected Value of a Binomial Distribution
The probability mass function (NIST) is P(x; p, n) = C(n, x) px (1 − p)n − x, for x = 0, 1, 2, …, n. NIST gives the mean as np and the standard deviation as √(np(1 − p)). OpenStax Introductory Statistics 2e (section 4.3) writes the same results as μ = np and σ2 = npq, with q = 1 − p.
- X is the number of successes.
- n is the fixed number of trials.
- p is the probability of success on a single trial, between 0 and 1.
- q = 1 − p is the probability of failure on a single trial.
- np is the expected value E(X). np(1 − p) is the variance, and its square root is the standard deviation.
Why E(X) = np: the linearity argument
This derivation is standard probability theory rather than a quotation from the sources above. Write X as the sum of n indicator variables, X = I1 + I2 + … + In, where Ii is 1 if trial i is a success and 0 otherwise. Each indicator has E(Ii) = 1 × p + 0 × (1 − p) = p. Expected values add, so E(X) = p + p + … + p = np. This step does not need the trials to be independent. The variance formula np(1 − p) does need independence, because it relies on the indicators not being correlated.
Worked Example With the Arithmetic Shown
Suppose n = 20 and p = 0.3.
- Expected value: E(X) = np = 20 × 0.3 = 6.
- Variance: np(1 − p) = 20 × 0.3 × 0.7 = 4.2.
- Standard deviation: √4.2 = 2.05 (rounded to two decimals).
- Check by summing k × P(X = k) over k = 0 to 20 using the probability mass function: the sum is 6.000, matching np.
The most likely single outcome here is also 6, with P(X = 6) = C(20, 6) × 0.36 × 0.714 = 0.1916. Because the mean is a whole number in this case, it happens to be a possible outcome. That is not guaranteed.
When the expected value is not a possible outcome
With n = 10 and p = 0.25, E(X) = 10 × 0.25 = 2.5. No trial sequence produces 2.5 successes; the two nearest outcomes have P(X = 2) = 0.2816 and P(X = 3) = 0.2503. The expected value is an average over repetitions, so it can fall between whole numbers.
Interpretation: What np Tells You
np is the centre of the distribution, so an observed count close to np is unremarkable and one far from it deserves a second look. The table converts distance from np into standard-deviation units for the example above (n = 20, p = 0.3, SD = 2.05). Each distance is (observed − np) / √(np(1 − p)); the probabilities are computed from the binomial formula.
| Observed successes | Observed − np | Distance in SD units | Probability of this many or more |
|---|---|---|---|
| 6 | 0 | 0.00 | P(X ≥ 6) is about 0.58, so 6 is the centre of the distribution |
| 8 | +2 | 0.98 | P(X ≥ 8) = 0.228 |
| 10 | +4 | 1.95 | P(X ≥ 10) = 0.048 |
| 12 | +6 | 2.93 | P(X ≥ 12) = 0.005 |
To get the exact tail probability for your own n and p, use the binomial probability calculator guide rather than relying on a distance in SD units alone. The standard deviation guide explains the spread measure used in the third column.
Assumptions and Common Mistakes
- Fixed number of trials. OpenStax lists “a fixed number of trials” as the first characteristic of a binomial experiment. If n is itself random, np no longer describes the count.
- Two outcomes per trial. OpenStax: “only two possible outcomes, called ‘success’ and ‘failure’.” If trials have more than two outcomes, a multinomial model is needed.
- Constant p. NIST states the distribution “assumes that p is fixed for all trials.” If p drifts across trials (for example, a rate that differs between sites), np with a single p is the wrong centre.
- Independent trials. OpenStax: “the n trials are independent and are repeated using identical conditions.” Sampling without replacement from a small finite population breaks independence. Take 20 items without replacement from 100 items of which 30 are successes: the mean is still 20 × 30/100 = 6, but the variance is 3.39 under the hypergeometric formula n(K/N)(1 − K/N)(N − n)/(N − 1), smaller than the binomial 4.2. Using np(1 − p) there overstates the spread.
- Confusing the expected count with the expected proportion. np is a count. The expected proportion of successes is p. For a confidence interval on an observed proportion, see confidence interval for a proportion.
- Using the wrong distribution. If you are counting trials until a number of successes rather than successes in a fixed number of trials, see the negative binomial distribution. For counts of events with no fixed number of trials, see the Poisson distribution.
How to Report It (APA-Style Example)
Report the model parameters, the expected count and the observed count, and give the spread. APA style sets statistical symbols such as n, p and SD in italics. The sentence below uses invented numbers for illustration only.
Of the 20 participants, 11 met the screening criterion. Under a binomial model with p = .30, the expected number meeting the criterion was np = 6.00 (SD = 2.05); the observed count was 5.00 above expectation, and the probability of 11 or more successes was P(X ≥ 11) = .017.
State the value of p you assumed and where it came from. A reader cannot judge the comparison without knowing whether p was fixed in advance or estimated from the same data.
How to Calculate It in Excel, R or Python
Each snippet uses n = 20 and p = 0.3 and returns 6. The expected value itself is just n × p; the longer lines confirm it by summing k × P(X = k).
Excel
Put 0 to 20 in A2:A22. In B2 enter the formula below and fill down to B22:
=BINOM.DIST(A2, 20, 0.3, FALSE)
Then:
=20*0.3
=SUMPRODUCT(A2:A22, B2:B22)
Both return 6.
R
The R documentation for the binomial distribution names the arguments size (n) and prob (p), and dbinom returns the probability mass function.
n <- 20; p <- 0.3
n * p # 6
sum(0:n * dbinom(0:n, n, p)) # 6, summing k * P(X = k)
n * p * (1 - p) # 4.2, the variance
Python
The SciPy documentation for scipy.stats.binom takes n and p as shape parameters and provides mean, stats and expect.
from scipy.stats import binom
n, p = 20, 0.3
print(binom.mean(n, p)) # 6.0
print(binom.stats(n, p, moments='mv')) # (6.0, 4.2)
print(binom.expect(lambda k: k, args=(n, p))) # about 6.0, summing k * P(X = k)
Binomial Distribution Expected Value FAQ
What is the expected value of a binomial distribution?
It is E(X) = np, the number of trials multiplied by the probability of success per trial. With n = 20 and p = 0.3, E(X) = 6.
What is the expected value for a binomial distribution with n = 10 and p = 0.25?
E(X) = 10 × 0.25 = 2.5. The expected value does not have to be a whole number, even though X itself only takes whole-number values.
What is the variance of a binomial distribution?
The variance is np(1 − p) and the standard deviation is its square root (NIST). For n = 20 and p = 0.3 the variance is 4.2 and the standard deviation is 2.05.
Does the expected value formula np still work if the trials are not independent?
The mean of the success count is still the sum of the individual success probabilities, so it equals np when every trial has the same p. The variance np(1 − p) and the binomial probabilities do not hold without independence, so interpret spread and tail probabilities with care.
Is the expected value the most likely outcome?
Not always. In the n = 20, p = 0.3 example the most likely outcome is 6, which equals np. In the n = 10, p = 0.25 example the mean is 2.5, and the most likely outcome is 2.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, “Binomial Distribution”: https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm (date checked: 2026-10-29).
- OpenStax, Introductory Statistics 2e, section 4.3 “Binomial Distribution”: https://openstax.org/books/introductory-statistics-2e/pages/4-3-binomial-distribution (date checked: 2026-10-29).
- SciPy documentation,
scipy.stats.binom: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.binom.html (date checked: 2026-10-29). - R documentation, “The Binomial Distribution”: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Binomial.html (date checked: 2026-10-29).








