Lights Out Cube VML Lights Out Cube Home

Solving the Lights Out Cube

How many solutions are there?

The Lights Out Cube has 6 faces each containing 9 buttons, this gives a grand total of 54 buttons. Pressing a button toggles the state of pressed button and the four buttons surrounding the pressed button.

Each button has two states on or off and can be mapped to a bit and the complete Lights Out cube can be modelled by a 54 bit binary number.

Each button press is equivalent to an exclusive or (xor) operation on two numbers. A property of the xor operation is that pressing a button twice is equivalent to executing two xor operations on the cube, which will take you back to where you started.

Another fortunate property of the xor operator is a xor b = b xor a. Thus we conclude the order you press the button in is not important.

To find our solution we need to press between 0 and 54 buttons. This is equivalent to finding a 54 bit number, which is 254 or 18,014,398,509,482,000 solutions.

Brute force (Hall) Method

You can attempt a linear search through solution space. If a reasonably quick computer can test 10,000,000 combinations per second it would take approximately 30 years to find a solution. The brute force method can solve simple if you search through all the 1 button press solution first followed by the 2 button solutions and so on you can solve simple problems.

Bottom up method

A cube has six sides, we shall arbitrarily call one face the bottom. The four adjoining faces to the bottom we shall call the middle section, leaving the one remaining face we shall call the top.

  1. We first choose a series of buttons to press on the bottom face. If the middle light of the bottom face is still lit we reject this choice of buttons and pick another.
  2. We can then clear the each light off the bottom face by pressing one of the first row of middle buttons.
  3. Any lit middle button on the first row can be turned off by pressing a the corresponding button on the second row.
  4. Like wise any lit middle button on the second row can be turned off by pressing a the corresponding button on the third row.
  5. It may be possible to find a combination of buttons that turn off the third row off middle buttons and completely turn off all the lights, this can be done determined. If not choose a different starting series of buttons.
  6. Small complication: When clearing the bottom face corner lights can be switched off 2 ways. So we have to try all the 16 different corner options.
This method involves testing 29 or 512 bottom face button combinations, for each combination of buttons that passes the the middle light test we then have to test 24 or 16 different corner combinations. Thus to find the solution to a problem we will need to test about 4000 odd combinations, well inside in the range of computability.

Web site (c) 2000 Gareth Richards