The Tram Line Switch
Adjust the SWITCH and TRACK to control the SIGNAL. The SIGNAL must activate only if either the SWITCH is on while the TRACK is off, or both are on and a third sensor is off.
Replay this puzzle All puzzles
The truth table
Inputs on the left, the output on the right. A circuit solves the puzzle when it reproduces every row.
| SWITCH | TRACK | SENSOR | SIGNAL |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
What the table tells you
- SIGNAL is 1 in 3 of the 8 rows. Every input matters: for each one there is a row where flipping it changes SIGNAL. The rows that turn it on: SWITCH=1, TRACK=0, SENSOR=0; SWITCH=1, TRACK=0, SENSOR=1; SWITCH=1, TRACK=1, SENSOR=0.
The smallest known circuit: 3 gates
As a formula, one line per output:
SIGNAL = ((SWITCH AND NOT TRACK) OR ((SWITCH AND TRACK) AND NOT SENSOR))
As a netlist, in the order you would wire it. Each g is one gate; the last line says which signal drives the output.
g1 = TRACK NAND SENSORg2 = SWITCH NAND g1g3 = g2 NAND g2SIGNAL = g3
The search checked every circuit with fewer gates and none matches the table, so 3 is the true minimum for the allowed gate set. Gates that do not feed an output are never counted.
Leaderboard for the day
Nobody posted a result on the day. The circuit above is the reference.