三角形顶点随机游走
A bug starts at a vertex A of triangle ABC
题目详情
一只虫子从三角形 ABC 的顶点 A 出发。每一步它会移动到相邻的两个顶点之一。
问:长度为 8 的路径中,有多少条最终回到 A?例如 ABABABABA 是一条(长度 8)回到 A 的路径。
英文原题
A bug starts at a vertex A of triangle ABC. It then moves to one of its two adjacent vertices. How many paths of length 8 end back at vertex A? For example, one such path is ABABABABA.
解析
设 为从 A 出发走 步回到 A 的路径数, 为从 A 出发走 步到达 B 的路径数(到 C 同样也是 )。
递推:
- 要在 步回到 A,前一步必须在 B 或 C:。
- 要在 步到 B,前一步在 A(走 A→B)或在 C(走 C→B):。
初值 。
逐步算到 :
因此答案为 。
英文解析
Let be the number of paths starting from A and returning to A in steps, and let be the number of paths starting from A and reaching B in steps (the number of paths reaching C is also ).
Recurrence relations:
- To return to A in steps, the previous step must have been at B or C: .
- To reach B in steps, the previous step must have been at A (taking the step A→B) or at C (taking the step C→B): .
Initial values: .
Step-by-step calculation up to :
Thus, the answer is .