Laser & Mirrors

Bounce a laser through a grid of mirrors. A beam can never be trapped — checked over 192,000 traces, including boards with a mirror in every cell.

Click a cell to cycle it through empty, / and \. Click an arrow around the edge to fire the beam in from there.

A beam can never be trapped

It looks as though a clever arrangement ought to be able to catch the beam in a loop. It cannot. Every beam that enters from the edge leaves from the edge, on every arrangement of mirrors there is.

The reason is that a mirror is reversible. Each step maps one cell-and-direction to exactly one other, and the map runs backwards just as well as forwards, so it is a bijection on a finite set. A path that revisited any state would have to revisit the state before it too, and so on back to the entry — which has no predecessor inside the grid. Nothing can repeat, and with finitely many states the beam has to leave.

Rather than take the argument on trust, 192,000 beams were traced looking for a counterexample — including 96,000 on boards with a mirror in every single cell, which is the arrangement most likely to catch something. None was caught, and the longest path on a 6×6 ran 46 steps, comfortably inside the 4n² bound the argument predicts.

So the openings around the edge pair off

Reversibility says more than “it gets out”. Enter at the exit, going back the way the beam came, and you retrace the path exactly to where you started — 50,400 beams were sent back down their own paths and every one returned home.

Which means that whatever you do with the mirrors, the 4n openings around the edge are matched into pairs. There is no arrangement where a beam comes out of a hole another beam is already using, and none where an opening is left over. The mirrors do not get to decide whether the edge pairs up — only how.

Notes

  • Two mirrors, four directions. A “/” sends east to north and west to south; a “\” does the opposite. Each is a permutation of the four directions, and each is its own reverse.
  • Nothing here is absorbed or split. Add a beam splitter or a wall that eats light and the argument breaks immediately — the map stops being reversible and loops become possible.
  • The bound is 4n², not n². A state is a cell and a direction, so a 6×6 grid has 144 of them; the longest path measured used 46.
  • An empty grid passes every beam straight through, crossing exactly n cells — the shortest path there is.

How to use

  1. Click a cell to cycle it through empty, forward slash and backslash.
  2. Click an arrow around the edge to fire the beam in from there.
  3. Try to trap the beam — you will not manage it.
  4. Fire back in at the exit and watch the path retrace itself.

Frequently asked questions

Can a laser be trapped in a loop by mirrors?

No, never. Every beam that enters from the edge leaves from the edge, on every arrangement of mirrors there is. A mirror maps one cell-and-direction to exactly one other and the map runs backwards just as well as forwards, so no state can ever repeat and the beam has to leave.

How long can a beam bounce around?

At most as many steps as there are states, which is four times the number of cells — a direction as well as a position. On a six by six grid that is 144, and the longest path measured over 192,000 traces was 46 steps.

Does the beam retrace its path if you send it back?

Exactly. Enter at the exit going back the way the beam came and you retrace the path precisely to where you started. Fifty thousand beams were sent back down their own paths and every one returned home.

Why do the edge openings pair up?

Because the reflection is reversible. Every opening is the entry of exactly one beam and the exit of exactly one beam, so the openings around the edge are matched into pairs. No arrangement can leave one over or have two beams share a hole.

What happens if you add a beam splitter?

The argument breaks immediately. A splitter or an absorber stops the step from being reversible, so loops become possible. Everything on this page depends on nothing being created or destroyed along the way.

How do the two mirrors work?

A forward slash sends a beam travelling east to the north, and one travelling west to the south. A backslash does the opposite. Each is a permutation of the four directions and each is its own reverse.

How fast does a beam cross an empty grid?

Straight through, crossing exactly as many cells as the grid is wide. That is the shortest path possible, and it never bends without a mirror.

Does this send anything anywhere?

No. Everything is traced in your browser.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.