The Two Generals’ Problem
Time to tell a story about idempotency, computer science, and the Night of the Multiple Orders. • Sponsored by Dashlane —try 30 days for free at: https://www.dashlane.com/tomscott
MORE BASICS: https://www.youtube.com/playlist?list=PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha
Written with Sean Elliott https://twitter.com/SeanMElliott/
Directed by Tomek
Graphics by Mooviemakers https://www.mooviemakers.co.uk/
Audio mix by Haerther Productions https://haerther.net/
Thanks to Dashlane for sponsoring the video! If you’re techie enough to watch this video, you should be using a password manager. Get a 30-day free trial at https://dashlane.com/tomscott
🟥 MORE FROM TOM: https://www.tomscott.com/
(you can find contact details and social links there too)
📰 WEEKLY NEWSLETTER with good stuff from the rest of the internet: https://www.tomscott.com/newsletter/
❓ LATERAL, free weekly podcast: https://lateralcast.com/ https://youtube.com/lateralcast/
➕ TOM SCOTT PLUS: https://youtube.com/tomscottplus
👥 THE TECHNICAL DIFFICULTIES: https://youtube.com/techdif

@TomScottGo
November 9, 2025 at 7:03 am
Yes, I had help with the graphics for this series. There's no way I'd have animated that myself! On that note, thanks to Dashlane for sponsoring and helping me hire an animator: their free trial link is https://www.dashlane.com/tomscott
@roastedchicken7254
November 9, 2025 at 7:03 am
What if the original messenger returned to their army base? He would be the proof that the other side received.
@buckee_Ac3
November 9, 2025 at 7:03 am
after hearing the two generals problem i came up with my own solution that potentially breaks the rules but it is a messenger sent from A to B talking about setting up a rendezvous point at a specific time general A will send a messenger there to wait for general B's messenger to then relay the message of when the armies will mobalize
@davieduckett
November 9, 2025 at 7:03 am
Seems like a very poorly planned attack on a very poorly planned location to build a castle
@Blitzkit
November 9, 2025 at 7:03 am
My question would be why would you build a fort/castle besides two mountains?
@anonymone453
November 9, 2025 at 7:03 am
If you're on acknowledgement messenger number 7, you can be reasonably sure the attack is going to go ahead. Both parties have agreed to the plan, both parties know the other has agreed to the plan.
@KaiHarizor
November 9, 2025 at 7:03 am
I suppose they could just go home?
@t7s-b6x
November 9, 2025 at 7:03 am
Unique command numbers doesn't resolve the two generals problem. There's a lot more complexity about timing.
@aumoelwal8375
November 9, 2025 at 7:03 am
Moral of the story: don't use computers, cook for yourself
@logosking2848
November 9, 2025 at 7:03 am
2:23 I don't see what the problem is. A tells B. now B knows A sent a message. So B sends one back. Now A knows their message was received. Now A just needs to send a message and get one a response from B. Now A knows that B got the original message, and that B knows that A knows that B got the message, and vice versa
@jonathanarthuritoaldisinag573
November 9, 2025 at 7:03 am
isn't this just a specific case of a more generalized class of problem pertaining the synchronization or orchestration in distributed system??
Each kingdom could be treated as a node and each messenger could be treated as packet going through the network of computer—which also has the same characteristic of semi-deterministic— and there's no single authority which could override the authority or request of other individual kingdom which imply that this is a leaderless system
@jimgray3346
November 9, 2025 at 7:03 am
The correct solution to the Two Generals problem is for General A to go to the market and buy frozen pizza and cook it at home, ya lazy bum
@Anonkontello
November 9, 2025 at 7:03 am
Somehow this guy managed to virtue signal without actually doing the thing he believed in.
@workofao
November 9, 2025 at 7:03 am
Idempotency fixes one part of the problem. Maybe the most essential part, but there is still the part of notifying the user of a successful request.
Anonymous
November 9, 2025 at 7:03 am
a trumpet
@1percentG
November 9, 2025 at 7:03 am
Just light a fire and when the other side lights their fire they both attack.
@ambagoli21
November 9, 2025 at 7:03 am
This is a terrible explanation for a more formal problem actually referred to as “Byzantine Generals’ Problem”
@anpan4318
November 9, 2025 at 7:03 am
Wait I thought it was supposed to be more than 2
@owenboyle722
November 9, 2025 at 7:03 am
You didn't actually solve the two generals problem. Or rather you didn't explain how an idempotency key solve the problem.
@MJHiteshew
November 9, 2025 at 7:03 am
Anyone else missing Tom in 2025? 😢
@larka742
November 9, 2025 at 7:03 am
"a single human error is never the root cause".
Not really true at all. In MOST cases, that is the case.
@JadenAizen
November 9, 2025 at 7:03 am
5 minutes ago? Drew this right as the day started, geez
@JadenAizen
November 9, 2025 at 7:03 am
5 minutes ago? Drew this right as the day started, geez
@jamegumm474
November 9, 2025 at 7:03 am
Shoot a flaming arrow into the air to signal receipt.
@inorbit8666
November 9, 2025 at 7:03 am
Everybody knows that you can't overwhelm a castle if the pizza guy has delayed…
@lordlucan7655
November 9, 2025 at 7:03 am
Since when did a general go anywhere near a battlefield ?
@ewallt
November 9, 2025 at 7:03 am
You could have the two messages meet in the valley, so both could see that the other made it out of the valley without being killed, and report back if the other messenger made it.
@arunsharma1619
November 9, 2025 at 7:03 am
But if the order is different, ( if someone wants to order the same thing again )
@Thundernoob98
November 9, 2025 at 7:03 am
What’s the point of apologizing for using a delivery service because they don’t pay their employees well? If you really cared you wouldn’t use it but you use it when you wanted food so there’s no point in not using it whenver
@Johnnysabboy
November 9, 2025 at 7:03 am
Farout I wish it was September 2018 again although I’d hate to live through Covid again.
@vinokanthvelu2660
November 9, 2025 at 7:03 am
Idempotency doesn’t really solve the two generals problem because there is no solution to it. The delivery apps don’t even have two generals problem. What idempotency solves is the deduplication of actions in a distributed system. Good video anyway!
@fastenedcarrot9570
November 9, 2025 at 7:03 am
6 year old video recommended, oddly relevant to current things that have recently occurred in my life.
@ivandelei3062
November 9, 2025 at 7:03 am
How dare you to argue that there are only two generals 😂
@fullovstars9447
November 9, 2025 at 7:03 am
What a load a rubbish. General A could array his forces for battle. Seeing that General B can array his forces for battle. General A can slowly advance and if General B doesn't advance then he stops – maybe retreating to the start line to make a point? General B should be able to ascertain what General A is waiting for them? To check general B can advance and seeing that General A also advances he can continue the advance watching that general A also advances – then the attack will happen?
@MSGT_Johnson
November 9, 2025 at 7:03 am
Who else is here 6 years later?
@Chewy427
November 9, 2025 at 7:03 am
so in other words, you keep sending messengers until you get one back, and when you stop sending messengers they'll know
@Kael-Bael
November 9, 2025 at 7:03 am
Give synchronized clocks to each general and have a pre-arranged time
@ryanlipe6557
November 9, 2025 at 7:03 am
So the two general problem is a problem with no solution given
@TheReuben101
November 9, 2025 at 7:03 am
So the Solution is: general A keeps sending messengers every 10 minutes proposing a time unless they hear confirmation from general B. Therefore, when B sends a response he can get a confirmation if he hears nothing and not if another messenger comes. The time you wait to confirm is your allowed risk.
@RanchKings
November 9, 2025 at 7:03 am
Smoke signals from the hills?
@LotusTheWise
November 9, 2025 at 7:03 am
2:23 you only need three trips. One from a to b saying "8pm?", the next being "yes, 8pm, please confirm", and the last one "confirmed, 8pm"
@LunaMoon-e9r
November 9, 2025 at 7:03 am
5:55 That wasn't luck, that was smart thinking.
Please stop giving credit to luck that luck doesn't deserve. Luck is getting a big head about this, and math and science are being ignored.
@cemmisali
November 9, 2025 at 7:03 am
Thank you, Tom. This was another informative video and it also made me order some food.
@thekriegsman1743
November 9, 2025 at 7:03 am
Suerly after you get the acknowledgement of the acknowledgement you know whats going on
@davidmacalistair8599
November 9, 2025 at 7:03 am
I just hear IF
Comments are closed.