Count the last piece
transcript
A strip is covered with pieces. The pieces have length one, three or four. The order of the pieces matters. Three then one differs from one then three. How many ways cover six units?
Look at the last piece only. Its length is one, three or four. The rest was covered before it, in any of its ways. Add the ways for each possible rest.
No units has one way. Units one to three have one, one and two ways. Four units add three cells: two, one and one. Six units have nine ways. Each cell added three cells at most.
Covering nothing has one way. Every cell traces back to it. A zero there makes every cell zero.
Counting adds the cells. The cheapest cover keeps the smallest. The loop stays the same. Only the sum became a minimum, and each piece adds its price.
Counting adds the last pieces. The base cell is one. Full breakdown in the lecture.