How many possibilities are there to build a tower of n height, using colorful blocks, where:
- white block is of 1 height
- black, red, blue, green, yellow, pink blocks are equal to 2 heights
I need to find the generating function formula for this.
So, for n = 1 I get 1 possibility,
for n = 2 I get 2 possibilities,
for n = 3 I get 3 possibilities
for n = 4 I get > 4 possibilities etc.
The generating function at this moment would be $1 + 2x + 3x^{2} + ...$. But I have no idea how can I find the general formula calculating this.
Could you give me any suggestions, or solutions (;-)) ?
It looks to me like for $n=2$ you have $7$ possibilities, either two white or one of any of the $6$ colors. Similarly for $n=3$ you can have three white, or a white and a color, or a color and a white, for $13$ possibilities.
To make the recurrence, if there are $T(n)$ ways to make a tower $n$ high, we can either put a white block on a tower one shorter or put a colored block (6 ways) on a tower two shorter, so $$T(n)=T(n-1)+6T(n-2), T(1)=1, T(0)=1$$
This can be solved by the usual techniques-find the characteristic polynomial, factor, etc.
Added: if color doesn't matter but order does, change the $6$ to $1$ above. If color and order don't matter, the only choice to make is how many $2$ size blocks to use, which can range from $0$ to $\lfloor \frac n2 \rfloor$, for a total of $1+\lfloor \frac n2 \rfloor$ ways.