To solve the problem of finding the number of ways to tile a 2×n grid with 1×2 or 2×1 dominoes, we can use the following reasoning:
Key Observations:
Let (f(n)) denote the number of ways to tile a 2×n grid.
- For (n=1): Only 1 way (one vertical domino).
- For (n=2): 2 ways (two vertical dominoes or two horizontal dominoes stacked).
- For (n>2):
- If we place a vertical domino in the first column, the remaining grid is 2×(n-1), so (f(n-1)) ways.
- If we place two horizontal dominoes covering the first two columns, the remaining grid is 2×(n-2), so (f(n-2)) ways.
Thus, the recurrence relation is:
(f(n) = f(n-1) + f(n-2)) (Fibonacci sequence shifted).
Calculation for (n=5):
- (f(1)=1)
- (f(2)=2)
- (f(3)=f(2)+f(1)=3)
- (f(4)=f(3)+f(2)=5)
- (f(5)=f(4)+f(3)=8)
Answer: 8


作者声明:本文包含人工智能生成内容。