Why Indicator Sums Help Under Conditioning
Many probability questions ask for an expected number: how many items are flagged, how many applications are approved, or how many opportunities produce a success. The count may be difficult to model directly, especially when outcomes are dependent or the number of opportunities varies. A useful approach is to represent the count as a sum of indicators and then condition on the information given in the problem.
The key advantage is that expected values add even when the indicators are dependent. Once a category or trial history is specified, the expected count is found by adding the relevant conditional probabilities. The challenge is identifying the right conditioning information and using probabilities conditional on that information—not probabilities from a different population or situation.
Conditional Linearity for Counts
Suppose \(I_j\) indicates whether the \(j\)th item is flagged, and \(B\) is an event such as “the shipment came from Route A” or “the first inspection failed.” The count of flagged items is \(C=I_1+\cdots+I_m\). Conditional linearity gives \(E[C\mid B]=E[I_1\mid B]+\cdots+E[I_m\mid B]\). Each term is the conditional probability that the corresponding item is flagged.
This result is particularly useful because conditioning can make the indicators dependent. For instance, learning that at least one of two tests was positive changes the conditional probabilities of both tests. The sum formula remains valid; what must change are the probabilities used in the sum.
Worked Example: Expected Flags Given a Shipment Category
A hypothetical inspection system processes four parcels from a shipment known to be in category \(G\). The conditional probabilities that parcels 1 through 4 are flagged are, respectively, \(0.18\), \(0.32\), \(0.27\), and \(0.13\). The flag outcomes may be dependent. Find the expected number of flagged parcels given category \(G\).
Method. Let \(I_j\) equal 1 when parcel \(j\) is flagged and 0 otherwise. The total number flagged is \(C=I_1+I_2+I_3+I_4\). Use the conditional probabilities given \(G\):
The expected number flagged is \(0.90\) parcels given category \(G\). This value need not be an integer: it is a long-run average across shipments in that category. The sum uses each parcel’s probability conditional on \(G\), and it remains valid even if flags are dependent. As a check, each term is between 0 and 1, so the expected count is between 0 and 4; \(0.90\) satisfies that bound.
Common mistake avoided: One might incorrectly require the flag outcomes to be independent before adding their probabilities. Independence is needed for some joint-probability calculations, but not for this expected count.
Conditioning on a Random Number of Opportunities
A different issue arises when the number of opportunities is itself random. Let \(N\) be the number of attempts, and let \(C\) be the number of successes. Given \(N=n\), the count can be written as a sum of \(n\) indicators. If each attempt has conditional success probability \(p_n\), then \(E[C\mid N=n,\ B]=np_n\), provided that \(p_n\) is the same for each of those \(n\) attempts. More generally, if the probabilities differ by attempt, add the \(n\) conditional probabilities.
To find the expected count given a category \(B\), average those conditional expected counts over the possible values of \(N\): \(E[C\mid B]=\sum_n E[C\mid N=n,B]P(N=n\mid B)\). This is the law of total expectation applied within the category. The success probability may depend on \(n\); in that case, the probability used for each value of \(n\) must be the one conditional on that value.
Worked Example: A Category With a Random Attempt Count
For a hypothetical machine in category \(R\), the number of tests \(N\) is 0, 2, or 3, with conditional probabilities \(0.20\), \(0.50\), and \(0.30\), respectively. Given \(R\) and \(N=n\), each test flags an item with probability \(0.20+0.10n\). Find the expected number of flags given \(R\). No independence between tests is specified or needed.
Step 1: Find the expected count at each possible attempt count. When \(N=0\), there are no tests, so the count is zero. When \(N=2\), each test has flag probability \(0.20+0.10(2)=0.40\), giving conditional expected count \(2(0.40)=0.80\). When \(N=3\), each has probability \(0.20+0.10(3)=0.50\), giving conditional expected count \(3(0.50)=1.50\).
Step 2: Average over the distribution of \(N\) given \(R\).
The expected number of flags is \(0.85\) given category \(R\). As a check, the probability of flagging per test is at most \(0.50\), and there are at most three tests, so the conditional expected count cannot exceed 1.50; \(0.85\) is within that bound.
Common mistake avoided: Do not average the success probabilities first and then multiply by an unrelated average number of tests. Here the success probability changes with \(N\). The safe calculation is to find \(E[C\mid R,N=n]\) at each \(n\), then weight by \(P(N=n\mid R)\).
Conditioning on a Trial History
A trial history is information about what has already happened—for example, that one test failed or that at least one component succeeded. The conditional expected count is still the sum of the conditional success probabilities for the individual indicators. Those probabilities may differ substantially from the original, unconditional probabilities.
A useful calculation occurs when the conditioning event \(H\) is “at least one of the indicators equals 1.” For every \(j\), the event \(\{I_j=1\}\) is contained in \(H\). Therefore, \(P(I_j=1\mid H)=P(I_j=1)/P(H)\). This shortcut requires \(P(H)>0\); it does not require independence. Independence may be useful for calculating \(P(H)\), but it is not part of conditional linearity itself.
Worked Example: Expected Successes Given at Least One Success
A hypothetical system runs three independent checks. Their success probabilities are \(0.50\), \(0.25\), and \(0.20\). Let \(C\) be the number of successful checks, and let \(H\) be the event that at least one check succeeds. Find \(E[C\mid H]\).
Step 1: Find \(P(H)\). By independence, the probability that all three checks fail is \(0.50(0.75)(0.80)=0.30\). Thus
Step 2: Find each success probability conditional on \(H\). Each individual success implies \(H\), so the joint probability of that success and \(H\) is just its success probability. Therefore,
Step 3: Add the conditional probabilities.
The expected number of successes given at least one success is \(1.3571\), rounded to four decimal places. As a check, the unconditional expected count is \(0.50+0.25+0.20=0.95\), while the conditional mean must be at least 1 because \(C\geq1\) whenever \(H\) occurs. The answer meets that condition and is below the maximum of 3.
Common mistake avoided: Using \(0.95\) as the answer ignores the condition \(H\). The unconditional mean is \(E[C]\), not \(E[C\mid H]\). Here the conditioning event excludes all outcomes with zero successes, so the conditional expected count is larger.
What Changes When the Conditioning Information Changes?
The indicators in a count do not change merely because we condition, but the probabilities used to average them do. If \(B\) is a category, use \(P(A_j\mid B)\). If \(B\) includes both a category and a trial history, use probabilities conditional on both pieces of information. If the number of opportunities \(N\) is random, account for its distribution under the stated condition.
For any finite collection of indicators, the central calculation can be organized as follows:
Write it as \(C=\sum_{j=1}^{m} I_j\), identifying exactly what each indicator records.
Name the event or category being conditioned on, and check that it has positive probability.
For each indicator, determine \(P(I_j=1\mid B)\). If the count depends on random \(N\), first calculate conditional expected counts for each possible \(N\).
Add the conditional indicator probabilities, or average the conditional expected counts over the distribution of \(N\) given the condition.
For a finite maximum number \(m\) of opportunities, an opportunity that does not occur can be represented by an indicator that is zero. This lets the entire count be written as a fixed-length sum, even if the actual number of opportunities varies. For an unbounded number of opportunities, the same idea applies when the count has a finite expectation; in routine finite-support problems, the direct conditional averaging calculation is usually simplest.
Common Exam Traps
- Assuming independence is necessary. It is not needed to add expectations. It may be needed to calculate a joint probability, such as the probability that all checks fail, as in the third example.
- Using unconditional probabilities after conditioning. If a question specifies a category or observed history, each indicator’s probability must reflect that information.
- Multiplying by a random attempt count without resolving its dependence. When the success probability changes with \(N\), compute the expected count separately at each possible \(N\) and then average.
- Forgetting that a non-occurring opportunity contributes zero. If \(N=0\), the count is zero, regardless of what a formula for the per-test probability might say; there are no tests to flag anything.
Check Your Understanding
For each problem, express the count using indicators and apply conditional linearity. Answers are given to check the numerical result.
- Given category \(A\), five components have conditional failure probabilities \(0.12\), \(0.20\), \(0.35\), \(0.08\), and \(0.25\). Find the expected number of failures given \(A\). The failures may be dependent. (Answer: \(1.00\))
- Given group \(B\), an inspection has \(N=1,2,\) or \(4\) opportunities with probabilities \(0.20\), \(0.50\), and \(0.30\). Given \(B\) and \(N=n\), each opportunity succeeds with probability \(0.10+0.05n\). Find the expected number of successes given \(B\). (Answer: \(0.59\))
- Given a recorded history \(H\), the conditional probabilities that three pending applications are approved are \(0.40\), \(0.70\), and \(0.20\). Find the expected number approved given \(H\). (Answer: \(1.30\))
- Two independent devices have success probabilities \(0.40\) and \(0.30\). Given that at least one succeeds, find the expected number of successes, rounded to four decimal places. (Answer: \(1.2069\))
- Given category \(C\), an operation has \(N=0,1,\) or \(3\) attempts with probabilities \(0.25\), \(0.50\), and \(0.25\). Given \(C\) and \(N=1\), the attempt succeeds with probability \(0.20\); given \(C\) and \(N=3\), each attempt succeeds with probability \(0.40\). Find the expected number of successes given \(C\). (Answer: \(0.40\))