Your formula for the law of total expectation is correct : $$\mathbb E[X] = \mathbb E[X\mid Y=1]\mathbb P(Y=1) + \mathbb E[X\mid Y=2]\mathbb P(Y=2) +\mathbb E[X\mid Y=3]\mathbb P(Y=3)\tag1 $$ here is how to deal with the conditional expectations:
- For the case $Y=1$ (when the student goes to the playground), you are being told that the student plays for 2 hours before deciding between playing 2 more hours or going home, in a recursive manner.
By applying the law of total expectation to $X\mid Y=1$, we get the recursion $$\mathbb E[X\mid Y=1] = \mathbb E[X\mid Y=1, \text{student stays}] \mathbb P(\text{student stays}) + \mathbb E[X\mid Y=1, \text{student leaves}] \mathbb P(\text{student leaves})$$ Assuming that he stays in the playground with probability $0.4$, we get $$\mathbb E[X\mid Y=1] = (2+\mathbb E[X\mid Y=1])\cdot0.4 + 1\cdot0.6 $$ Which yields $\mathbb E[X\mid Y=1] \approx 2.33$ - By the same reasoning, we find for the case $Y=2$ that $$\mathbb E[X\mid Y=2] = (3 + \mathbb E [X\mid Y=2])\cdot0.3 + 1\cdot0.7 $$ From which you can deduce $\mathbb E[X\mid Y=2]$
- Lastly, the easiest case is $Y=3$, in which the student heads straight home (which takes one hour) : $$\mathbb E[X\mid Y=3] = 1 $$ You can now plug in all these values of the conditional expectations in the original equation $(1)$, and get an equation in $\mathbb E[X]$ that is easy to solve.