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.