Tutorials › Stochastic Processes › Conditioning on a Finite Partition

Random Variables, Expectation and Conditional Expectation · Tutorial 16 of 994

Conditioning on a Finite Partition

Use the cells of a finite partition to calculate conditional probabilities and averages when the observed information identifies which cell contains the outcome.

Intermediate 10 min read

What You'll Learn

  • Define a finite partition and interpret its cells as possible information outcomes.
  • Compute a conditional probability on a positive-probability cell.
  • Find a conditional average by restricting an expectation to one cell.
  • Handle zero-probability cells without assigning them an ordinary conditional value.
  • Check cellwise calculations by reconstructing an unconditional probability or average.
  • Avoid using the wrong denominator or averaging cell results without their probabilities.

Partitions as Finite Information

Often we do not know the exact outcome of an experiment, but we do know which one of a finite collection of cases occurred. For example, a test result may reveal “positive” or “negative” without revealing whether the person has the condition; a report may say that a count is low, medium, or high without giving its exact value. A finite partition records these possible information outcomes. Conditioning on a cell means calculating a probability or average under the knowledge that the outcome lies in that cell.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). A finite partition \(\{A_1,\ldots,A_r\}\) of \(\Omega\) consists of measurable events that are pairwise disjoint and whose union is \(\Omega\). Thus each outcome belongs to exactly one cell. The cells need not have equal probabilities. If a cell has positive probability, probabilities conditional on that cell are defined by the event-conditioning formula. If its probability is zero, that ratio is undefined, so ordinary conditioning on that cell is not available.

Definition: For an event \(B\in\mathcal{F}\) and a cell \(A_i\) with \(\mathbb{P}(A_i)>0\), define the conditional probability on that cell by \(\mathbb{P}(B\mid A_i)=\mathbb{P}(B\cap A_i)/\mathbb{P}(A_i)\). For an integrable random variable \(X\), define its conditional average on that cell by \(\mathbb{E}[X\mid A_i]=\mathbb{E}[X\mathbf{1}_{A_i}]/\mathbb{P}(A_i)\).

The second quantity is a number, not a new random variable: it is the average of \(X\) among outcomes in \(A_i\), with probabilities renormalized to sum to one on that cell. Integrability, \(\mathbb{E}[|X|]<\infty\), ensures the expectation in the numerator is finite. When \(X\) has a discrete distribution, the numerator can be computed by summing each possible value of \(X\) times its probability and the indicator of the cell. A conditional average may be negative, just as an ordinary average may be negative.

These formulas apply cell by cell. They do not require that the partition itself be generated by a random variable, though a recorded category often does give such a description. When information tells us only which cell occurred, the cell is the event on which we condition; we do not replace it by a more detailed observation that was not given.

Two Partition Calculation Rules

Theorem (Cellwise probability and average identities): Let \(\{A_1,\ldots,A_r\}\) be a finite partition of \(\Omega\), and let \(I=\{i:\mathbb{P}(A_i)>0\}\). For every event \(B\), $$ \mathbb{P}(B)=\sum_{i\in I}\mathbb{P}(A_i)\mathbb{P}(B\mid A_i). $$ If \(X\) is integrable and \(m_i=\mathbb{E}[X\mid A_i]\) for \(i\in I\), then $$ \mathbb{E}[X]=\sum_{i\in I}\mathbb{P}(A_i)m_i. $$ Zero-probability cells contribute nothing and are not assigned conditional probabilities or conditional averages by these formulas.

Proof. For the probability identity, the events \(B\cap A_i\) are pairwise disjoint and their union is \(B\), because the cells partition \(\Omega\). Therefore \(\mathbb{P}(B)=\sum_{i=1}^r\mathbb{P}(B\cap A_i)\). If \(\mathbb{P}(A_i)=0\), then \(B\cap A_i\subseteq A_i\), so \(\mathbb{P}(B\cap A_i)=0\). For every \(i\in I\), the definition gives \(\mathbb{P}(B\cap A_i)=\mathbb{P}(A_i)\mathbb{P}(B\mid A_i)\). Substituting these expressions proves the first identity. For the average identity, the indicators of the cells satisfy \(\sum_{i=1}^r\mathbf{1}_{A_i}=1\) at every outcome. Hence \(X=\sum_{i=1}^r X\mathbf{1}_{A_i}\), and linearity of expectation gives \(\mathbb{E}[X]=\sum_{i=1}^r\mathbb{E}[X\mathbf{1}_{A_i}]\). If \(\mathbb{P}(A_i)=0\), then \(X\mathbf{1}_{A_i}=0\) almost surely, so its expectation is zero. For \(i\in I\), the definition of \(m_i\) gives \(\mathbb{E}[X\mathbf{1}_{A_i}]=\mathbb{P}(A_i)m_i\). Substitution proves the second identity. \(\square\)

The identities provide useful checks: combine cell-specific probabilities or averages using the probabilities of the cells as weights. In particular, the cell averages should not usually be combined with equal weights. The identities also explain why a partition describes information: once a cell is known, calculations use probabilities and averages restricted to that event; before learning which cell occurred, the cell probabilities determine how those results are combined.

Worked Example: Updating a Disease Probability After a Test

Suppose \(D\) is the event that a randomly selected person has a disease. The prevalence is \(\mathbb{P}(D)=\tfrac{1}{10}\). A test is positive with probability \(\tfrac45\) for a person with the disease, and with probability \(\tfrac{1}{10}\) for a person without it. The partition consists of the events \(A_+=\{\text{positive}\}\) and \(A_-=\{\text{negative}\}\). Find the disease probability on each cell and the conditional average of a loss \(X\) that equals \(100\) if the person has the disease and \(0\) otherwise.

The joint probabilities follow by multiplying each disease status probability by the relevant test probability: \(\mathbb{P}(D\cap A_+)=\tfrac{1}{10}\cdot\tfrac45=\tfrac{8}{100}\) and \(\mathbb{P}(D^c\cap A_+)=\tfrac{9}{10}\cdot\tfrac{1}{10}=\tfrac{9}{100}\). Thus \(\mathbb{P}(A_+)=\tfrac{17}{100}\), and \(\mathbb{P}(D\mid A_+)=\tfrac{8/100}{17/100}=\tfrac8{17}\).

For a negative result, \(\mathbb{P}(D\cap A_-)=\tfrac{1}{10}\cdot\tfrac15=\tfrac{2}{100}\) and \(\mathbb{P}(D^c\cap A_-)=\tfrac{9}{10}\cdot\tfrac9{10}=\tfrac{81}{100}\). Therefore \(\mathbb{P}(A_-)=\tfrac{83}{100}\) and \(\mathbb{P}(D\mid A_-)=\tfrac{2/100}{83/100}=\tfrac2{83}\).

Since \(X=100\mathbf{1}_D\), its conditional average on either cell is \(100\) times the disease probability on that cell. The results are \(\mathbb{E}[X\mid A_+]=100\cdot\tfrac8{17}=\tfrac{800}{17}\) and \(\mathbb{E}[X\mid A_-]=100\cdot\tfrac2{83}=\tfrac{200}{83}\).

Check: The cell probabilities sum to \(\tfrac{17}{100}+\tfrac{83}{100}=1\). Recombining the disease probabilities gives \(\tfrac{17}{100}\cdot\tfrac8{17}+\tfrac{83}{100}\cdot\tfrac2{83}=\tfrac8{100}+\tfrac2{100}=\tfrac{1}{10}\), the stated prevalence. The weighted conditional loss is \(\tfrac{17}{100}\cdot\tfrac{800}{17}+\tfrac{83}{100}\cdot\tfrac{200}{83}=8+2=10\), equal to the unconditional average \(100\cdot\tfrac{1}{10}=10\).

Worked Example: Conditional Information from Two Coin Tosses

Two fair coins are tossed independently. Let \(X\) be the total number of heads, and let the partition record only the first toss: \(A_H=\{\text{first toss is heads}\}\) and \(A_T=\{\text{first toss is tails}\}\). Find the probability of two heads and the conditional average of \(X\) on each cell.

The four equally likely outcomes are \(HH, HT, TH, TT\), each with probability \(\tfrac14\). Thus \(\mathbb{P}(A_H)=\mathbb{P}(A_T)=\tfrac12\). Given \(A_H\), the two equally likely outcomes are \(HH\) and \(HT\); \(X\) equals \(2\) and \(1\), respectively. Therefore \(\mathbb{P}(X=2\mid A_H)=\tfrac12\) and \(\mathbb{E}[X\mid A_H]=\tfrac12(2)+\tfrac12(1)=\tfrac32\). Given \(A_T\), the outcomes are \(TH\) and \(TT\), so \(X\) equals \(1\) and \(0\). Consequently \(\mathbb{P}(X=2\mid A_T)=0\) and \(\mathbb{E}[X\mid A_T]=\tfrac12(1)+\tfrac12(0)=\tfrac12\).

Check: The probability of two heads reconstructed from the cells is \(\tfrac12\cdot\tfrac12+\tfrac12\cdot0=\tfrac14\), matching the single outcome \(HH\) among four equally likely outcomes. The unconditional average of \(X\) is \(\tfrac14(2+1+1+0)=1\); the cell averages reconstruct it as \(\tfrac12\cdot\tfrac32+\tfrac12\cdot\tfrac12=1\).

Worked Example: Unequal Cell Probabilities on a Spinner

A spinner has outcomes \(1,2,3,4\) with probabilities \(\tfrac18,\tfrac18,\tfrac14,\tfrac12\), respectively. Let \(X\) be the outcome, and let the partition be \(A_L=\{1,2\}\) and \(A_H=\{3,4\}\). Find the conditional average of \(X\) on each cell and the conditional probability of outcome \(4\) on \(A_H\).

The cell probabilities are \(\mathbb{P}(A_L)=\tfrac18+\tfrac18=\tfrac14\) and \(\mathbb{P}(A_H)=\tfrac14+\tfrac12=\tfrac34\). On the low cell, the numerator of the conditional average is \(1\cdot\tfrac18+2\cdot\tfrac18=\tfrac38\); hence \(\mathbb{E}[X\mid A_L]=\tfrac{3/8}{1/4}=\tfrac32\). On the high cell, the numerator is \(3\cdot\tfrac14+4\cdot\tfrac12=\tfrac34+2=\tfrac{11}{4}\), so \(\mathbb{E}[X\mid A_H]=\tfrac{11/4}{3/4}=\tfrac{11}{3}\). The conditional probability of outcome \(4\) given \(A_H\) is \(\tfrac{1/2}{3/4}=\tfrac23\).

Check: The four outcome probabilities sum to \(\tfrac18+\tfrac18+\tfrac14+\tfrac12=1\). The unconditional average is \(1\cdot\tfrac18+2\cdot\tfrac18+3\cdot\tfrac14+4\cdot\tfrac12=\tfrac{25}{8}\). The cell averages give \(\tfrac14\cdot\tfrac32+\tfrac34\cdot\tfrac{11}{3}=\tfrac38+\tfrac{11}{4}=\tfrac{25}{8}\), in agreement.

Denominators, Zero-Probability Cells, and Information

The denominator in a conditional probability or average is the probability of the cell on which the calculation is made. It is not the probability of the target event, nor the probability of some larger set unless that larger set is the actual conditioning event. For a discrete model, an efficient calculation is to list the outcomes in the cell, retain their original probabilities, and divide by the total probability of the cell. This normalization makes the conditional probabilities within that cell add to one.

If \(\mathbb{P}(A_i)=0\), the displayed ratios have denominator zero. One must not assign a value by direct substitution. In some more advanced settings, conditional quantities are defined up to almost-sure equivalence, so their values on zero-probability events are immaterial; that convention does not make the elementary ratio on a null cell defined. For the finite-cell calculations here, use only cells with positive probability. If there are no positive-probability cells, the probabilities of all cells would sum to zero, contradicting that they form a partition of a probability space.

Common mistake. A frequent error is to divide the joint probability by the probability of the wrong event. For the positive-test cell above, the correct disease probability is \(\mathbb{P}(D\cap A_+)/\mathbb{P}(A_+)=\tfrac{8}{100}/\tfrac{17}{100}=\tfrac8{17}\). The incorrect calculation \(\mathbb{P}(D\cap A_+)/\mathbb{P}(D)=\tfrac{8}{100}/\tfrac{1}{10}=\tfrac45\) answers a different question: it is the probability of a positive test given disease. The numerator is the same, but the conditioning event determines the denominator.

A second error is to average cell-specific results without weighting by how likely the cells are. In the spinner example, the unweighted mean of the two conditional averages is \(\tfrac12(\tfrac32+\tfrac{11}{3})=\tfrac{31}{12}\), not the overall average \(\tfrac{25}{8}\). The cells have probabilities \(\tfrac14\) and \(\tfrac34\), so the correct combination is \(\tfrac14(\tfrac32)+\tfrac34(\tfrac{11}{3})=\tfrac{25}{8}\). The weights represent the relative frequency with which each information outcome occurs.

Check Your Understanding

For each question, identify the conditioning cell and use its probability as the denominator. Check any cellwise results by recombining them with the cell probabilities.

  1. A partition has cells \(A_1,A_2\) with probabilities \(\tfrac13,\tfrac23\). If \(\mathbb{P}(B\mid A_1)=\tfrac12\) and \(\mathbb{P}(B\mid A_2)=\tfrac14\), find \(\mathbb{P}(B)\).
  2. A fair six-sided die is observed only to lie in \(\{1,2,3\}\). Find the conditional average of its value on that cell.
  3. If \(\mathbb{P}(A)=0\), why is \(\mathbb{P}(B\mid A)=\mathbb{P}(B\cap A)/\mathbb{P}(A)\) not defined by the event-conditioning formula?
  4. For the two-coin example, what is the conditional probability of exactly one head given that the first toss is tails?
  5. Explain why the overall average of cell averages uses the probabilities of the cells as weights rather than equal weights in general.