Die and coin. Roll a die and flip a coin. Let $Y$ be the value of the die. Let $Z = 1$ if the coin shows a head, and $Z = 0$ otherwise. Let $X = Y + Z$. Find the variance of $X$.
My work:
$E(Y) = 1 \cdot \cfrac{1}{6} + 2 \cdot \cfrac{1}{6} + 3 \cdot \cfrac{1}{6} + 4 \cdot \cfrac{1}{6} + 5 \cdot \cfrac{1}{6} + 6 \cdot \cfrac{1}{6} = \cfrac{7}{2}$
$E(Z) = 0 \cdot \cfrac{1}{2} + 1 \cdot \cfrac{1}{2} = \cfrac{1}{2}$
So $E(X) = E(Y + Z) = E(Y) + E(Z) = \cfrac{7}{2} + \cfrac{1}{2} = 4$
$E(Y^2) = 1^2 \cdot \cfrac{1}{6} + 2^2 \cdot \cfrac{1}{6} + 3^2 \cdot \cfrac{1}{6} + 4^2 \cdot \cfrac{1}{6} + 5^2 \cdot \cfrac{1}{6} + 6^2 \cdot \cfrac{1}{6} = \cfrac{91}{6}$
$E(Z^2) = 0^2 \cdot \cfrac{1}{2} + 1^2 \cdot \cfrac{1}{2} = \cfrac{1}{2}$
so $E(X^2) = E(Y^2 + Z^2) = E(Y^2) + E(Z^2) = \cfrac{91}{6} + \cfrac{1}{2} = \cfrac{47}{3}$
$Var(X) = E(X^2) - (E(X))^2 = \cfrac{47}{3} - 4^2 = -\cfrac{1}{3}???$
Where did I go wrong, variance can't be negative so clearly my work is wrong, but I have no idea where I went wrong? Can someone point me in the right direction of how to do this question?
$Y\perp\!\!\!\!\!\!\perp Z$ thus $V(X)=V(Y)+V(Z)$
Your error is this
$$E(X^2)=E[(Y+Z)^2] \ne E(Y^2)+E(Z^2)$$