Indicator Random Variables: Turning Events into Numbers

An indicator random variable (also called a Bernoulli indicator) converts a yes/no event into a number so we can apply expectation and variance tools to it. For any event AA, define


IA={1if A occurs0if A does not occurI_A = \begin{cases} 1 & \text{if } A \text{ occurs} \\ 0 & \text{if } A \text{ does not occur} \end{cases}


Because IAI_A takes the value 1 with probability p=P(A)p = P(A) and 0 otherwise, it is a Bernoulli(p)(p) random variable. Two facts make indicators so useful:

Variance of a Bernoulli indicator as a function of its success probability

Variance of a Bernoulli indicator as a function of its success probability


  • E[IA]=1⋅p+0⋅(1−p)=P(A)E[I_A] = 1\cdot p + 0\cdot(1-p) = P(A) - the expectation of an indicator is simply the probability of the event.
  • Since IA2=IAI_A^2 = I_A (0 and 1 are unchanged by squaring), E[IA2]=E[IA]=pE[I_A^2] = E[I_A] = p, so Var(IA)=p−p2=p(1−p)\text{Var}(I_A) = p - p^2 = p(1-p).


That variance formula is a downward parabola in pp: it is zero at both ends, where the outcome is certain, and largest in the middle, where the outcome is least predictable. Differentiating p−p2p - p^2 gives 1−2p1 - 2p, which vanishes at p=0.5p = 0.5, where the variance reaches 0.250.25.


For two events AA and BB, the covariance of their indicators is


Cov(IA,IB)=E[IAIB]−E[IA]E[IB]=P(A∩B)−P(A)P(B)\text{Cov}(I_A, I_B) = E[I_A I_B] - E[I_A]E[I_B] = P(A \cap B) - P(A)P(B)


The first step uses the fact that the product IAIBI_A I_B is itself the indicator of A∩BA \cap B, so its expectation is P(A∩B)P(A \cap B). The covariance is positive when the events tend to occur together, negative when one occurring makes the other less likely, and zero when they are independent.

A sample space S of 12 equally likely outcomes partitioned by events A and B; each number is the count of outcomes in that region.

A sample space S of 12 equally likely outcomes partitioned by events A and B; each number is the count of outcomes in that region.

Worked example

A fair die is rolled once. Let II indicate that the outcome is a 6. Then P(I=1)=16P(I=1) = \tfrac{1}{6}, so E[I]=16E[I] = \tfrac16 and Var(I)=16⋅56=536≈0.139\text{Var}(I) = \tfrac16 \cdot \tfrac56 = \tfrac{5}{36} \approx 0.139.


Now let JJ indicate that the same roll is even. The product IJIJ indicates 'a 6', which has probability 16\tfrac16, while E[I]E[J]=16⋅12=112E[I]E[J] = \tfrac16 \cdot \tfrac12 = \tfrac1{12}. So Cov(I,J)=16−112=112≈0.083\text{Cov}(I,J) = \tfrac16 - \tfrac1{12} = \tfrac1{12} \approx 0.083, a positive value, which is what we should expect because rolling a 6 guarantees the roll is even.



In the figure, each number gives how many of the 12 equally likely outcomes lie in that region. Let IAI_A be the indicator that the outcome falls in event A. What is E[IA]E[I_A]?

A sample space S of 12 equally likely outcomes partitioned by events A and B; each number is the count of outcomes in that region.

A sample space S of 12 equally likely outcomes partitioned by events A and B; each number is the count of outcomes in that region.

Variance of a Bernoulli indicator as a function of its success probability

Variance of a Bernoulli indicator as a function of its success probability

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A biased coin lands heads with probability 0.30.3. Let II be the indicator that a single flip is heads. Compute Var(I)\text{Var}(I).

Give your answer as a number.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The chart plots Var(IA)=p(1−p)\text{Var}(I_A)=p(1-p) against p∈[0,1]p\in[0,1], where p=P(A)p=P(A). For which value of pp is the variance of the indicator largest?

A sample space S of 12 equally likely outcomes partitioned by events A and B; each number is the count of outcomes in that region.

A sample space S of 12 equally likely outcomes partitioned by events A and B; each number is the count of outcomes in that region.

Variance of a Bernoulli indicator as a function of its success probability

Variance of a Bernoulli indicator as a function of its success probability

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors