As a punishment for committing a particularly heinous crime you have been sentenced to jail under the following terms. Upon entering jail you draw a ball from a box containing balls numbered 0, 1, and 17 respectively. If you draw the ball numbered 0, you get out of jail immediately. If you draw 1 or 17, you replace the ball in the box and stay that many years in jail, at which time you draw again, under the same conditions. This is repeated until you draw the zero and go free. How long do you expect to be in jail? What is the variance of the time you will spend in jail?
What I did: let Y = time you have to stay in jail let X = the number on the first draw I think the goal is to find $EY = E(E(Y|X))$, so I would have to find: $E(Y|X=0)$, $E(Y|X=1)$, and $E(Y|X=17)$. I know that $E(Y|X=0) = 0$, but how do I calculate the other two conditional probabilities?