# Finding $E(Y_1 \mid \max(Y_1, Y_2))$ for independent $Y_1, Y_2$ random variables.

Suppose that $Y_1, Y_2$ are two independent observations from the following distribution: $$f_\theta(y) = \begin{cases} \dfrac{3y^2}{\theta^3} &\text{for } 0 <y \leq \theta, \ \theta>0 \\[8pt] 0 & \text{otherwise}\end{cases}$$

I am trying to find $E(Y_1 \mid \max(Y_1, Y_2))$, and am not sure how to do this. I can directly compute the integral but I still need to find the joint distribution of $Y_1$ and $\max(Y_1,Y_2)$, which I am not sure how to derive.

• your pdf does not integrate to 1 isn't it $\frac{3y^2}{\theta^3}$? – Momo Dec 5 '16 at 3:00
• Yes it is, sorry for the oversight! – user321627 Dec 5 '16 at 3:09

Without computing the joint density:

Let's define an indicator random variable $K$ taking value $1$ if $Y_1 > Y_2$, $2$ otherwise. Clearly, from symmetry, $P(K=1)=\frac12$. Let $Z=\max(Y_1,Y_2)$.

Then, using the law of total expectation with respect to variable $K$, $$E(Y_1 \mid Z) =E( E(Y_1 \mid Z , K))=\frac12 E(Y_1 \mid Z, K=1)+\frac12 E(Y_1 \mid Z ,K=2)$$

But $E(Y_1 \mid Z, K=1)=Z$ and $$E(Y_1 \mid Z, K=2)=E(Y_1 \mid Y_1 < Z)$$

This expectation corresponds to that of a truncated $Y_1$:

$$E(Y_1 \mid Y_1 < Z)=\frac{\int_0^Z y\, 3 y^2\, dy }{\int_0^Z 3 y^2 \,dy}=\frac{3}{4}Z$$

Putting all together:

$$E(Y_1 \mid Z)=\frac{1}{2}Z+\frac{3}{8}Z=\frac{7}{8}Z$$

• Thanks! If I could ask, could you tell me how you got $E( E(Y_1 \mid Z , K))=\frac12 E(Y_1 \mid Z, K=1)+\frac12 E(Y_1 \mid Z ,K=2)$? It seems like the expectation is taken with respect to $Z$ and $K$, but I am not sure how the right hand side is derived. – user321627 Dec 5 '16 at 3:13
• @user321627 Instead of $K=1$ read $Y_1>Y_2$... – Momo Dec 5 '16 at 3:27
• Can I also ask how you got $E(Y_1 \mid Z, K=1)=Z$ and $E(Y_1 \mid Z K=2)=E(Y_1 \mid Y_1 < Z)$? – user321627 Dec 5 '16 at 4:11
• @user321627 In $E(E(Y1∣Z,K))$ the outer expectation is with respect of $K$ (total expectation), so I'm computing that expectation using the usual $E(g(X))=\sum p(x)g(x)$ – leonbloy Dec 5 '16 at 4:26
• $E(Y_1 \mid Z, K=1)=Z$ because knowing that $K=1$ amount to knowing that $Z=Y_1$ – leonbloy Dec 5 '16 at 4:27

Hint: to find the joint pdf of $(Y_1,\max(Y_1,Y_2))$:

The support of $(Y_1,\max(Y_1,Y_2))$ is

Observe first that the CDF of $Y_i$ is $F_\theta(y)=\frac{y^3}{\theta^3}$ for $0<y<\theta$

Now if $F$ and $f$ are the joint CDF and pdf of $Y_1$ and $Y_2$, then for $0<y_1, y_2\le\theta$:

$$F(y_1,y_2)=P(Y_1\le y_1,\max(Y_1,Y_2)\le y_2)=P(Y_1\le y_1,Y_1\le y_2,Y_2\le y_2)\\=P(Y_1\le\min(y_1,y_2),Y_2\le y_2)=P(Y_1\le \min(y_1,y_2))P(Y_2\le y_2)=F_\theta(\min(y_1,y_2))F_\theta(y_2)$$

So

$$F(y_1,y_2)= \begin{cases} F_\theta(y_1)F_\theta(y_2)=\frac{9 y_1^2 y_2^2}{\theta^6}& \text{ if } y_1\le y_2\\ F_\theta(y_2)F_\theta(y_2)=\frac{9 y_2^4}{\theta^6}& \text{ if } y_1> y_2 \end{cases}$$

The problem with this approach is that when you differentiate, there is a Dirac component coming from a discontinuity of $F$, which is messy to work with.

So for the simplest path to final goal, you should follow leonbloy advice in his answer and condition on whether $Y_1\le Y_2$ or not:

$$E[Y_1|\max(Y_1,Y_2)]=E[Y_1|\max(Y_1,Y_2),Y_1\le Y_2]P(Y_1\le Y_2)+E[Y_1|\max(Y_1,Y_2),Y_1>Y_2]P(Y_1>Y_2)$$

• Thanks, can you tell me why you chose to have $y_1 \leq y_2$? – user321627 Dec 5 '16 at 2:34
• because $Y_1\le\max(Y_1,Y_2)$ so the joint pdf is zero if $y_1>y_2$ – Momo Dec 5 '16 at 2:35
• could you elaborate on why the joint pdf would be zero? – user321627 Dec 5 '16 at 2:37
• yeah, I think you are right. let me edit. – Momo Dec 5 '16 at 2:38