Skip to content

Bernoulli Distribution

Definition

Let 0≤p≤10\le p\le1. A random variable XX has a Bernoulli distribution with parameter pp, written X∼Bern⁡(p)X\sim\operatorname{Bern}(p), if

P(X=1)=p,P(X=0)=1−p.\mathbb{P}(X=1)=p,\qquad \mathbb{P}(X=0)=1-p.

We write q=1−pq=1-p. The endpoints p=0p=0 and p=1p=1 give degenerate distributions: XX is then constant, always 00 or always 11.


Interpretation

A Bernoulli variable models a single trial with two possible results, success coded as 11 and failure as 00. The one number p=P(X=1)p=\mathbb{P}(X=1) determines the whole distribution.

Two probability bars for a Bernoulli(0.3) variable: 0.7 at the value 0 and 0.3 at the value 1.

The figure shows X∼Bern⁡(0.3)X\sim\operatorname{Bern}(0.3): a bar of height 0.70.7 at the value 00 and a bar of height 0.30.3 at the value 11; the two bars add up to 11. The formulas in the box are the Key Results of this page.

Move pp: the two bars always add up to 11, and the mean EX=p\mathbb{E}X=p sits between them. At p=0p=0 or p=1p=1 the distribution is degenerate.

Coding success as 11 makes XX the indicator of the event {X=1}\{X=1\}; conversely, the indicator of any event with probability pp is Bern⁡(p)\operatorname{Bern}(p). The label "success" is arbitrary: 1−X1-X is again Bernoulli, with parameter 1−p1-p. The coding pays off when trials are repeated: for independent trials X1,…,XnX_1,\ldots,X_n, all Bern⁡(p)\operatorname{Bern}(p), the sum X1+⋯+XnX_1+\cdots+X_n counts the successes and has the binomial distribution.


Key Results

  • EX=p\mathbb{E}X=p and Var⁡(X)=p(1−p)\operatorname{Var}(X)=p(1-p).
  • MGF MX(t)=1−p+petM_X(t)=1-p+p\mathrm{e}^t for every real tt.

Examples

  • A fair coin indicator has mean 1/21/2 and variance 1/41/4.
  • A defect indicator with p=0.02p=0.02 has P(X=0)=0.98\mathbb{P}(X=0)=0.98 and variance 0.01960.0196.

Further Properties

An indicator of an event with probability pp has this distribution; sums of independent Bernoulli variables with the same success probability pp produce binomial counts.

Prerequisites

Sources

Aliases: Bern(p), Bernoulli random variable, Bernoulli variable, Bernoulli r.v. Keywords: success indicator

Last updated: 20 October 2026 03:02