1.3 Computing Expectations by Conditioning

Let \(X\) and \(Y\) be discrete random variables \[E\left (X\big /\, Y = y\right ) = \sum _x x\, P(X = x\, \big |\, Y = y)\]

What is \(\, E(X/Y)\) ?

\(E(X/Y)\) is a function of \(Y\).
Also it is a random variable which assumes values like \(E(X/Y= y)\) at \(Y = y\).

Lemma 1.3.1. Let \(X\) and \(Y\) be discrete random variables. Then \(\, E\left ( E\left (X/Y\right )\right ) = E(X)\).

Proof. \begin {align*} E\left (E\left (X/Y\right )\right ) & = \sum _y E\left (X/Y = y\right )\, P(Y = y)\\ & = \sum _y\sum _x\, x\, P\left (X = x\, \big /\, Y = y\right )\, P(Y = y)\\ & = \sum _y \sum _x \, x\, P(X = x\, , \, Y = y)\\ & = \sum _x x\, \sum _y P(X = x\, , \, Y = y)\\ & = \sum _x x\, P(X = x)\\ & = E(X). \end {align*} □

Example 1.3.2. A miner is trapped in a mine containing three doors. The first door leads to a tunnel that takes him to safety after two hours of travel. The second door leads to a tunnel that returns him to the mine after three hours of travel. The third door leads to a tunnel that returns him to his mine after five hours. Assuming that the miner is at all times equally likely to choose any one of the doors, what is the expected length of time until the miner reaches to safety.

Solution. \(X:\) time to return to safety from mine.
Let \(Y\) denote the door the miner chooses. \(Y = y_i\) , if miner chooses \(i^{\text {th}}\) door \((i = 1\, , \, 2\, , \, 3)\) \begin {align*} E(X) & = E\left (E\left (X\big /Y\right )\right )\\ & = \sum _y E(X/y = y)\, P(Y = y)\\ & = 2\times \frac {1}{3} + \left (E(X) + 3\right )\times \frac {1}{3} + \left (E(X) + 5\right )\times \frac {1}{3}\\\\ 3\,E(X) & = 2 + E(X) + 3 + E(X) + 5 \end {align*}

\[E(X) = 10\, hrs.\] □

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.