Dynamic Programming21 sections · 916 units
Open in Course

Domino and Tromino - Walkthrough

Mixed tile shapes

Tile a 2×n2 \times n grid with dominoes and L-shaped trominoes. More tile types=moretypes = more transitions. Width=2Width = 2, so only 44 masks: 0000, 0101, 1010, 1111.

Each mask transitions to several possible next masks. Enumerate: from mask 0000 (both empty), can place: horizontal domino (→ 0000), vertical domino in col 00 (→ 1010), L-tromino (→ 0101 or 1010). Simplify: with width 22, find a linear recurrence. f[n]=2f[n1]+f[n3]f[n] = 2f[n-1] + f[n-3]. Closed form via matrix exponentiation.