The number of ways to build a $n\times 1$ walkway by using $1 \times 1$ red, $2 \times 1$ green, and $2 \times 1$ blue blocks

106 Views Asked by At

Build an $n \times 1$ walkway out of red $1 \times 1$ blocks, green $2 \times 1$ blocks, and blue $2 \times 1$ blocks. How many ways are there?

I think this is a permutation problem. Since, for example, $n=3$, I first use 1 green block and then use 1 red block is different from first using 1 red block and then using 1 green block. These are 2 different ways of building this walkway. Thus I think I should use an exponential generating function to solve this problem.

I only know that, for example, if all blocks are in $1 \times 1$ and there must be even green and blue blocks, then the exponential generating function should be $$\begin{aligned} g_{e}(x)=e^x\left( \frac{e^x+e^{-x}}{2} \right)^2 \end{aligned}$$ However, here the restriction is that green and blue blocks must be in $2 \times 1$, not in the even number of them. Thus I don't know what is the generating function here. Any help on this? Thanks.

If this question can't be approached by the generating function (or this method is not suitable here) Can you provide a way of dealing with this? Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

This question is not suitable for solving with exponential generating functions.It is good to see that you know that exponential generating functions can be used to permutate objects with repetition, but not in this question.

Let try to construct our generating function together without thinking which type of generating function should be used in a specific type of question.

If our $n$ were :

  • $n=1$ , then only red used

  • $n=2$, then (red-red) or (one blue) or (one green)

  • $n=3$ ,then (red-red-red) or (red-blue) or (blue -red) or (red-green) or (green-red)

  • etc.

Then, this question turned out to be classical "paying with coins" problems. So, we can say that its generating function is $$\frac{1}{1-(x+2x^2)}=1+(x+2x^2)+(x+2x^2)^2+(x+2x^2)^3+..$$