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

*February 15, 2015 at 8:34 am* *
5 comments *

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.

Entry filed under: Uncategorized. Tags: color, conjecture, Purdue, puzzle, pyramid.

1.abyssbrain | February 15, 2015 at 11:42 amIt has been proven again and again that children are better than many adults at spotting trivial patterns since they don’t think in a very complicated manner. They would just quickly “see” the pattern. Sometimes, the more we know, the more we tend to make things very difficult for us.

Btw, your son must be very good!

2.venneblock | February 15, 2015 at 7:57 pmI don’t think this is a trivial pattern — but probably because I didn’t spot it immediately! And yes, my son is good, but I’m terribly biased.

3.Dave Elwood | February 20, 2015 at 7:33 amHave you posted his conjecture?

4.venneblock | March 1, 2015 at 4:39 pmI haven’t, Dave. Since his was conjecture was correct, I didn’t want to give away the result. As with most things in life, it’s more fun to figure it out yourself than to just be told. Email me at

patrick [at] mathjokes4mathyfolks [dot] comif you’re desperate, though. I don’t usually provide answers via email responses, either, but perhaps you’ll catch me in a moment of weakness.5.Just Tell Me If I'm Right | July 19, 2016 at 11:13 amIt is easy to prove that the function f(a,b) = a, if a=b, and f(a,b)=c, if abca can be written as (for a,b,c in {1,2,3,}): f(x,y)=mod(-x-y,3) (ie base 3 modulo)

Expanding the top cell as computations of the lower rows, we found that the coefficients for (a1, a2, …, an – the initial row of cubes) are (modulo 3):

for n=1: 1

n=2; 1,1

n=3: 1.2.1

n=4: 1,3,3,1

You can see that starting for n=3 you have to start and stop the sequence with 1, the other terms being the sum of the previous on the left and right, ie for n=4 we have (1, 1+2, 2+1, 1)

Applying the modulo we get

n=4: 1,0,0,1

n=5: 1,1,0,1,1

n=6: 1,2,1,1,2,1

n=7: 1,0,0,2,0,0,1

n=8: 1,1,0,2,2,0,1,1

n=9: 1,2,1,2,1,2,1,2,1 (interesting… because)

n=10: 1,0,0,0,0,0,0,0,0,1

So, we have to apply the rule to the first and last cube in order to get the top cube color.