Find a recurrence for the number of integer compositions of n which only have 1s and 2s as parts

140 Views Asked by At

Find a recurrence for $$i_n$$ the number of integer compositions of $n$ which only have $1$s and $2$s as parts.

How do you approach this problem?

2

There are 2 best solutions below

0
On

Hint: what are the choices for the last part? For each choice, how many compositions are there for what is left?

0
On

HINT: if part is size 1, then if you remove it, there are (n-1) into parts of size 1 and 2. Then what if you remove the last part which is size 2?

Put it together and you got yourself the recurrence relation.