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.
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}$$