My daughter (aged 12) came to me with the problem below. I was able to help her to some extent but I could not see an age-appropriate solution. That is, I could imagine solutions involving factorials / combinations or writing a computer program. However she is in Year 7 at school and I could not see how to solve it with that level of knowledge. We settled on a brute-force solution but did not complete it as it would take too long. So can anyone solve this with a simple, logical algorithm using knowledge / techniques that a student just starting high school would be familiar with?
Say you have a set of black (B) and white (W) tiles - identical apart from colour. You arrange the tiles in various sequences, eg. B, BW, WWBW, etc. A sequence is considered to be significant if all of its sub-sequences of white tiles are even in length. Thus the following are significant: WW, BBB, WWWWBB; while the following are not: W, BWWW, BWWBBBW. Note: a sequence of length zero would appear to be deemed even.
There were a few simple questions we could solve, eg. how many significant sequences of length 1, 2, 3 and 4 are there. Enumerate them.
But the question that stumped us was: how many significant sequences of length 20 are there. We could not extrapolate easily from the earlier questions.
PS: I wasn't sure what tags to use. Please update as you see fit.
Let $a_n$ be the number of significant sequences of length $n$. If you count carefully, you’ll find that $a_1=1$, $a_2=2$, $a_3=3$, $a_4=5$, $a_5=8$, and $a_6=13$. You (or she) might recognize these as the Fibonacci numbers, and even if you don’t, you might notice that each is the sum of the previous two. If you extrapolate on this basis, you can guess (after a bit of arithmetic) that $a_{20}=10946$.
Of course you might wonder whether the extrapolation is legitimate. To see that it is, suppose that $\sigma$ is a significant sequence of length $n$, where $n\ge 3$. If $\sigma$ ends in B, the first $n-1$ letters of $\sigma$ are a significant sequence of length $n-1$. Conversely, if you start with any significant sequence of length $n-1$, adding a B to the end gives you a significant sequence of length $n$. Thus, there are $a_{n-1}$ significant sequences of length $n$ that end in B.
If, on the other hand, $\sigma$ ends in W, then it must actually end in WW, and the first $n-2$ letters of $\sigma$ must be a significant sequence of length $n-2$. Conversely, if you start with a significant sequence of length $n-2$ and add WW to the end, you get a significant sequence of length $n$. Thus, there are $a_{n-2}$ significant sequences of length $n$ that end in W.
Putting the two together, we see that $a_n=a_{n-1}+a_{n-2}$.