Ancient Treasure

The ESPR & PAIR 2023 Admissions puzzle game:

You stumble upon an ancient treasure locked behind a convoluted puzzle mechanism: a rotating box with 4 identically looking buttons on it.

Each button has two states - on and off - but it's impossible to distinguish these states from the outside. You can simultaneously press any number of buttons, but immediately after that the box rotates really fast and you lose track of which button ends up where.

You get the treasure if at any moment all the buttons are off.
Can you guarantee this happening? Explain your reasoning.

Below, you can find an implementation of the game. You can play around with it to understand the mechanism better, and maybe even get the treasure!

The Ancient Treasure

Select some buttons to press

5 +3

Solution

For something to be guaranteed to happen, it means that it has to happen in bounded finite time, even under the worst circumstances. In this case, imagine there was a mind-reading adversary who knew ahead what sequence of buttons are you going to press and was aiming to rotate the box such that you couldn’t unlock the treasure. Could you beat the adversary?