This is essentially a much harder version of this problem ( The expected value of days a miner will be stuck)
I understand the answers to that one but not sure how I would incorporate more than 1 step of find variance.
So the problem is:
A miner is stranded and there are two paths he can take.
Path A loops back to itself and takes him 5 days to walk it.
Path B brings him to a junction in 0 time. The junction at the end of Path B has 2 paths, say Path BA and Path BB.
Path BA brings him back to his original starting point and takes him 2 days to walk. Path BB brings him to safety and takes him 1 day to walk.
Each path has an equal probability of being chosen and once a wrong path is chosen, he gets disorientated and cannot remember which path it was and the probabilities remain the same.
What is the expected value of the amount of days he will spend before he exits the mine? What is the variance of the amount of days he will spend before he exits the mine.
I created this question based on the one already posted 2 years ago in order to understand the concept of conditioning better. Any solutions or help with this are greatly appreciated.
Miner can take route BB and escape in 1 day (2 correct decisions each with $\frac 12$ probability. $P(BB) = \frac 14$.
or he can take route BA and escape be back to his starting point in 2 days. $P(BA) = \frac 14$ or he can take route A and escape be back to his starting point in 5 days. $P(A) = \frac 12$
$P(A) + P(BB)+ P(BA) = 1$ which is good, we have covered all of the probabilities.
Finding $E[X]$ If he takes path $A$ Then his he wasted 5 days, and afterward his expected time to escape is still $E[X]$
$E[X] = \frac 12 (5 + E[X]) + \frac 14 (2 + E[X]) + \frac 14(1)$
And $E[X]= 13$
Alternative.
Suppose our minor chooses a wrong path. We exclude the good path, and he wastes $\frac 23\cdot 5 + \frac 13\cdot 2 = 4$ days
$E[X] = 1 + 4\cdot \frac 14\sum_\limits{n=1}^\infty n(\frac 34)^n = 1 + 4\frac {\frac 34}{(1-\frac 34)^2} = 13$
Variance $E[X^2] - E[X]^2 = E[(X-1)^2] + E[(X-1)]$
This adjustment takes off the one day to that it will definitely take to get out of the cave simplifies what follows
$E[(X-1)^2] = 4^2\cdot \frac 14\sum_\limits{n=1}^\infty n^2(\frac 34)^n\\ \sum_\limits{n=1}^\infty n^2 x^n = x\frac {1+x}{(1-x)^3}\\ E[(X-1)^2] = 16(\frac 14)(\frac {1+\frac 34}{(1 -\frac 34)^3}(\frac 34) = 336\\ E[(X-1)^2] - E[(X-1)]^2 = 336-144 = 192$