Conditional expectation on X given max{X,Y} Good day,
not long ago i solved similar problem for $X_1, X_2,...,X_n$ iid $U(\{1,..,N\})$ (discrete). But then i asked myself what if $X_i$ would be iid $U([0,1])$ (continuous) and realised that tricks i used for discrete calculations wouldn't work at all.
So let be $X$ and $Y$ independent random variables with continuous uniform distribution on [0,1]. $Z:=\max\{X,Y\}$. How to calculate $\mathbb{E}[X|Z]$?
To acquire $\mathbb{E}[X|Z=z]$ would be enough for calculating. And i know that
\begin{align*}
\mathbb{E}[X|Z=z]=\int x d\mathbb{P}^{X|Z=z} 
\end{align*}
$\mathbb{P}^Z$ almost surely. Good, the problem reduces to finding out what $\mathbb{P}^{X|Z=z}$ is. 
We know that $\mathbb{P}^{X|Z=z}$ has a lebesgue density $\frac{f(x,z)}{f^Z(z)}$.
Calculating of $f^Z(z)$ wasn't hard and i have $2z\mathbf{1}_{0\leq z\leq1}$, but i am clueless about $f(x,z)$.
i have read this post from Did
Conditional expectation $E[X\mid\max(X,Y)]$ for $X$ and $Y$ independent and normal but i have no idea where the formula comes from.
If someone knows how to solve this problem please tell me.
 A: It seems to me that if you know the maximum, $Z$, of $X$ and $Y$, then there is a $.5$ chance that $X=Z$ (the probability of a tie is $0$ with the uniform distribution); and there is a $.5$ chance that $X<Z$--in this case, I think $X$ is uniformly distributed on $[0,Z]$.  Thus $E[X|Z]=.5Z+.5\frac{Z}{2}=\frac{3Z}{4}$.
A: [under review]
Since you managed to calculate $f_Z$ correctly, let me compute $f_{X, Z}$. 
First we find the corresponding cumulative distribution function
$$ F_{X, Z}(x,z)=\mathbb{P}(\{X \leq x, Z \leq z \}) = \mathbb{P}(\{X \leq x, X \leq z, Y \leq z\}  ) $$
First consider the case when $z<x$, then we obtain that
$$\begin{align} &\mathbb{P}(\{X \leq x, Z \leq z \}) \\=& P(\{X \leq z, Y \leq z\}  )\\ 
&\text{now we use independence of } X \text{ and } Y\\
=& F_X(z)F_Y(z)\end{align}  $$
Now assume that $x \leq z$, then
$$\begin{align} &\mathbb{P}(\{X \leq x, Z \leq z \}) \\=&P(\{X \leq x, Y \leq z\}  )\\ =& F_X(x)F_Y(z)\end{align}.$$
Thus 
$$f_{X, Z}(x, y) = \frac{\partial^2}{\partial x \partial z}F_{X, Z}(x,z) = \begin{cases} 0 & \text{if } z < x \\ \mathbf{1}_{(0,1)}(x,z) &\text{if } x \leq z\end{cases}.$$
Now as probably you know you can use the fact that
$$f_X(X \mid Z=z) = \frac{f_{X, Z}(x, z)}{f_Z(z)}.$$
A: In your case, if you know the max is $Z=z$, then we have $E[X|Z=z]=P(X<z|Z=z)E[X|X<z,Z=z]+ zP(X=z|Z=z)$.
Now, the second term may seem strange, as $X,Y$ are continuous, however, the knowledge of $Z=z$ implies that $X$ or $Y$ or both are equal to $z$: $P(X=z|Z=z)+P(Y=z|Z=z)-P(X=z \cap Y=z|Z=z)=1$. By independence, we know that $P(X=z|Z=z)=P(Y=z|Z=z)$. 
The third term is says both variables take on the maximum...in other words, they are equal. The probability that they are equal is intuitively $0$ (since the set $\{\{(x,y)|x=y)\}\cap [0,1]^2\}$ has Lebesgue measure $0$.
Therefore: $P(X=z|Z=z)+P(Y=z|Z=z)=1 \implies P(X=z|Z=z)=P(Y=z|Z=z)=\frac{1}{2}$ and we then know $P(X<z|Z=z)=1-P(X=z|Z=z)=\frac{1}{2}$
Thus,
$$E[X|Z=z]=\frac{1}{2}E[X|Z=z]+ \frac{z}{2}=\frac{z}{4}+\frac{z}{2}=\frac{3z}{4}$$ 
