Indicator Random Variables
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 A, define
Because IA takes the value 1 with probability p=P(A) and 0 otherwise, it is a Bernoulli(p) random variable. Two facts make indicators so useful:
Variance of a Bernoulli indicator as a function of its success probability
- E[IA]=1⋅p+0⋅(1−p)=P(A) - the expectation of an indicator is simply the probability of the event.
- Since IA2=IA (0 and 1 are unchanged by squaring), E[IA2]=E[IA]=p, so Var(IA)=p−p2=p(1−p).
That variance formula is a downward parabola in p: it is zero at both ends, where the outcome is certain, and largest in the middle, where the outcome is least predictable. Differentiating p−p2 gives 1−2p, which vanishes at p=0.5, where the variance reaches 0.25.
For two events A and B, the covariance of their indicators is
The first step uses the fact that the product IAIB is itself the indicator of A∩B, so its expectation is P(A∩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.
Worked example
A fair die is rolled once. Let I indicate that the outcome is a 6. Then P(I=1)=61, so E[I]=61 and Var(I)=61⋅65=365≈0.139.
Now let J indicate that the same roll is even. The product IJ indicates 'a 6', which has probability 61, while E[I]E[J]=61⋅21=121. So Cov(I,J)=61−121=121≈0.083, a positive value, which is what we should expect because rolling a 6 guarantees the roll is even.
A biased coin lands heads with probability 0.3. Let I be the indicator that a single flip is heads. Compute Var(I).
Give your answer as a number.
The chart plots Var(IA)=p(1−p) against p∈[0,1], where p=P(A). For which value of p 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.
Variance of a Bernoulli indicator as a function of its success probability