The Dragon Guard Alert
When the DRAGON is visible and the BELL rings, or if the GUARD sees movement, the ALARM must sound. The ALERT sounds only when the DRAGON is visible but the BELL is silent.
Replay this puzzle All puzzles
The truth table
Inputs on the left, outputs on the right. A circuit solves the puzzle when it reproduces every row.
| DRAGON | BELL | GUARD | ALARM | ALERT |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 |
What the table tells you
- ALARM is 1 in 2 of the 8 rows. It does not depend on GUARD at all: flipping it never changes the output, so any gate reading it is wasted. The rows that turn it on: DRAGON=1, BELL=0, GUARD=0; DRAGON=1, BELL=0, GUARD=1.
- ALERT is 1 in 3 of the 8 rows. Every input matters: for each one there is a row where flipping it changes ALERT. The rows that turn it on: DRAGON=1, BELL=0, GUARD=0; DRAGON=1, BELL=0, GUARD=1; DRAGON=1, BELL=1, GUARD=1.
The smallest known circuit: 4 gates
As a formula, one line per output:
ALARM = (DRAGON AND NOT BELL)ALERT = ((DRAGON AND NOT BELL) OR (GUARD AND DRAGON))
As a netlist, in the order you would wire it. Each g is one gate; the last lines say which signal drives each output.
g1 = NOT BELLg2 = DRAGON AND GUARDg3 = DRAGON AND g1g4 = g3 OR g2ALARM = g3ALERT = g4
The search ran out of budget before it could rule out every smaller circuit, so 4 is the best anyone found, not a proof. If you build it in fewer, the leaderboard records it. 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.