I am trying to understand better the concept of conditional expectation, and I am facing the following exercise:
I have two independent dice $X,Y$ with four faces s.t. $$P(X=i)=1/4=P(Y=i) , i\in\{1,2,3,4\}$$ What is the conditional expectation of the maximum of the two, given the value of one of them?
First of all, what is it asking me to compute? $\mathbb{E}(max(X,Y)|Y)$ or $\mathbb{E}(max(X,Y)|Y=y)$
I am kind of lost here: $$\mathbb{E}(max(X,Y)|Y=y)= \sum_{i=1}^4 i\cdot P(\{max = i\}|\{Y=y\})$$
because the value of $P(\{max = i\}|\{Y=y\})$ changes according to $i$ and to $y$ so I can not find a generic form of the value. For instance, is it true that $P(\{max=1\}|\{Y=y\}) = \begin{cases} 1/4 &\text{if} &y=1 \\ 0 &else \end{cases}\\ P(\{max=2\}|\{Y=y\}) = \begin{cases} 1/4 &\text{if} &y=1 \\ 1/2 &\text{if} &y=2 \\ 0 &else \end{cases}$
or am I doing something wrong?
It is possible to find the answer directly with conditional expectations, avoiding conditional probabilities.
For a fixed $j\in\{1,2,3,4\}$ we find:
$\begin{aligned}\mathsf{E}\left[\max\left(X,Y\right)\mid Y=j\right] & =\mathsf{E}\max\left(X,j\right)\\ & =\frac{1}{4}\sum_{i=1}^{4}\max\left(i,j\right)\\ & =\frac{1}{4}\left[\sum_{i=1}^{j}\max\left(i,j\right)+\sum_{i=j+1}^{4}\max\left(i,j\right)\right]\\ & =\frac{1}{4}\left[\sum_{i=1}^{j}j+\sum_{i=j+1}^{4}i\right]\\ & =\frac{1}{4}\left[j^{2}+\frac{1}{2}\left(4-j\right)\left(5+j\right)\right]\\ & =\frac{1}{8}\left[j^{2}-j+20\right] \end{aligned} $
This allows the conclusion that: $$\mathsf{E}\left[\max\left(X,Y\right)\mid Y\right]=\frac{1}{8}\left[Y^{2}-Y+20\right]$$