## Archive for February 15, 2015

### Colored Pyramids and the Mind of a 7-Year-Old

This is what kept me up last night. Literally.

Form a row of ten squares, with each square randomly colored red, green, or yellow. Call this Row 1. Then place nine squares in Row 2 slightly offset above Row 1, and color the squares in Row 2 according to the following rules:

- If two side-by-side squares have the same color, the square between them in the row above has the same color.
- If two side-by-side squares have different colors, the square between them in the row above has the third color.

Continue in this manner with eight squares in Row 3, seven squares in Row 4, and so on, with just one square in Row 10.

Here’s an example of a pyramid constructed in this manner:

The 1’s, 2’s and 3’s in the diagram appear because this image was created with Microsoft Excel. Formulas were used to determine the number in each square, and conditional formatting was used to color the squares.

So far, this is just a test of how well you can follow rules, and it isn’t much fun. But here’s where it gets interesting.

**How can you predict the color of the lone square in Row 10 after seeing only the arrangement of squares in Row 1 (and without constructing the rows in between)?**

That’s right…

*This shit just got real.*

I found this problem last night on the Purdue Math Department’s Problem of the Week website. I lay awake in bed longer than I should have, but no solution came to me either while laying there awake or while I was sleeping. When I woke up, I shared it with my sons. I suspected they’d have fun coloring squares; I never suspected what actually happened.

I explained the problem to Alex and Eli, and I showed them an example of how to generate Row 9 from an arbitrary Row 10. They then pulled out their box of crayons and constructed rows 8, 7, 6, …, 1. Alex then looked at his pyramid for about 8 seconds and said, “Oh, I get it. You can find the color of the top square by _________.” (*Spoiler omitted.*)

“Is that your conjecture?” I asked.

“What’s a *conjecture*?” he replied.

“It’s a guess,” I told him. “It’s what you think the rule is.”

“No,” he said. “It’s *not* a guess. That’s the rule.”

He was pretty cocky for a seven-year-old.

So we tested his rule for another randomly-generated Row 10. It worked. So we tested it again, and it worked again. We tested it for six different hand-drawn pyramids… and it worked for every one of them.

That’s when I generated **this Excel file**. We used it to test Alex’s conjecture on 100+ other pyramids. It worked every time.

I still have no idea how he divined the rule so quickly.

For me, though, the cool part came when I was able to extend the puzzle with the following:

**For what values of k can you predict the color of the lone square in Row k when there are k blocks in Row 1?**

Trivially, if I gave you just two blocks in Row 1, you could most certainly predict the color of the square in Row 2.

But if I gave you, say, five blocks in Row 1, could you predict the color of the lone square in Row 5?

The final part of the Puzzle of the Week description from the Purdue website says exactly what you’d expect it to say:

Prove your answer.

I have a proof showing that Alex’s conjecture holds. Incidentally, that proof can be extended to prove the general result for the extension just posed.

Alex, however, has not yet generated a proof of his conjecture.

Then again, he’s only seven.