Face full of pi. Photograph: Bernat Armangue/APFace full of pi. Photograph: Bernat Armangue/AP
Alex Bellos's Monday puzzleMathematics This article is more than 6 years old

Did you solve it? Pi Day puzzles that will leave you pie-eyed

This article is more than 6 years old

The solutions to today’s gyral and viral puzzles

Earlier today I set you two puzzles as a pre-party for Pi Day.

1) Pictured below are three identical boxes packed with pies. You can assume that all pies are exactly the same height. Which box contains the most pie?

Pi, oh my. Illustration: Brilliant.org

Solution

A, B and C contain equal amounts of pie.

The tastiest solution is to consider box B as a square box made from four smaller square boxes, and box C as a square box made from 16 smaller square boxes. Pie fills the same percentage of each box, whatever the size of the box. So pie must fill the same percentage of A, B and C. In other words, the amount of pie is the same in each box.

But if you wanted to overcomplicate things, you can also solve with pi. As you remember from school, the area of a circle is pi x (radius)2, or πr2. Let the radius of the smallest pies (in C) be r, which means the radius of the medium pies (in B) is 2r and the radius of the big pi is 4r. Then the area of pie in A is π (4r)2 = 16r2, the area of pie in B is 4 x π (2r)2 = 16r2, and the area of pie in C is 16π (r)2 = 16r2. All the same!

How well did we do? Here are the results, with the results in parentheses of those who attempted the problem on Brilliant.org . Congrats Guardianistas, you smashed it!

  • A has the most pie: 23 per cent (21 per cent)
  • B has the most pie: 2 per cent (3 per cent)
  • C has the most pie: 10 per cent (18 per cent)
  • A, B and C have equal amounts: 65 per cent (58 per cent)

2) One hundred computers are connected in a 10x10 network grid, as below. At the start exactly nine of them are infected with a virus. The virus spreads like this: if any computer is directly connected to at least 2 infected neighbours, it will also become infected.

Will the virus infect all 100 computers?

Illustration: Brilliant.org

The image shows a possible example of the initial infection. You can try to fill it in to see if ultimately the network will consist of 100 orange dots. But the question is not asking what happens to this example. I want to know what will happen given any initial configuration of infected computers.

Solution

No, the virus will not infect all 100 computers.

The solution is simple to understand, although you would have needed some impressive insight to get there on your own.

They key here is the perimeter of the infection. By perimeter, I mean the length of the boundary of the infection. For the infection to infect all computers, then the final boundary must be 40, since the perimeter of an infected 10x10 square is 10 + 10 + 10 + 10 = 40

Note that the infection can be a single area, or it can be made up of many separate areas. If it is many separate areas, we need to combine the perimeters of all the infected areas.

The perimeter of a single infected computer is 4, as below. So the perimeter of nine infected computers will be maximum 36, which is 4 x 9. (This is the case when no infected computers are adjacent, as in the image above. But the perimeter may be much lower. For example, if the infected computers are all on the same row, the boundary will only be 9 + 9 + 1 + 1 = 20)

Illustration: Alex Bellos

The beautiful part of this problem is the fact that the perimeter of the infection never increases as the infection grows. Consider what happens when an uninfected computer is infected by two computers. Two of its sides are absorbed into the infected area, and the other two become part of the perimeter of the infected area. The perimeter loses 2 and gains 2, a net change of 0. We can see this in the mini-grid below. In A, the infected area has a perimeter 8. In B, a new computer is infected, yet the perimeter of the infected area remains 8. Likewise in C, another computer is infected, and the perimeter remains 8.

If an uninfected computer is infected by three computers, three sides are absorbed into the infection, and its fourth side becomes part of the perimeter, a net loss to the perimeter of 2. And if an unifected computer is infected by four computers, the net loss to the perimeter is 4.

So, if the perimeter of nine infected computers is at most 36, and it can never increase, then it can never reach 40, which means the infection cannot spread to all computers. Solved!

You did well on this one two. Here are the results, with Brilliant.org’s results in parentheses again. Top of the class!

  • Yes, always: 21 per cent (16 per cent)
  • Depends on the starting position: 30 per cent (44 per cent)
  • Never: 49 per cent (40 per cent)

The other question was how this puzzle relates to pi. The connection is not obvious, and it is not even mathematical. The Greek letter pi was chosen as the symbol for the circle ratio because it is an abbreviation of periphery, which is basically the same as perimeter. If you were thinking peripherally, about peripheries, you may have got it. (Here’s a great story about the man who invented pi).

I hope you had fun, and see you again in two weeks. Pi Pie!

Thanks to Brilliant.org for today’s puzzles. The virus puzzle was written by its member Ossama Ismail from Alexandria University in Egypt.

I set a puzzle here every two weeks on a Monday. Send me your email if you want me to alert you each time I post a new one.

I’m always on the look-out for great puzzles. If you would like to suggest one, email me.

Photograph: Experiment

My puzzle book Can You Solve My Problems: Ingenious, Perplexing and Totally Satisfying Math and Logic Puzzles is just out in the US. It is already out in the UK with a slightly different subtitle. I’m also the co-author of the children’s book Football School: Where Football Explains The World, which was a runner-up in the Blue Peter Book Awards 2017.

Explore more on these topicsShareReuse this content

ncG1vNJzZmivp6x7tbTEoKyaqpSerq96wqikaKuTnrKvr8RoaWlpZ2S6or6OamponJmZerq71GaqqKSmmnqqwIypoGacka56scHZs6Oeq12ptaLAjLCgpaRdobKiwsRmsKitXaW2pnnEspyd