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

970 Views Asked by At

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?