Solution (source code)

= Solution

At the root all $z$ neighbours are in shell one, so the <probability> of leaving the root for that shell is one. Conversely, a walker anywhere in shell one chooses its unique rootward <edge> with <probability> $1/z$. The two boundary recurrences are therefore
$$
\boxed{P(1,N+1)=P(0,N)+\frac1zP(2,N),}
$$
$$
\boxed{P(0,N+1)=\frac1zP(1,N).}
$$
Together with $P(0,0)=1$ and $P(r>0,0)=0$, these equations determine the distribution. In particular $P(1,1)=1$ and $P(0,2)=1/z$, which check the special root coefficient. For the original indexing, replace $N+1$ by $N$ and $N$ by $N-1$ on the right-hand sides. Summing these equations and the bulk recurrence conserves $\sum_{r\geq0}P(r,N)=1$.