青蛙跳荷叶
Frog and the Lily Pads
题目详情
青蛙在池塘一边,前方有 块荷叶排成一条直线,最后一块在对岸。
青蛙每次可以跳过 1 块(落到第 2 块),或跳过 2 块(落到第 3 块)。
问:青蛙到达对岸一共有多少种不同跳法?
A frog is at the edge of a pond. There are lily pads in a straight line in front of the frog, with the last one being right at the opposite edge of the pond. The frog wishes to get to the other side by hopping on these lily pads. The frog can jump over one lily pad (landing on the second), or make a big leap over two lily pads (landing on the third).
In how many ways can the frog get to the other side?
解析
设 表示到达第 块荷叶的走法数,则
- ,;
- 对 ,最后一步要么从 跳 1 格,要么从 跳 2 格:
因此走法数是斐波那契数列,对应为第 个斐波那契数。
Original Explanation
Let denote the number of ways the frog can reach the lily pad.
-
For the first lily pad: The frog can jump directly onto it.
-
For the second lily pad: The frog can either jump directly onto it, or jump to the first pad and then to the second.
-
For any lily pad , the frog can:
- Jump from pad
- Or leap from pad
Thus, we have the recurrence relation:
This recurrence is exactly the Fibonacci sequence. So the number of ways the frog can reach the lily pad is the Fibonacci number.
✅ Final Answer:
The number of ways the frog can reach the opposite edge is the Fibonacci number.