The Two Generals’ Problem

7
6.7

Published -

Searching the network...

No amount of messages can ever guarantee two sides know they’re in agreement.

British YouTuber Tom Scott takes on one of computer science’s oldest headaches in “The Two Generals’ Problem,” breaking down why a completely reliable handshake between two parties is, mathematically, impossible to build. It’s not a bug or a bad protocol — it’s baked into the nature of communicating across an unreliable link, and it’s the reason your banking app quietly retries a payment instead of just trusting that it worked.

  • The puzzle traces back to 1975, when E. A. Akkoyunlu, K. Ekanadham, and R. V. Huber first framed it using two gangster groups before Jim Gray popularized the military version in 1978.
  • It was the first communication dilemma ever proved to be mathematically unsolvable.
  • Real infrastructure — TCP handshakes, payment gateways, distributed databases — sidesteps the impossibility with timeouts, retries, and idempotent operations rather than pretending certainty is achievable.

Two Hills, One City, No Guarantees

Scott sets up the classic scenario: two generals camped on hills on opposite sides of a valley, with a heavily defended city sitting between them. Attack together and they win. Attack alone and either army gets wiped out. The only way to reach each other is by sending a messenger through enemy-held territory — and that messenger might get caught.

General A sends word proposing a dawn attack. Simple enough, except General A now has no idea if that messenger made it. So General A can’t move. General B, if the message does arrive, sends back an acknowledgment — but General B has the exact same problem in reverse, with no way to know if that acknowledgment got through.

The Infinite Chain of Confirmations

This is where the thought experiment turns from a puzzle into a proof. Every acknowledgment needs its own acknowledgment, because the party who sent it can’t be sure it wasn’t intercepted. Scott walks through the logic step by step: no matter how many confirmation messages get layered on top of each other, whoever sends the very last one has zero way of knowing whether it arrived or got captured in the valley.

The sender of the final message can never distinguish whether it arrived safely or was captured — deterministic certainty is permanently out of reach.

That’s the crux of it. There’s no clever workaround, no extra round of messages that fixes the problem, because you can always ask “but how do you know that one got through?” one more time. It’s an infinite regress dressed up as a military riddle.

From Gangsters to Generals

The framing with soldiers and hilltops is the version most people know, but Scott traces it to its actual academic roots. Akkoyunlu, Ekanadham, and Huber laid out the same logical trap in 1975 using two gangster factions trying to coordinate, before Gray repackaged it with the military imagery in 1978 that stuck. Either way, it earned its reputation as the first communication problem formally shown to have no deterministic solution — a title that’s held up ever since.

Modern Systems Managing Impossible Constraints

Scott’s real point isn’t ancient history — it’s that this exact unsolvable riddle runs underneath every network connection in use today. A TCP handshake, the process that opens a connection between your device and a server, can’t offer 100% certainty either. Neither can a payment gateway confirming your card was charged, or a distributed database trying to keep copies of the same data in sync across servers.

So engineers stop chasing certainty and manage the risk instead. Systems set timeouts, retry messages that seem to have vanished, and lean on probabilistic confidence rather than mathematical proof. The trickiest part is handling duplicates safely — which is why idempotent operations exist, designed so that if a confirmation gets dropped and the same request fires twice, the outcome stays identical instead of, say, charging a customer’s card two times for one order.

That’s the whole game: nobody solved the Two Generals’ Problem, they just built systems that fail gracefully around it. The next time a payment app shows a spinning wheel a beat too long before confirming your order went through, that’s not bad code — that’s the 1978 gangster-generals math still running the show.

6.7 Total Score

User Rating: 3.13 (16 votes)
Advanced Search Options
Searching the network...
InfoSearched Entertainment — The filter, not the firehose.
Logo