Five positions on a manufactured part are inspected, and a single fault in the machine can spoil several positions at once. How many defects should you expect per part? The full distribution of the count would need the joint behavior of all five positions. Indicators avoid that work. Each yes-or-no question becomes a variable equal to or , the count becomes a sum of these variables, and linearity turns its expectation into a sum of probabilities, with no independence assumption.
Key terms
Indicator random variable
Definition Let be an event in a probability model with sample space . The indicator of is the random variable defined on each outcome by
It takes only the values and , and event operations become arithmetic. The complement has indicator , for a second event the intersection has indicator , and because and . The notation is also common.
In plain words An indicator records whether the event happened on this particular run of the experiment, with for yes and for no. It is a random variable, not a probability. The probability of is one fixed number, while the value of depends on the outcome.
Example A label is drawn at random from a box in which two fifths of the labels are blue, and is the event that the drawn label is blue. Then with probability and with probability . If is the event that the label is large, the product equals exactly when the drawn label is both blue and large, so it is the indicator of .
Expectation of an indicator
Definition For every event ,
The indicator takes the value with probability and the value with probability , so its expectation is . Since , this expectation is always finite.
In plain words The indicator puts weight on the value and the rest on , so its weighted average is exactly . The probability of any event is the expectation of a random variable, its indicator, and that is what lets the rules for expectations work on probabilities.
Example For the blue label, . Ten repeated draws with replacement need not produce exactly four blue labels. The value belongs to the model, and it is not a promised frequency in a finite run.
Sum of indicators
Definition Let be events in one probability model, and let be the number of them that occur. Then
on every outcome, because each event that occurs contributes to the sum and each event that does not occur contributes . The identity is exact, holds before any averaging and needs no assumption about how the events are related.
In plain words To count, give each thing that might be counted its own zero-one switch and add the switches. The definition of each indicator decides what is counted, so state its yes-or-no question first and check that the sum matches the intended count on every outcome.
Example Let be the event that position of the inspected part is defective, for . If positions and are defective and the others are sound, then , the other three indicators are , and the sum is , the number of defective positions. If every position is sound, all five indicators are and so is the count.
Expected count
Definition If counts how many of the events occur, then linearity and the expectation of an indicator give
The events may be dependent. Each indicator is bounded, so each term has finite expectation and linearity applies. The formula uses only the individual probabilities and gives the mean of the count, not its distribution.
In plain words The expected number of events that happen is the sum of their probabilities. Whether the events tend to happen together can change how the count is spread out, but not its mean. An expected count need not be a possible value of the count.
Example Suppose the five positions have defect probabilities , , , and . The expected number of defects is , even if a shared fault makes defects occur together. For a second case, draw three tokens at random without replacement from a bag of ten, four of them blue, and let be the event that draw is blue. Each draw position is equally likely to hold any of the ten tokens, so for each , and the expected number of blue tokens is . The draws are dependent, and the law of total probability confirms the value for the second draw,
Indicator of a union
Definition For events and in one probability model,
on every outcome. Taking expectations gives the addition rule
The plain sum counts how many of the two events occur. It equals on , so it is the indicator of the union on every outcome exactly when . In the same way, if counts how many of occur, then the indicator that at least one occurs is never larger than , so , with equality exactly when .
In plain words Adding two indicators counts an outcome in both events twice, and subtracting the indicator of the overlap brings it back to one. That outcome-by-outcome correction is where the overlap term of the addition rule comes from. A sum of probabilities is an expected count, and it can exceed the probability that at least one of the events occurs.
Example Roll a fair die. Let be the event of an even result and the event of a result of at least . On the outcome the sum is , while is . The expected number of these two events that occur is , but
which matches the four favorable faces , , and .
Expected number of distinct categories
Definition Suppose each of draws falls into one of the categories . For each category , let be the indicator that appears at least once among the draws. The number of distinct categories seen is , so
where each term is minus the probability that category never appears. If the draws are independent and each draw falls into each category with probability , a given category is missed by all draws with probability , and
The indicators are usually dependent. In the equal-probability model with and , for instance, each of them equals with positive probability, yet they cannot all equal at once, because every draw falls into some category. Linearity does not need their independence, and independence of the draws is used only to find each probability .
In plain words To count distinct kinds rather than items, give each kind its own indicator for being seen at least once. A category that appears twice still contributes . The chance that a category appears usually comes most easily from the complement, the chance that every draw misses it.
Example Two stickers are drawn independently, each in one of four equally likely colors. A given color is missed by both with probability , so it appears with probability , and . A direct check agrees. The two colors match with probability , giving one distinct color, and differ with probability , giving two, so .
Check yourself
- A bag holds five tokens, two blue and three white, and two are drawn at random without replacement. Find the expected number of blue tokens drawn and the probability that at least one blue token is drawn. Why are the two answers different?
Show the answer
Let and be the events that the first and the second draw are blue. Each has probability , so the expected number of blue tokens is . Both draws are white with probability , so at least one blue token is drawn with probability .
The count can equal , which happens with probability . Such an outcome adds to the count but only to the indicator of at least one blue, and indeed . An expected count equals the probability of at least one occurrence only when the count is or with probability one.
- The cards numbered to , with , are shuffled so that all orders are equally likely. A match is a card that lands in the position carrying its own number. Find the expected number of matches.
Show the answer
Let be the indicator of the event that card lands in position . Card is equally likely to be in any of the positions, so . The number of matches is , so its expectation is for every . For the indicators are dependent. If the first cards are all matches, the last card must be a match too. Linearity does not need independence, so this dependence leaves the answer unchanged.
- A fair die is rolled three times. Find the expected number of distinct faces that appear, and check the answer by finding the distribution of that number.
Show the answer
Let be the number of distinct faces, written as the sum of six indicators, one for each face being seen at least once. A given face is missed by all three independent rolls with probability , so it appears with probability . Adding over the six faces gives
about . For the check, all three rolls agree with probability , and all three differ with probability . Exactly two distinct faces appear with the remaining probability . Then , as before.