St · Statistics & Probability

What Is an Unbiased Estimator of a Bernoulli Distribution?

Updated 13 October 2026

At a glance

  1. 1. Model the observations

    Assume you observe independent 0-or-1 outcomes with the same unknown success probability.

  2. 2. Count successes

    Add the observed outcomes to get the number of successes.

  3. 3. Divide by sample size

    Use the success proportion as the estimate of the Bernoulli parameter.

  4. 4. Check its expectation

    The expected value of this proportion equals the true success probability.

If you observe repeated yes/no outcomes and want to estimate the probability of “yes,” use the proportion of yes outcomes. Under the usual assumption that the observations are independent and have the same Bernoulli distribution, that proportion is an unbiased estimator of the unknown probability.

Bernoulli observations and unbiasedness

A Bernoulli random variable XX takes the value 11 with probability pp and 00 with probability 1−p1-p. Its expected value is

E[X]=1⋅p+0⋅(1−p)=p.\mathbb{E}[X] = 1\cdot p + 0\cdot(1-p) = p.

An estimator is a statistic calculated from data. It is unbiased for a parameter when its expected value, taken over repeated samples, equals that parameter. Thus, if XX is one Bernoulli observation, XX itself is already an unbiased estimator of pp. With multiple observations, averaging them usually gives a more informative estimate.

The sample proportion is unbiased

Suppose X1,…,XnX_1,\ldots,X_n are independent Bernoulli observations with the same unknown probability pp. Define the sample mean

p^=X‾=1n∑i=1nXi.\widehat{p} = \overline{X} = \frac{1}{n}\sum_{i=1}^{n} X_i.

By linearity of expectation, each observation has expected value pp, so

E[p^]=E[1n∑i=1nXi]=1n∑i=1nE[Xi]=1n∑i=1np=p.\begin{aligned} \mathbb{E}[\widehat{p}] &= \mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n}X_i\right] \\ &= \frac{1}{n}\sum_{i=1}^{n}\mathbb{E}[X_i] \\ &= \frac{1}{n}\sum_{i=1}^{n}p \\ &= p. \end{aligned}

Therefore, p^\widehat{p} is unbiased for pp. Independence is not needed for this expectation calculation; having the same probability pp for each observation is enough. Independence does matter for the usual variance calculation and other properties of the estimator.

If K=∑i=1nXiK=\sum_{i=1}^{n}X_i is the number of successes, the same estimator can be written as

p^=Kn.\widehat{p} = \frac{K}{n}.

For independent, identically distributed observations, KK has a binomial distribution with parameters nn and pp.

Worked example

Suppose you record eight outcomes, coding a success as 1 and a failure as 0, and observe five successes. Then n=8n=8 and K=5K=5, giving

p^=58=0.625.\widehat{p} = \frac{5}{8} = 0.625.

The estimate from this particular sample is 0.625. Unbiasedness does not mean that this estimate must equal the true probability in every sample. It means that if you repeatedly took samples of eight observations and calculated the proportion each time, the average of those proportions would be pp.

The estimator’s variance under the independent, identical Bernoulli model is

Var⁡(p^)=p(1−p)n.\operatorname{Var}(\widehat{p}) = \frac{p(1-p)}{n}.

This shows why increasing the sample size generally reduces the estimator’s variability. The variance depends on the unknown pp, but its maximum possible value is 1/(4n)1/(4n), attained at p=1/2p=1/2.

If you mean the whole distribution

A Bernoulli distribution is fully specified by its probability of 1; the probability of 0 is then 1−p1-p. Estimating pp therefore estimates the whole distribution. In terms of observed data, the empirical estimates are

P^(X=1)=Kn,P^(X=0)=1−Kn.\widehat{P}(X=1)=\frac{K}{n}, \qquad \widehat{P}(X=0)=1-\frac{K}{n}.

Both are unbiased for the corresponding probabilities: the first has expectation pp, and the second has expectation 1−p1-p. This is also an example of the empirical distribution assigning each possible outcome its observed sample frequency.

Common mistakes

  • Using the number of successes as the estimate: KK has expectation npnp, not pp. Use K/nK/n to estimate pp when the sample size is known. The exception is a single observation, where n=1n=1 and K=X1K=X_1.
  • Confusing unbiasedness with certainty: An unbiased estimator can be above or below the true value in a particular sample. The property concerns its average over repeated samples.
  • Treating unbiasedness as a guarantee of precision: An estimator may be unbiased but variable. The sample size affects the variance, so unbiasedness alone does not tell you how close one estimate is likely to be to pp.
  • Ignoring the outcome coding: The sample mean estimates the probability of whichever outcome is coded as 1. If you reverse the coding, it estimates the probability of the other outcome.

For independent Bernoulli data, use the sample proportion of successes to estimate the success probability. It is unbiased because its expected value is the true probability.

References

  1. Statistical Inference, George Casella and Roger L. Berger
  2. Mathematical Statistics and Data Analysis, John A. Rice

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.