MathProblem 42 Drunken walk problem #1
A drunk is on one point of an n-gon, such that n is an even number. The drunk moves along the perimeter of the n-gon. Each steps takes him to an adjacent point, and every step is chosen at random. What is the expected number of steps before he arrives at the point directly opposite of his starting point (as a function of n)?
Solution
给定一个 \(n\) 边形,其中 \(n\) 为偶数,问从一个端点到其对面端点的期望步数。这里和 \(MathProblem\ 4\) 很相似,将起始点记为 \(0\), 只考虑一边,则对面的编号为 \(n/2\), 用递推:
\[\begin{align}
E[0]&=1+E[1]\\
E[1]&=1+\frac{1}{2}E[0]+\frac{1}{2}E[2]\\
E[2]&=1+\frac{1}{2}E[1]+\frac{1}{2}E[3]\\
&...\\
E[n/2-1]&=\frac{1}{2}\cdot 1+\frac{1}{2}E[n/2-2]
\end{align}
\]
根据最后一个式子往回带