Counting Events With Indicators
A count of events is a random variable, but its value can often be easier to study after it is written as a sum. The key device is the indicator of an event: it equals one when the event occurs and zero otherwise. This representation turns questions about a count into finite sums of probabilities, including probabilities of joint occurrence. It also makes clear why the count’s variance depends on whether the events tend to occur together.
The expectation identity follows directly from the two possible values of the indicator: \(E[\mathbf{1}_A]=1\cdot P(A)+0\cdot P(A^c)=P(A)\). The power identity holds because both zero and one are unchanged by any positive integer power. In particular, the first moment of an event count is the sum of the event probabilities, whether or not the events are independent.
For higher moments, expand the sum before taking expectations. The resulting terms correspond to joint occurrences of events. This simple expansion is useful because it makes no independence assumption.
Proof. Since \(S=\sum_{i=1}^n\mathbf{1}_{A_i}\), multiplying out its \(r\)th power gives a sum indexed by all ordered \(r\)-tuples:
A product of indicators is one precisely when all the indicated events occur, and is zero otherwise. Thus that product is the indicator of their intersection, even when some indices repeat. Taking expectations of the finite sum and using \(E[\mathbf{1}_B]=P(B)\) for each intersection \(B\) proves the identity. \(\square\)
First and Second Moments of an Event Count
For \(r=2\), the expansion separates into terms with the same index and terms with different indices. Because \(\mathbf{1}_{A_i}^2=\mathbf{1}_{A_i}\), the diagonal terms contribute the individual event probabilities. The other terms contribute pairwise joint probabilities:
Subtracting \(E[S]^2\) gives the variance formula below. Equivalently, the variance is the sum of the individual indicator variances and twice the sum of their pairwise covariances. Here \(p_i=P(A_i)\); no assumption of independence is made.
Proof. By the second-moment expansion and the identity \(E[S]=\sum_i p_i\),
The final bracket is \(\operatorname{Cov}(\mathbf{1}_{A_i},\mathbf{1}_{A_j})\), as follows by taking the expectation of the product of the indicators and subtracting the product of their expectations. This proves the stated formula. \(\square\)
Worked Example: A Count With Dependent Events
Let the sample space be \(\{1,2,3,4\}\), with each outcome having probability \(1/4\). Define \(A_1=\{1,2\}\), \(A_2=\{2,3\}\), and \(A_3=\{2,4\}\). Find the first two raw moments and the variance of the event count \(S\).
Each event has probability \(1/2\), so \(E[S]=1/2+1/2+1/2=3/2\). Each pair of events intersects only at outcome 2, so every pairwise intersection has probability \(1/4\). Therefore,
It follows that \(\operatorname{Var}(S)=E[S^2]-(E[S])^2=3-9/4=3/4\). Directly checking the count gives \(S=1,3,1,1\) at outcomes \(1,2,3,4\), respectively. Thus the same results are \(E[S]=(1+3+1+1)/4=3/2\) and \(E[S^2]=(1+9+1+1)/4=3\). The event indicators are dependent: their joint probabilities, not just their marginal probabilities, enter the second moment.
Independent Bernoulli Indicators
A Bernoulli random variable takes the value one with some probability \(p\) and zero with probability \(1-p\). If \(I_1,\ldots,I_n\) are independent Bernoulli variables with the same success probability \(p\), their sum \(S=\sum_i I_i\) counts successes in \(n\) trials. Independence makes each pairwise covariance zero, so \(E[S]=np\) and \(\operatorname{Var}(S)=np(1-p)\). The second raw moment follows by adding the squared mean to the variance.
Worked Example: Raw and Factorial Moments of a Binomial Count
Suppose four independent trials each succeed with probability \(1/3\), and let \(S\) be the number of successes. Then \(S\) is binomial with parameters \(4\) and \(1/3\). Its mean and variance are
The second raw moment is \(E[S^2]=\operatorname{Var}(S)+(E[S])^2=8/9+16/9=8/3\). It can also be checked directly from the event-count expansion: the four diagonal terms sum to \(4/3\), and the six distinct pairs contribute \(2\cdot6\cdot(1/3)^2=4/3\), for a total of \(8/3\).
The second factorial moment uses the falling-factorial power \(S(S-1)\), rather than \(S^2\). It counts ordered pairs of distinct successful trials. There are \(4\cdot3\) such ordered pairs, each with probability \(1/9\), so \(E[S(S-1)]=12/9=4/3\). This differs from the second raw moment \(8/3\).
Raw Moments From Tail Probabilities
Indicator sums also give a useful representation for a nonnegative integer-valued random variable \(X\). For each positive integer \(k\), the indicator \(\mathbf{1}_{\{X\ge k\}}\) records whether \(X\) reaches at least \(k\). If \(X=m\), exactly \(m\) of these indicators equal one. Consequently, \(X=\sum_{k=1}^{\infty}\mathbf{1}_{\{X\ge k\}}\), with only finitely many nonzero terms for each finite value of \(X\).
Proof. For every nonnegative integer \(m\), telescoping gives \[ m^r=\sum_{k=1}^{m}\bigl(k^r-(k-1)^r\bigr). \] Substitute \(m=X\). Each summand is nonnegative, since \(k^r-(k-1)^r\ge0\), so the monotone convergence theorem allows expectation to pass through the increasing sequence of finite partial sums, including when the expectation is infinite. Finally, \(E[\mathbf{1}_{\{X\ge k\}}]=P(X\ge k)\). Therefore
This proves the identity. \(\square\)
Worked Example: Tail Sums and Two Second-Order Moments
Let \(X\) assign probability \(1/4\) to each of \(0,1,2,4\). Its second raw moment from the distribution is
The tail probabilities are \(P(X\ge1)=3/4\), \(P(X\ge2)=1/2\), \(P(X\ge3)=1/4\), and \(P(X\ge4)=1/4\); later tails are zero. For \(r=2\), the increments \(k^2-(k-1)^2\) are \(1,3,5,7\) at \(k=1,2,3,4\). Hence the tail formula gives
For comparison, the second factorial moment is \(E[X(X-1)]\). Direct calculation gives \([0+0+2+12]/4=7/2\), not \(21/4\). The distinction is also visible from the pointwise identity \(X^2=X(X-1)+X\): here \(E[X]=7/4\), and \(7/2+7/4=21/4\).
Factorial Moments and a Common Pitfall
For a nonnegative integer-valued \(X\), its \(r\)th factorial moment is the expectation of the falling-factorial power \(X^{\underline r}=X(X-1)\cdots(X-r+1)\), for a positive integer \(r\), whenever that expectation is finite. By convention, \(X^{\underline 0}=1\). Unlike \(X^r\), the falling-factorial power is zero when \(X\) is a nonnegative integer less than \(r\). For example, \(X^{\underline 2}=X(X-1)\) counts ordered pairs of distinct items when \(X\) is a count.
A common mistake is to treat the \(r\)th raw moment and the \(r\)th factorial moment as interchangeable. They are not: for instance, \(X^2=X(X-1)+X\), so their expectations differ by \(E[X]\) when the moments are finite. Another error is to calculate the variance of a sum of indicators using only the individual event probabilities. That suffices for the mean, but the variance also depends on the pairwise joint probabilities unless independence is established.
Check Your Understanding
Use indicator expansions and the definitions of raw and factorial moments to answer these questions.
- For \(S=\mathbf{1}_{A_1}+\mathbf{1}_{A_2}\), write \(E[S^2]\) in terms of \(P(A_1)\), \(P(A_2)\), and \(P(A_1\cap A_2)\).
- Why does \(E[S]=\sum_iP(A_i)\) hold without independence, while the variance can depend on joint event probabilities?
- If \(X\) takes values in \(\{0,1,2,\ldots\}\), what indicator sum equals \(X\)?
- For an integer-valued count \(S\), explain what \(S(S-1)\) counts and how it differs from \(S^2\).
- Two independent Bernoulli trials each have success probability \(1/2\). Find the mean and variance of their total number of successes.