Solution (source code)

= Solution

Treat one visit to a level as a whole <gambler's ruin> excursion, starting at its chamber $1$ and ending at local chamber $0$ or $4$. The room choices are fair, so the chance of reaching $4$ before $0$ is $1/4$, and the chance of reaching $0$ first is $3/4$. The one-way hatches reset the next excursion to chamber $1$ of the adjacent level. Thus the <embedded Markov chain at level exits> moves upward with <probability> $1/4$ and downward with <probability> $3/4$, even though individual room choices are unbiased.

Let $u$ be the food <probability> from the lower starting chamber, and $v$ that from the upper chamber $1$. The lower level either exits unsuccessfully or reaches the upper level, while the upper level either finds food or returns to the lower start. <First-step analysis> at these level exits gives
$$
u=\tfrac14v,\qquad v=\tfrac14+\tfrac34u.
$$
Substituting yields $u=1/16+3u/16$, so
$$
\boxed{u=\frac1{13}.}
$$
This also follows from <biased gambler's ruin probability> on levels $0,1,2,3$, starting at $1$, with ratio $(1-p)/p=3$: $(1-3)/(1-3^3)=1/13$. Absorption occurs <almost surely>, since from each active level a fixed positive chance of terminal absorption occurs within two excursions; the original chamber excursions are also <almost surely> finite.

\Image[/past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2021/discrete-mathematics-continuous-mathematics-and-probability-level-chain.png]
{title=The maze reduced to level exits has upward probability one quarter and downward probability three quarters}