Im trying to solve the question in the way of total expectancy (meaning $E[X]=E[E[X|Y]]$).
the question: "A fair cube with 4 sides is thrown twice. each side has a number from 1 to 4. Let's mark Y - maximum of two results. Evaluate E(Y) both by regular way and by the law of total expectation."
So I managed to do it by the regular path:
However, by the law of total expectation I can't figure out how to do that. I found out that if we mark X - result of first throw then:
- $P(Y=1|X=1)=P(Y=2|X=1)=P(Y=3|X=1)=P(Y=4|X=1)=\frac{1}{4}$
- $P(Y=1|X=2)=0$, $P(Y=2|X=2)=\frac{1}{2}$, $P(Y=3|X=2)=P(Y=4|X=2)=\frac{1}{4}$
- $P(Y=1|X=3)=P(Y=2|X=3)=0$, $P(Y=3|X=3)=\frac{3}{4}$, $P(Y=4|X=3)=\frac{1}{4}$
- $P(Y=1|X=4)=P(Y=2|X=4)=P(Y=3|X=4)=0$, $P(Y=4|X=4)=1$
so I see that only $Y|X=1$ ~$U[0,4]$ but I can't say anything about distributions $Y|X=2$, $Y|X=3$, $Y|X=4$. thus I can't use the law of total expectation.
Any advice would be appreciated! thanks


It looks like your stumbling point is that you are trying to think about this in terms of what you know about continuous distributions. I believe that everything you've done so far is correct, other than your statement "$Y|X=1\sim U[0,4]$".
$Y|X$ is discrete and you have written down the distributions explicitly. Now you can calculate $E[E[Y|X]]$ as:
$$E[E[Y|X]]=\sum_{k=1}^4E[Y|X=k]P(X=k)$$ Where: $$E[Y|X=k]=\sum_{j=1}^4j\cdot P(Y=j|X=k)$$