# 2008 iTest Problems/Problem 64

## Problem

Alexis and Joshua are walking along the beach when they decide to draw symbols in the sand. Alex draws only stars and only draws them in pairs while Joshua draws only squares in trios. "Let's see how many rows of $15$ adjacent symbols we can make this way," suggests Josh. Alexis is game for the task and the two get busy drawing. Some of their rows look like $$\begin{array}{ccccccccccccccc}\vspace{10pt}*&*&*&*&*&*&*&*&*&*&*&*&\blacksquare&\blacksquare&\blacksquare\\\vspace{10pt}\blacksquare&\blacksquare&\blacksquare&*&*&*&*&*&*&*&*&*&*&*&*\\\vspace{10pt}\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&*&*&*&*&*&*&\blacksquare&\blacksquare&\blacksquare\\\vspace{10pt}\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare&\blacksquare\\\vspace{10pt}*&*&*&*&*&*&\blacksquare&\blacksquare&\blacksquare&*&*&*&*&*&*\end{array}$$

The twins decide to count each of the first two rows above as distinct rows, even though one is the mirror image of the other. But the last of the rows above is its own mirror image, so they count it only once. Around an hour later, the twins realized that they had drawn every possible row exactly once using their rules of stars in pairs and squares in trips. How many rows did they draw in the sand?

## Solution

We will use casework on the number of triplets drawn in order to count the number of rows drawn.

• If $1$ triplet is drawn, then there are $6$ pairs needed. There is a total of $\binom{7}{1} = 7$ rows in this case.
• If $3$ triplets are drawn, then there are $3$ pairs needed. There is a total of $\binom{6}{3} = 20$ rows in this case.
• If $5$ triplets are drawn, then there are $0$ pairs needed. There is only $1$ row in this case.

Since the twins drew all the possible rows, there are $7+20+1 = \boxed{28}$ rows that the twins drew.

## Solution 2 (Recursion)

Let $f(n)$ be the amount of valid ways to arrange pairs and trios of symbols. Note that this is equal to $f(n-2)+f(n-3)$, because both $n-2$ and $n-3$ conveniently allow us to add a final pair or trio to get $n$ symbols. Using binomial recursive expansion, we obtain $f(15) = f(3)+4f(4)+6f(5)+4f(6)+f(7)$. Since $f(2) = f(3) = f(4) = 1$, this can be simplified further to $1+4+6(1+1)+4(1+1)+(1+2) = \boxed{28}$.

~sigma

Note: Recursive binomial expansion is just a fancy way of generalizing a pattern of recursive functions of the form $f(n)=f(n-k)+f(n-k-1)$.