6.042/18.] Mathematics for Computer Science May6,2005 Srini devadas and Eric Lehman Notes for recitation 22 1 Conditional Expectation and Total Expectation There are conditional expectations, just as there are conditional probabilities. If R is a random variable and e is an event, then the conditional expectation Ex(r e)is defined bv x(R|E)=∑R(),Pr(m|E) For example, let R be the number that comes up on a roll of a fair die, and let E be the event that the number is even. Let's compute Ex(RI E), the expected value of a die roll, given that the result is even Ex(R|E)=∑R(o)P(E) =1.0+2.-+3·0+4.-+5·0+6 It helps to note that the conditional expectation, Ex(R I E)is simply the expectation of R with respect to the probability measure Preo defined in PSet 10. So it's linear Ex(R1+R2 E)=Ex(R1 E)+Ex(r2 E) Conditional expectation is really useful for breaking down the calculation of an ex- pectation into cases. The breakdown is justified by an analogue to the Total Probability The Theorem 1(Total Expectation). Let E1,..., En be events that partition the sample space and all have nonzero probabilities. If R is a random variable, then Ex(B)=Ex(B|E1)Pr(E1)+…+Ex(B|En)·Pr(En) For example, let R be the number that comes up on a fair die and e be the event that result is even, as before. Then E is the event that the result is odd. So the Total Expectation heorem says Pr(E)+Ex(R E). Pr(E)� � � 6.042/18.062J Mathematics for Computer Science May 6, 2005 Srini Devadas and Eric Lehman Notes for Recitation 22 1 Conditional Expectation and Total Expectation There are conditional expectations, just as there are conditional probabilities. If R is a random variable and E is an event, then the conditional expectation Ex (R | E) is defined by: � Ex (R | E) = R(w) · Pr (w | E) w∈S For example, let R be the number that comes up on a roll of a fair die, and let E be the event that the number is even. Let’s compute Ex (R | E), the expected value of a die roll, given that the result is even. Ex (R | E) = R(w) · Pr (w | E) w∈{1,...,6} 1 1 1 = 1 · 0 + 2 · + 3 · 0 + 4 · + 5 · 0 + 6 · 3 3 3 = 4 It helps to note that the conditional expectation, Ex (R | E) is simply the expectation of R with respect to the probability measure PrE () defined in PSet 10. So it’s linear: Ex (R1 + R2 | E) = Ex (R1 | E) + Ex (R2 | E). Conditional expectation is really useful for breaking down the calculation of an expectation into cases. The breakdown is justified by an analogue to the Total Probability Theorem: Theorem 1 (Total Expectation). Let E1, . . . , En be events that partition the sample space and all have nonzero probabilities. If R is a random variable, then: Ex (R) = Ex (R | E1) · Pr (E1) + · · · + Ex (R E| n) · Pr (En) For example, let R be the number that comes up on a fair die and E be the event that result is even, as before. Then E is the event that the result is odd. So the Total Expectation theorem says: Ex (R) = Ex (R E)·Pr (E) + Ex R E ·Pr (E) � �� � � ��| � � �� � � ��| � � �� � = 7/2 = 4 = 1/2 = ? = 1/2