Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 37s1 days 16 hours 1 minutes 37 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 37s1 days 16 hours 1 minutes 37 seconds.

Sign in to watch this lesson
Advanced - Dynamic Programming · 4:01
To count the domino tilings of a board, we sweep it column by column and remember only a bitmask profile: which cells just past the frontier are already covered by dominoes poking across it. Filling each column from top to bottom gives the transitions, the table dp[column][mask] counts the 11 tilings of a 3 × 4 board, and moving the frontier one cell at a time (the broken profile) brings the work down to n·m·2ᵐ.