Suppose $X$ and $Y$ are independent and each Uniform $(0,1) .$ Find $\mathbb{E}[X | \max \{X, Y\}] .$
First, I have a general query: Suppose $A$ is a subset of the sample space. Can we always say $E(X|A)=E(X|B \cap A)\mathbb{P}(B|A)+E(X|B^c \cap A)\mathbb{P}(B^c|A)$, for any set $B$ such that $B \cap A \neq \emptyset$ and $B^c \cap A \neq \emptyset$?
Let $Z$ denote $\max \{X, Y\}$. In my attempt I have used the above approach to say:
$E(X|Z) = E(X|X \leq Y,Z)\mathbb{P}(X \leq Y|Z)+E(X|X > Y,Z)\mathbb{P}(X > Y|Z)$. After this I put $\mathbb{P}(X > Y|Z) = \mathbb{P}(Y \leq Z)=Z$ and $\mathbb{P}(X \leq Y|Z)=\mathbb{P}(X \leq Z)=Z$. (This is where I think I'm making some mistake 'cause the two probabilities should add up to 1). Then I put $E(X|X \leq Y, Z) = E(X|X \leq Z) = Z/2$ and $E(X|X > Y, Z) = Z$.
Using this approach gives me the answer $\frac{3}{4}Z^2$. However in the solution they seem to have used the following: $E(X|Z) = E(X|X \leq Y,Z)\mathbb{P}(X \leq Y)+E(X|X > Y,Z)\mathbb{P}(X > Y)$, which, using the exact same approach as above ($E(X|X \leq Y, Z) = E(X|X \leq Z) = Z/2$ and $E(X|X > Y, Z) = Z$) and putting $\mathbb{P}(X > Y) = \mathbb{P}(X \leq Y) = 1/2$ gives the correct answer $\frac{3}{4}Z$.
Any help is appreciated.
So $\mathbb{P}(X>Y \mid Z=z)$ and $\mathbb{P}(X \leq Y \mid Z=z)$ are both $1/2$ by symmetry considerations. Since of course $\mathbb{E}(X \mid X>Y,Z=z)=z$, you are only left to compute $\mathbb{E}(X \mid X \leq Y,Z=z)=\mathbb{E}(X \mid X \leq z)$ which is the expectation of a uniform variable on $(0,z)$ i.e. $z/2$. Putting the pieces together gives $z/2+(z/2)/2=3z/4$.
Note that in principle it is not correct to use the unconditional probabilities $\mathbb{P}(X \leq Y)$ in the total probability formula. It just so happens that the conditional probabilities $\mathbb{P}(X \leq Y \mid Z=z)$ do not depend on $z$. But that is a special property of the distribution here; it would not be the case if, say, $Y$ were uniform on $(0,2)$ instead.