1/13
Loading...
🧱Hallway Tiling!
Let's count how many ways to fill a 2-by-6 hallway with 1x2 and 2x1 tiles, no gaps allowed.
Loading...
Let's count how many ways to fill a 2-by-6 hallway with 1x2 and 2x1 tiles, no gaps allowed.
Dora, a junior interior technician, must tile a long hallway that is 2 cells wide. The storeroom only has identical tiles of two shapes: 1x2 (laid horizontally) and 2x1 (standing vertically). When the hallway is n cells long, how many distinct ways are there to cover it completely with no gaps and no overlaps?
3
3
There are 3 ways to fill a length-3 hallway: three vertical tiles / one vertical + a horizontal pair at the front / a horizontal pair at the back + one vertical.
6
13
A length-6 hallway can be filled in 13 ways. dp[6] = dp[5] + dp[4] = 8 + 5 = 13.