# Conditional expectation of the maximum of two independent random variables, given one of them

The question I am interested in is the following:

Given $X_1$ and $X_2$ two independent random variables both uniformly distributed on $[0,1]$, what is the conditional expectation of $\max\{X_1,X_2\}$ given $X_2$? And the conditional expectation of $\min\{X_1,X_2\}$ given $X_2$?

This question already exists, but I do not understand the solution given on the other page, and in particular, why one would have: $$\mathbb E(\max\mid X_2=x)=\Pr(\max=x\mid X_2=x)\mathbb E(\max\mid \max=x\ \&\ X_2=x) + \Pr(\max\ne x\mid X_2=x) \mathbb E(\max\mid \max\ne x\ \&\ X_2=x).$$ What is the rigorous passage that is done there?

• When you ask a question because you don't understand an existing answer, please ask specifically about the parts that you don't understand, thus formulating a new question. If you merely state that you don't understand the answer, you're basically asking for someone to answer the question all over again, i.e. you're posting a duplicate question. – joriki Aug 27 '15 at 14:49
• You're right, I am sorry. – Luigi Ambrosi Aug 27 '15 at 14:51
• The equation is correctly formatted in the solution. In order to copy the formatting, you can right-click (on Mac: ctrl-click) on the formula and select "Show Math As ... TeX Commands". – joriki Aug 27 '15 at 14:57
• The identity follows from the general fact that for every integrable $M$, event $A$ and partition $(B)$, $$E(M\mid A)=\sum_BE(M\mathbf 1_B\mid A)=\sum_BE(M\mathbf 1_B\mathbf 1_A)P(A)^{-1}=\sum_BE(M\mid A,B)P(B\mid A).$$ Apply this to $M=\max(X_1,X_2)$, $A=\{X_2=x\}$ and $(B)$ the partition into the events $\{M=x\}$ and $\{M\ne x\}$ (and forget that one is conditioning on an event of probability zero hence the whole solution should be rewritten using the correct definition of conditional expectation...). – Did Aug 27 '15 at 18:39
• I don't know how to thank you. You saved me!!! – Luigi Ambrosi Aug 28 '15 at 0:15