this problem was in this site a few days back.
i will give you the relation.
f(n)=f(n-1)+f(n-2)
now solve it.i believe this is fibonacci sequence.We would like to tile a 2x10 rectangle with 1x2 dominoes. How many different solutions are there?
First, you can tell the entire tiling just by looking at the top row: if it looks like a single square, that's part of a vertical domino; if there's a horizontal domino, there must be one directly beneath it.
So the question is: how many ways can you tile a 1x10 rectangle with squares and dominoes. It is indeed Fibonacci. There 1 way to tile a 1x1, and 2 ways to tile a 1x2 (domino or two squares). For 1xn, you can add a square to a 1x(n-1) tiling or a domino to a 1x(n-2) tiling. The numbers are 1, 2, 3, 5, 8, 13, 21, 34, 55, *89*.
No comments:
Post a Comment