Course contentsShow
← Mathematics
Lesson 2873 of 3,12157. Common DistributionsFree lesson

Bernoulli Distribution: PMF, Expectation, and Variance

Derive the probability mass function, mean, and variance of a Bernoulli random variable with parameter p.

Bernoulli Distribution: PMF, Expectation, and Variance

What you'll learn: You'll derive the exact formulas for the probability mass function, mean, and variance of a Bernoulli random variable.

The Core Idea

A Bernoulli random variable X with parameter p models a single success/failure trial. It takes value 1 (success) with probability p and value 0 (failure) with probability 1 - p. Now let's derive its key properties formally.

Probability Mass Function (PMF)

The PMF assigns probabilities to the only two possible outcomes:

  • P(X = 1) = p
  • P(X = 0) = 1 - p

We can write this compactly as: P(X = x) = p^x · (1 - p)^(1-x) for x ∈ {0, 1}

This clever formula works because when x = 1, we get p¹·(1-p)⁰ = p, and when x = 0, we get p⁰·(1-p)¹ = 1 - p.

Expectation (Mean)

Using the definition of expectation for discrete random variables:

E[X] = Σ x · P(X = x) = 0·(1 - p) + 1·p = p

The average outcome is simply the success probability—intuitive when you think about long-run frequencies.

Variance

Using the shortcut formula Var(X) = E[X²] - (E[X])²:

First, E[X²] = 0²·(1 - p) + 1²·p = p

Then: Var(X) = p - p² = p(1 - p) = pq (where q = 1 - p)

The variance is maximized when p = 0.5 (maximum uncertainty) and minimized at p = 0 or p = 1 (certainty).

Key Takeaway: For a Bernoulli(p) random variable: PMF is P(X = x) = p^x(1-p)^(1-x), E[X] = p, and Var(X) = p(1-p).