Recurrence to find P(n). P(n) is the number of ways to decorate a strip of size n with tiles.

103 Views Asked by At

There are three kind of tile. One is of size 1. Second is of size 2 of green color. Third is of size 2 with blue color.

These are the values I found but I can not figure out the formula. P1 1 p2 3 p3 5 p4 9 p5 21

1

There are 1 best solutions below

0
On

The recurrence can be expressed as: $$P(n)=P(n-1)+2*P(n-2)$$