Why Indicators Turn Events into Conditional Expectations
A conditional probability asks how likely an event is after specified information is available. When that information is a random variable, the answer generally depends on its observed value: it is itself a random variable. An indicator provides a direct way to express this conditional probability as a conditional expectation, making the connection between event calculations and expectation methods precise.
This connection is useful whether the variables have discrete distributions, continuous distributions, or a conditional law that has no density. The method is the same in each case: represent the event by an indicator, then take its conditional expectation using the appropriate conditional distribution.
The notation \(P(A\mid Y)\) means conditioning on the information supplied by \(Y\), not conditioning on a single event. Once \(Y=y\) is observed, a version of this random variable can be evaluated at \(y\), giving the conditional probability \(P(A\mid Y=y)\). Conditional distributions and these conditional probabilities are interpreted almost surely under the law of \(Y\); values at exceptional \(y\)'s of probability zero need not be uniquely determined.
Why the Indicator Identity Holds
Conditional expectation is characterized by how it averages over every event that can be described using the conditioning information. For \(Z=E[\mathbf{1}_A\mid Y]\), the defining property is that, for every measurable set \(C\),
Thus \(Z\) gives the conditional chance of \(A\) in each part of the information represented by \(Y\). It is between 0 and 1 almost surely, since \(\mathbf{1}_A\) is between 0 and 1. This characterizing property also explains why conditional probabilities are defined only up to changes on sets of \(Y\)-values having probability zero.
For a more explicit calculation, let \(K_y\) denote a conditional distribution of \(X\) given \(Y=y\). In the usual real-valued setting, such a conditional distribution can be represented by a probability measure \(K_y\), interpreted for almost every \(y\) under the distribution of \(Y\). If \(A\) is an event involving \(X\) and \(Y\), then
This is an integral with respect to a probability measure, not necessarily with respect to a density. If the conditional distribution has a density \(f_{X\mid Y}(x\mid y)\), the integral can be written as an integral against that density. For a discrete conditional law it becomes a sum. For a singular conditional law, such as a point mass, the measure formula still applies even though no density with respect to length exists.
Calculating from a Discrete Joint Law
Worked Example: A Conditional Event from a Joint Probability Table
A hypothetical monitoring system records a nonnegative alert count \(X\) and an indicator \(Y\) for whether a secondary review occurred. The joint probabilities are:
| \(X=0\) | \(X=1\) | \(X=2\) | Total | |
|---|---|---|---|---|
| \(Y=0\) | 0.10 | 0.20 | 0.10 | 0.40 |
| \(Y=1\) | 0.05 | 0.15 | 0.40 | 0.60 |
Find \(P(A\mid Y)\) for \(A=\{X=2\text{ or }(X=1\text{ and }Y=0)\}\). The table specifies the full joint model; interest and mortality assumptions do not apply.
Method. Since \(A\) is an event involving both variables, identify the entries in \(A\) separately for each value of \(Y\), then divide by the corresponding marginal probability of \(Y\).
When \(Y=0\), the event occurs for \(X=1\) or \(X=2\). The joint probability is \(0.20+0.10=0.30\), and \(P(Y=0)=0.40\). Therefore
When \(Y=1\), the condition \(X=1\) and \(Y=0\) cannot hold, so only \(X=2\) qualifies. Thus
to four decimal places. Hence \(E[\mathbf{1}_A\mid Y]\) equals 0.75 when \(Y=0\) and \(2/3\) when \(Y=1\). As a check, the joint probability of \(A\) is \(0.30+0.40=0.70\); the two conditional values weighted by their \(Y\)-row probabilities give \(0.75(0.40)+(2/3)(0.60)=0.30+0.40=0.70\). The common mistake is to include the \(X=1\) entry in the \(Y=1\) row; that entry does not satisfy the event as defined.
Using a Conditional Density When One Exists
If \(X\) given \(Y=y\) has a density, conditional event probabilities can be calculated by integrating that density over the values of \(X\) that make the event true. The event may also restrict the possible values of \(Y\), in which case that restriction remains part of the conditional probability.
Worked Example: A Two-Variable Event on a Triangular Support
Suppose \((X,Y)\) has joint density \(f_{X,Y}(x,y)=2\) for \(0<x<y<1\), and zero elsewhere. This is a normalized density because the triangular support has area \(1/2\). Find \(P(A\mid Y=y)\) for \(A=\{X>Y/2,\ Y<3/4\}\), and then find \(P(A)\). There are no interest or mortality assumptions; the distribution is specified by the joint density above.
Method. First calculate the marginal density of \(Y\):
The conditional density is therefore
for \(0<y<1\). Given such a \(y\), \(X\) is uniform over an interval of length \(y\). If \(y<3/4\), the event also requires \(y/2<X<y\), an interval of length \(y-y/2=y/2\). Its conditional probability is \((y/2)/y=1/2\). If \(y\geq 3/4\), the event's restriction on \(Y\) fails. Thus
For example, at \(y=0.60\) the conditional probability is \(1/2\), while at \(y=0.80\) it is 0. To obtain the unconditional probability, integrate the joint density directly over the event:
The result is checked by integrating the conditional probability against \(f_Y\): \(\int_0^{3/4}(1/2)(2y)\,dy=9/32\), the same value. A common error is to report \(1/2\) as \(P(A)\), using the conditional chance \(P(X>Y/2\mid Y=y)\) but ignoring the additional restriction \(Y<3/4\). The event's full condition must be applied.
Conditional Laws Need Not Have Densities
A continuous marginal distribution for \(Y\) does not guarantee that the conditional distribution of \(X\) given \(Y=y\) has a density. For example, if \(X=Y\), knowing \(Y\) determines \(X\) exactly. The conditional distribution of \(X\) is then concentrated at one point. The conditional-measure formula handles this case directly.
Worked Example: A Singular Conditional Law
Let \(Y\sim\operatorname{Uniform}(0,4)\) and define \(X=Y\) with probability 1. For \(A=\{X+Y>5,\ X<3\}\), find \(P(A\mid Y=y)\) and \(P(A\mid B)\), where \(B=\{2\leq Y\leq3\}\). Interest and mortality assumptions do not apply; the model is a uniform random variable on \((0,4)\) with \(X\) equal to \(Y\).
Method. Given \(Y=y\), the conditional law of \(X\) is the point mass at \(y\), denoted \(\delta_y\). The conditional event probability is the indicator of whether \((x,y)=(y,y)\) satisfies \(A\):
Thus the conditional probability is 1 for \(2.5<y<3\) and 0 otherwise, apart from any irrelevant choices at exceptional values. This point-mass law has no ordinary density for \(X\) given \(Y=y\), but the conditional probability is still well-defined.
On \(B\), the variable \(Y\) is uniform over an interval of length \(3-2=1\). The event \(A\) occurs within this interval precisely when \(2.5<Y<3\), a subinterval of length \(0.5\). Therefore
As a check, the conditional event occupies half of the interval defining \(B\). The common mistake is to search for a conditional density and use a continuous-density integral in \(x\); here the conditional distribution is a point mass, so integrating against \(\delta_y\) is the appropriate calculation.
Common Mistakes and a Reliable Procedure
Indicator notation is compact, but it does not remove the need to interpret the event and the conditioning information carefully. In particular, \(P(A\mid Y)\) is a function of \(Y\), whereas \(P(A\mid B)\), for an event \(B\) with positive probability, is a single number. In the latter case, \(P(A\mid B)=P(A\cap B)/P(B)\).
Write the event using inequalities or values of the random variables, including every restriction in its definition.
Use \(\mathbf{1}_A\), which equals 1 exactly on the event and 0 elsewhere.
Use a conditional probability table or mass function for discrete variables, a conditional density when one exists, or the conditional distribution measure in general.
Sum or integrate the indicator under that conditional law, verify the answer lies between 0 and 1, and check that all event restrictions were included.
- Dropping part of the event: An event such as \(\{X>Y/2,\ Y<3/4\}\) includes both conditions, not only the inequality involving \(X\).
- Using the wrong denominator: For a discrete conditional probability, divide by the probability of the conditioning value, not by the total probability of the event's qualifying entries.
- Assuming a density exists: Conditional distributions may be discrete or singular, even if the variable being conditioned on is continuous.
- Treating a conditional probability as constant: \(P(A\mid Y)\) can change with \(Y\); evaluate it at the given value or describe it as a function of \(Y\).
Check Your Understanding
For each problem, identify the event restrictions before calculating. Answers are given for checking.
- A joint table has \(P(X=0,Y=0)=0.18\), \(P(X=1,Y=0)=0.22\), \(P(X=0,Y=1)=0.12\), and \(P(X=1,Y=1)=0.48\). Find \(P(X=1\mid Y)\). (Answer: 0.5500 when \(Y=0\); 0.8000 when \(Y=1\).)
- Let \(Y\) be uniform on \((0,2)\), and suppose \(X\mid Y=y\) is uniform on \((0,y)\). Find \(P(X>Y/2\mid Y=y)\) for \(0<y<2\). (Answer: \(1/2\).)
- For the model in question 2, find \(P(X>Y/2,\ Y<1)\). (Answer: \(1/4\).)
- Let \(Y\sim\operatorname{Uniform}(0,5)\) and \(X=Y\). For \(A=\{X+Y>6,\ X<4\}\), state \(P(A\mid Y=y)\). (Answer: 1 for \(3<y<4\), and 0 otherwise, up to endpoint choices.)
- In the model of question 4, let \(B=\{2\leq Y\leq4\}\). Find \(P(A\mid B)\). (Answer: \(1/2\).)