the indicator random variable
An indicator random variable is the simplest possible random variable: it just reports whether an event happened. It equals 1 if the event occurs and 0 if it does not, turning a yes/no question into a number. For an event A we write the indicator as 1_A: it is 1 on every outcome inside A and 0 on every outcome outside A. A coin landing heads, a customer making a purchase, a die showing a six, each becomes a crisp 0 or 1.
Because it takes only the values 0 and 1, an indicator has a very tidy distribution: P(1_A = 1) = P(A) and P(1_A = 0) = 1 - P(A). This is exactly a Bernoulli variable with success probability p = P(A). The single most useful fact about it is that its expectation equals the probability of the event: E[1_A] = 1 times P(A) plus 0 times (1 - P(A)) = P(A). The average value of the on-off switch is just how often it is on.
This little variable is a workhorse far out of proportion to its simplicity. To count how many of several events occur, add up their indicators: the total count is a sum of 0-1 variables, and by linearity of expectation its expected value is simply the sum of the individual probabilities, no independence required. That trick (write a count as a sum of indicators) cracks problems that look hard head-on, such as the expected number of matches, fixed points, or empty boxes. Indicators are the bridge that lets you compute with events using the algebra of numbers.
Roll a die three times; let A_i be the event that roll i is a six, with indicator 1_{A_i}. The number of sixes is X = 1_{A_1} + 1_{A_2} + 1_{A_3}. So E[X] = E[1_{A_1}] + E[1_{A_2}] + E[1_{A_3}] = 1/6 + 1/6 + 1/6 = 1/2, instantly.
An indicator turns an event into a 0-1 number whose expectation is the event's probability.
The defining identity is E[1_A] = P(A): the expectation of an indicator is the probability of its event. Combined with linearity of expectation, this lets you find expected counts even when the events are dependent.