Tutorials › VEE Mathematical Statistics › Counting Expected Outcomes with Indicators

VEE Mathematical Statistics · Expectation and Variability · Tutorial 65 of 880

Counting Expected Outcomes with Indicators

Learn to turn counts into sums of indicators and find their expected values by adding event probabilities, even when the events are dependent.

Beginner 9 min read

What You'll Learn

  • Define the indicator of an event and connect its expectation to the event’s probability.
  • Represent a count of outcomes as a sum of indicator random variables.
  • Use linearity of expectation to find a count’s mean without assuming independence.
  • Apply the method to random matchings, claim counts, and randomly occupied locations.
  • Recognize why an expected count is not generally the probability of at least one outcome.

Why Indicators Make Counts Easier

Many probability questions ask for the expected number of times something happens: the number of correct assignments, the number of claims, or the number of occupied locations. Directly finding the full probability distribution of that count can be difficult. A simpler approach is to describe each individual occurrence with a zero-or-one random variable, then add those variables.

The key advantage is that expectation is additive. The events being counted do not have to be independent. Independence may be useful when calculating an event’s probability, but it is not required to add the probabilities and obtain the expected count.

Definition: For an event \(A\), its indicator random variable is \(I_A\), defined by \(I_A=1\) if \(A\) occurs and \(I_A=0\) if \(A\) does not occur. If \(A_1,\ldots,A_n\) are events and \(N\) counts how many occur, then $$ N=\sum_{j=1}^{n} I_{A_j}. $$ Consequently, by linearity of expectation, $$ E[N]=\sum_{j=1}^{n}P(A_j). $$

This formula applies to any finite collection of events. The events may be mutually exclusive, overlapping, independent, or dependent. To use it, identify exactly what is being counted, write one event for each possible occurrence, and find each event’s probability under the stated model.

Why the Indicator Formula Holds

An indicator records one occurrence: it contributes one to the count when its event happens and zero otherwise. Its expectation is therefore the probability of that event.

$$ E[I_A] =0\cdot P(A^c)+1\cdot P(A) =P(A). $$

For every possible outcome, the sum \(I_{A_1}+\cdots+I_{A_n}\) equals the number of the events that occur. Taking expectations of that equality and using linearity gives the desired result:

$$ E[N] =E\left[\sum_{j=1}^{n}I_{A_j}\right] =\sum_{j=1}^{n}E[I_{A_j}] =\sum_{j=1}^{n}P(A_j). $$

The middle equality is the important step: linearity of expectation applies whether or not the indicators are independent. The count’s full distribution might depend on the relationships between the events, but its expectation is determined by their individual probabilities.

Worked Examples

Worked Example: Correct Positions in a Random Assignment

Eight distinct reports are placed in eight distinct slots, one report per slot. Every one of the \(8!\) possible assignments is equally likely. What is the expected number of reports that land in their individually designated slots?

Model and assumptions. The assignment is a uniformly random permutation of the eight reports. No interest rate or mortality assumption applies. The events of correct placement are dependent because the assignment is made without replacement.

Method. For \(j=1,\ldots,8\), let \(A_j\) be the event that report \(j\) lands in its designated slot. Let \(I_{A_j}\) indicate that event, and let \(N\) be the number of correctly placed reports. Then \(N=\sum_{j=1}^{8}I_{A_j}\).

For any particular report, eight slots are equally likely, and exactly one is its designated slot. Thus \(P(A_j)=1/8\) for each \(j\). Add these probabilities:

$$ E[N]=\sum_{j=1}^{8}P(A_j) =8\left(\frac18\right)=1. $$

Check. The expected number is one report. This is a mean, not a claim that every assignment has exactly one correct placement; an assignment can have zero, one, or several.

Common mistake avoided. It is incorrect to set \(E[N]=P(N\geq 1)\), as though the count could only be zero or one. For example, the probability of at least one correct placement here is \(25487/40320\), approximately \(0.6321\), not \(1\). The expected count is the sum of the eight individual match probabilities, which is \(1\).

Worked Example: Expected Claim Count with Dependence Allowed

A hypothetical portfolio contains five policies. For policy \(j\), the probability of at least one reported claim during a specified month is given below. Let \(N\) be the number of policies with at least one reported claim. Find \(E[N]\), and find the expected number among policies 1, 2, and 5.

PolicyProbability of at least one reported claim
10.08
20.12
30.20
40.15
50.25

Model and assumptions. Each policy’s claim event has the stated marginal probability. The joint distribution of the five events is unspecified, so no independence assumption is made. No interest rate or mortality assumption applies.

Let \(A_j\) be the event that policy \(j\) has at least one reported claim, and define \(I_{A_j}\) accordingly. The total count is \(N=I_{A_1}+I_{A_2}+I_{A_3}+I_{A_4}+I_{A_5}\). Therefore,

$$ E[N] =0.08+0.12+0.20+0.15+0.25 =0.80. $$

For the requested subset, use only the indicators for policies 1, 2, and 5:

$$ E[I_{A_1}+I_{A_2}+I_{A_5}] =0.08+0.12+0.25 =0.45. $$

Check. Both expectations are in numbers of policies: \(0.80\) in the full portfolio and \(0.45\) in the specified subset. These need not be whole numbers because an expectation is an average over repeated months, not a count observed in one month.

Common mistake avoided. Multiplying the probabilities as if the events had to be independent is unnecessary and would not calculate the expected count. Linearity uses each policy’s marginal probability alone.

Worked Example: Expected Number of Occupied Cages

Six parcels are assigned one at a time to four pickup cages. Each parcel independently goes to each cage with probability \(1/4\). What is the expected number of cages that receive at least one parcel?

Model and assumptions. Each of the six assignments is an independent, uniform choice from four cages. This specifies the distribution of the assignments; the events that different cages are occupied are not independent. No interest rate or mortality assumption applies.

For cage \(j\), let \(A_j\) be the event that it receives at least one parcel. Let \(I_{A_j}\) equal one if it is occupied and zero otherwise. If \(N\) is the number of occupied cages, then \(N=\sum_{j=1}^{4}I_{A_j}\).

It is easiest to find the probability that a particular cage is occupied by first calculating the probability it is empty. For any one parcel, the probability of avoiding that cage is \(3/4\). By independence of the six assignments, the probability that all six avoid it is

$$ P(A_j^c)=\left(\frac34\right)^6 =\frac{729}{4096}. $$

Thus the probability that the cage is occupied is

$$ P(A_j)=1-\frac{729}{4096} =\frac{3367}{4096}. $$

All four cages have the same probability of being occupied. Adding their indicator expectations gives

$$ E[N]=4\left(\frac{3367}{4096}\right) =\frac{3367}{1024} =3.2881. $$

The final value is rounded to four decimal places. It lies between three and four, which is plausible: there are six parcels and four cages, so at least one cage must be occupied, but some assignments leave cages empty.

Common mistake avoided. Do not treat the four occupancy indicators as independent. Their dependence does not affect the sum of their expectations. Independence was used only for the six parcel assignments when calculating the probability that one specified cage is empty.

A Reliable Method for Count Questions

A count can often be solved without finding its probability mass function. The following process keeps the event definition and the probability calculation separate.

1
Define the count precisely.
State what qualifies as one occurrence and what is being counted. For example, a policy counts once if it has at least one claim, even if it has multiple claims.
2
Make one event per possible occurrence.
Write \(A_j\) for the event that the \(j\)th item, trial, person, or location satisfies the condition.
3
Represent the count.
Write \(N=\sum_j I_{A_j}\). Check that each qualifying occurrence contributes exactly one and each non-occurrence contributes zero.
4
Find the event probabilities and add.
Use the stated probability model to calculate each \(P(A_j)\), then use \(E[N]=\sum_jP(A_j)\). Do not impose independence unless the problem’s model states it or it is needed to calculate a particular probability.

The event probabilities do not have to be equal. If there are \(n\) opportunities and each event has probability \(p\), then \(E[N]=np\); if the probabilities differ, add them individually. In either case, this gives the expected count, not necessarily the probability that at least one event occurs.

Common Traps and Interpretation

  • Confusing an expected count with an event probability. \(E[N]\) can exceed one, while a probability cannot. Even when \(E[N]\) is less than one, it is not generally \(P(N\geq1)\).
  • Assuming independence is needed. It is not needed for \(E[N]=\sum_jP(A_j)\). Dependence matters if you need the joint distribution or probabilities involving several events together.
  • Counting the wrong event. “At least one claim per policy” and “number of claims” are different counts. Define the event for each indicator to match the question’s wording.
  • Adding probabilities for overlapping events without identifying what is counted. The indicator sum counts each event that occurs, including multiple overlapping events. It is not automatically the probability of their union.
Key takeaway: For a finite count, define one indicator for each possible occurrence. The count is their sum, each indicator’s expectation is its event probability, and linearity gives the expected count by adding those probabilities—even when the events are dependent.

Check Your Understanding

For each problem, define the relevant events and add their probabilities. Independence is needed only where the problem’s probability calculation requires it.

  1. Nine distinct cards are shuffled uniformly among nine labeled positions. Each card has one designated position. Find the expected number of cards in their designated positions. (Answer: \(1\))
  2. A box contains 10 distinct tokens, of which 4 are marked. Three tokens are drawn uniformly without replacement. Find the expected number of marked tokens drawn. (Answer: \(1.2\))
  3. Five devices activate during a test with respective probabilities \(0.10, 0.20, 0.30, 0.40,\) and \(0.50\). No assumptions about dependence are given. Find the expected number that activate. (Answer: \(1.5\))
  4. Four balls are placed independently and uniformly into three bins. Find the expected number of bins that receive at least one ball, to four decimal places. (Answer: \(65/27 \approx 2.4074\))
  5. Six distinct files are assigned uniformly at random to six distinct folders, one per folder. Two files have individually designated folders. Find the expected number of those two files that land in their designated folders. (Answer: \(1/3\))
Clinical Biostats