Dynamic Programming21 sections · 916 units
Open in Course

Tri Tiling - Recurrence Discovery

Pattern from profiles

Let ana_n = number of tilings of 3×n3 \times n. Using broken profile DP with 33 rows, you find that an=4an2an4a_n = 4a_{n-2} - a_{n-4} for n4n \geq 4, with a0=1a_0 = 1 and a2=3a_2 = 3. Why this formula? The profile transitions for width 33 have special symmetry.

When you work out all valid transitions, certain profiles combine predictably, collapsing into this clean formula. You can compute ana_n in O(n)O(n) time with a simple loop. The lesson here is that broken profile DP reveals the structure behind the recurrence.