Will this maths puzzle give you a lightbulb moment?

12 Sep 2016

What would you do for a million euro? Would you agree to a test of mental endurance? One of logic and maths?

Wandering along the street one day, you’re approached by someone from a national radio station.

“Interested in playing our game to be in with a chance of winning €1m?” they ask.

Future Human

Naturally intrigued, you ask for more information.

“We have €1m to give to the person who can solve a Saw-style puzzle (though obviously without the psychological and physical torture). We will blindfold you and bring you to a mystery location, where we will leave you. To escape from that location, you must either solve the puzzle – earning yourself €1m – or tell us you give up,” they say.

It seems like there’s nothing to lose, so you agree. They blindfold you, bring you to a building nearby and then leave, telling you not to take off the blindfold until you hear the gong.

After some time, the gong sounds and you remove your blindfold.

You find yourself in a building with no visible exterior windows or doors, just a series of adjoining rooms.

Slightly disoriented, you stumble from room to room until you notice something: the rooms are laid out in a perfect square. 16 rooms in a four-by-four grid.

Then you notice something else. There is a single lightbulb in every room. Some of them are on, but most are off. Wondering why that’s the case, you decide to explore every room, looking for clues.

In one, you spot on the floor a piece of paper. Picking it up, you read:

Welcome to Lights Out! You are now trapped on the playing field. The only way to escape is to turn off the lightbulbs in every room in the building.

In this room, you will find two panels. One houses a series of switches. There is a corresponding switch for every three consecutive lightbulbs in a row or column of rooms.

Throwing a switch will simultaneously operate all the bulbs attached to it, turning off those that are on, and turning on those that are off.

The other panel features a single button. This changes which lightbulbs are lit when you begin. Pushing the button shifts between the two options available.

One starting point has the lightbulbs in the four corner rooms lit. The other has the lightbulbs lit in the eight rooms that make up the two diagonals.

Using one of these starting points will leave you facing an impossible task, and you will be trapped forever*. The other will allow you to escape, and win you €1m.

You may push the single button as many times as you want in your effort to choose between the two starting points, but once you start using the switches, you cannot change your mind and begin again.

*We can’t trap you forever, but you definitely won’t win any money.

So, in order to turn all of the lightbulbs off and escape, should you choose to start with the corners or the diagonals lit?

Once you’ve made your choice, which switches will you throw – and in what order – to turn all of the lightbulbs off?

And why is there no way to escape if you use the other starting point?

Scroll down for the solution to this week’s puzzle.

This week’s maths puzzle comes courtesy of Dr Anca Mustata, lecturer in mathematics at University College Cork (UCC), who is actively involved in the Maths Circles initiative, the Mathematics Enrichment programme in UCC and the Irish Mathematical Olympiad.

Maths: lightbulbs

Image via Shutterstock


You should start with the corners lit.


Work through it visually. The building has a square floorplan, with 16 rooms laid out in a grid pattern. Use 1 to denote lightbulbs that are on, and 0 to denote lightbulbs that are off.

Therefore, starting with the corners lit, we have a grid that looks like this:

Maths: corners lit

Switch the first three lightbulbs on the first and last columns, leaving us with:

Maths solution: after first switch

Now, switch the last three lightbulbs on the first and last columns.

Maths solution: all lights off

All the lights are off, and you’re €1m richer. Congratulations!

But why would the other starting point not have worked?

To prove this, colour the table in a blue-red-green pattern starting from the bottom-left corner, as per the below.

Maths solution: diagonals lit

Let B denote the number of 1s coloured blue, G the number of 1s coloured green, and R the number of 1s coloured red.

Initially, B=6, G=1 and R=1.

Each switch will simultaneously alter a square coloured red, another coloured green and another coloured blue. Thus, the sum B+G either stays the same (for example, if a blue bulb is turned off while a green bulb is turned on), changes by +2 (if a green and a blue bulb are turned on) or changes by -2 (if a green and a blue bulb are turned off).

B+G=7 to start. Regardless of how many switches are thrown, B+G can only be 1, 3, 5, 7, 9 or 11. In other words, it will always stay an odd number.

For all of the lights to be turned off, B+G has to be 0. There is no combination of switch flips that will satisfy that.

Therefore, there is no possible escape.

Updated, 9.27am, 12 September 2016: This article was updated for clarity. 

Lightbulbs image via Shutterstock

Kirsty Tobin was careers editor at Silicon Republic