基于算术几何递推闭式解(Closed form for arithmetico geometric recursion)的亨利往返行走极限点距离差求解问题
嘿,这道题挺有意思的,本质是找往返递推的极限点,咱们一步步来拆解:
Henry decides one morning to do a workout, and he walks $\tfrac{3}{4}$ of the way from his home to his gym. The gym is $2$ kilometers away from Henry's home. At that point, he changes his mind and walks $\tfrac{3}{4}$ of the way from where he is back toward home. When he reaches that point, he changes his mind again and walks $\tfrac{3}{4}$ of the distance from there back toward the gym. If Henry keeps changing his mind when he has walked $\tfrac{3}{4}$ of the distance toward either the gym or home from the point where he last changed his mind, he will get very close to walking back and forth between a point $A$ kilometers from home and a point $B$ kilometers from home. What is $|A-B|$?
步骤1:建立坐标与折返操作的数学表达
咱们先给位置定个基准:把亨利家设为坐标0点,健身房设为坐标2公里的点。接下来定义两种折返操作的数学公式:
- 当亨利在距离家$y$公里的位置,转身往家走时,他会走完当前到家里距离的$\tfrac{3}{4}$,最终到达的位置是:$y - \tfrac{3}{4}y = \tfrac{y}{4}$。咱们把这个往家折返的操作记为 $g(y) = \tfrac{y}{4}$。
- 当亨利在距离家$x$公里的位置,转身往健身房走时,他会走完当前到健身房距离的$\tfrac{3}{4}$(健身房在2公里处,这段距离是$2 - x$),最终到达的位置是:$x + \tfrac{3}{4}(2 - x) = \tfrac{x}{4} + \tfrac{3}{2}$。咱们把这个往健身房折返的操作记为 $f(x) = \tfrac{x}{4} + \tfrac{3}{2}$。
步骤2:建立极限状态的联立方程
当亨利来回折返到极限时,他会在$A$和$B$之间反复切换:从$A$出发往健身房走,到达$B$;从$B$出发往家走,回到$A$。这就形成了两个关键等式:
- $B = f(A)$(从$A$向健身房走,最终到$B$)
- $A = g(B)$(从$B$向家走,最终到$A$)
步骤3:联立求解并计算距离差
把$A = \tfrac{B}{4}$代入$B = \tfrac{A}{4} + \tfrac{3}{2}$,得到:
$$B = \tfrac{1}{4} \times \tfrac{B}{4} + \tfrac{3}{2}$$
整理计算:
$$B - \tfrac{B}{16} = \tfrac{3}{2}$$
$$\tfrac{15B}{16} = \tfrac{3}{2}$$
$$B = \tfrac{3}{2} \times \tfrac{16}{15} = \tfrac{8}{5} = 1.6$$
再计算$A$:
$$A = \tfrac{B}{4} = \tfrac{8}{5} \times \tfrac{1}{4} = \tfrac{2}{5} = 0.4$$
最后求两点的距离差:
$$|A - B| = \left| \tfrac{2}{5} - \tfrac{8}{5} \right| = \tfrac{6}{5} = 1.2$$
这个解法本质是利用算术几何递推的闭式解思路,通过极限状态的稳态方程直接求解,比无穷级数求和更简洁高效。
备注:内容来源于stack exchange,提问作者Starlight

