Question: A prisoner in a dark dungeon discovers three tunnels leading from his cell. Unbeknownst to him, the first tunnel reaches a dead end after 50 feet and the second tunnel reaches a dead end after 20 feet, but the third tunnel leads to freedom after 100 feet. Each day, the prisoner picks a tunnel at random and crawls along it. If he reaches a dead end he has to crawl back to his cell.
(The darkness is so complete that he might try the same tunnel on successive days).
Find the expected distance that he crawls to reach freedom.
My Guess: I know that each tunnel has a probability of ⅓ of being chosen.
If Distance to freedom = 100(X) + 40(Y) + (100)(Z), where X = number of times he tries tunnel 1, Y = number of times he tries tunnel 2, and Z = number of times he tries tunnel 3 (=1 since it leads him to freedom).
Then E(D) = E(100X + 40Y + 100) = 100E(X) + 40E(Y) + 100.
I'm not sure if this logic is correct, and I'm a little confused on how to find E(X) and E(Y).