The Two Generals’ Problem


Comments • 1 934

  • Tom Scott
    Tom Scott   3 weeks back

    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

    • Andrew F
      Andrew F  13 hours back

      How is it unsolvable? Wouldn't you just need a maximum of two confirmations sent in order after the original message? If you get at least one confirmation in the correct order after the original message then you know both parties received the original, right? What am I not understanding here?

    • john smith
      john smith  16 hours back

      who would put the castle in the valley but a computer tech

      ERMAN ATES  24 hours back

      It was very well put. Animations were only fabulous. Thanks

    • John Jennings
      John Jennings  3 days back

      Glad to know Dashlane is sponsoring you and you trust them! Been using them for 3 years now

    • Treqqing
      Treqqing  3 days back

      Could you do an episode on the flat earth

  • Matthew Booth
    Matthew Booth  2 hours back

    I've always pronounced this EYE-dem-POE-tent.

    • David Alan Gilbert
      David Alan Gilbert  2 hours back

      Now, can you do one that explains why idempotency is pronounced like that? I've always read it as i-dem-potency

      • Arindam Nandi
        Arindam Nandi  3 hours back

        An interesting follow up would be the Byzantine general's problem - what if there were multiple generals that could back stab each other?

        • D.N.A Travel
          D.N.A Travel  3 hours back

          Just saw at kings cross, sorry didn't say hello, was running late, love the boss

          • d
            d  3 hours back

            I thought the title was “2 genders problem” and I came for the comments

            • Crimson Vulpes
              Crimson Vulpes  3 hours back

              Sun Tzu says "Never attack a fortified position."
              but my answer for the "Two Generals problem" would be...
              "If you received this message, and you wish to join forces, fire a flaming arrow into the air at midnight."

              • Schadenfreude
                Schadenfreude  4 hours back

                The solution is to use flags as long distance communication

                • Bloodthirsty
                  Bloodthirsty  4 hours back

                  How about lighting the biggest fire the blue general has ever seen

                  • Patrick Armstrong
                    Patrick Armstrong  4 hours back

                    OMG look at all those IBM PCs!!

                    • Red Jellonian
                      Red Jellonian  4 hours back


                      • Anikthias
                        Anikthias  5 hours back

                        General A: "General B, I propose to you a plan of attack. Upon receiving this message, send one of your messengers back with mine. At the midway point, yours shall turn around and return to you. An hour after both our messengers have arrived, we will commence the siege; should either messenger not return, the other must also have been spotted and destroyed."

                        Repeat this process until the messenger of General A returns, and begin the siege.

                        • J G P
                          J G P  5 hours back

                          google already does for free what dashlane charges for.

                          • Mostwanted
                            Mostwanted  5 hours back

                            Had this with dominos, same I had the instinct to Not risk paying again..that's just silly

                            • Frank Harr
                              Frank Harr  6 hours back

                              O.K., so A can just keep sending a proposal until one of B's acceptance has been recieved. B assume A is serious and A assumes B is . . . well, nothing. A doesn't have to. Clever.

                              • cubeincubes
                                cubeincubes  7 hours back


                                • Dominykas Turčinavičius

                                  "A single human error is never the root cause"
                                  A single human error: I'm about to end this man's whole career

                                  • RipleySawzen
                                    RipleySawzen  7 hours back

                                    To say this problem is unsolvable is ludicrous. The only way that happens is if the trip is somehow one-way. Otherwise, the sender can just keep sending the request till it gets a confirmation. Computers can do this literally millions of times a second, so probability dictates this eventually WILL happen 100.0000000% of the time. You can make the probability arbitrarily as high as you like.

                                    Now, if there is some significant packet loss going on somewhere, you just display the "Cannot contact server" message and send a few dozen cancellation packets just to be sure.

                                    • dfasdfasdfasdf
                                      dfasdfasdfasdf  7 hours back

                                      A lot of FUD in the intro, when this problem is not affecting people in the real world hardly at all anymore.

                                      • Ricky
                                        Ricky  9 hours back

                                        The great part of this episode of the basics is that it is more like 2 episodes, one about the generals problem, and one about password managers.

                                        • a z
                                          a z  9 hours back

                                          The two general's problem is nonsenical because war is never planned and structured this way. Instead the following applies:
                                          There will be ONE general and TWO commanders each commandeering one army. The general plans and sends messages to the commanders and they execute his/her commands relaying relevant feedback to the general so the general has realtime information on the state of play from the perspective of each commander. Extrapolating, you see this in IT in every large corporate as the admin (or general) sends out messages to each commander (each computer attached to the corporate network) with the computers relaying realtime statuses back to the admin.

                                          By contrast the foodordering problem is one of STRUCTURE and is analogous to the following battle structure. you are the general, you have one army and one commander but the army is fragmented into different specialisms (eg tanks, jet fighters, ground soldiers etc etc ) with each specialism controlled by a lieutenant. The structure SHOULD BE that the general commands the commander and the commander relays to each lieutenant HOWEVER some of the lieutenants are BYPASSING the commander and relaying directly to the general thereby creating INFORMATION-CONFUSION, and this is combined with the fact information lines between the general and the commander have been cut. The general thus doesn't have correct realtime information.

                                          Therefore the solution is that the lieutenants ONLY exchange information with the commander and anytime general-commander information lines are cut the commander issues a "STOP WHAT YOU ARE DOING" command to every lieutenant.

                                          Extrapolating and applying this to the food ordering system, the user (general) is communicating with the app (commander), the app then communicates to each lieutenant (eg food ordering, delivery, payment etc etc) and anytime the information line between user-general and app-commander is cut the app-commander issues a "STOP WHAT YOU ARE DOING" command to every lieutenant

                                          • Neodimium
                                            Neodimium  10 hours back

                                            The solution is send them information in quantum entanglement state. (-;

                                            • Wolf Slayer
                                              Wolf Slayer  10 hours back

                                              even thieves can't avoid a traceable digital fingerprint....just a logical fact.

                                              • 4our 20wenty
                                                4our 20wenty  12 hours back

                                                The actual same thing happens to me

                                                • Louis Wouters
                                                  Louis Wouters  12 hours back

                                                  But they don't know that we know they know!

                                                  • Ursula Panzer
                                                    Ursula Panzer  13 hours back

                                                    Just go around the castle and talk to them

                                                    • Vagabond Wastrel
                                                      Vagabond Wastrel  13 hours back

                                                      obviously war drums or bag pipes.

                                                      • The Sinful Gamer
                                                        The Sinful Gamer  13 hours back

                                                        That problem isn't nearly that difficult. Once A has sent B a message, B sends a message back, confirming they got that message, A then sends a confirmation that they have indeed got the message, if they get a reply to that message, they are all good, considering they both at this point understand at 8pm they would attack, both would attack.

                                                        • Matt Kazachinsky
                                                          Matt Kazachinsky  14 hours back

                                                          Am I the only one that got an ad for that same company?

                                                          • ano nym
                                                            ano nym  17 hours back

                                                            Couldn't the message chain be:
                                                            Red: We attack at 8PM.
                                                            Blue: we both Attack at 8PM, please confirm that this message is recieved.
                                                            Red: Your message is recieved, we will both attack at 8.
                                                            Regardless of if the last message makes it, they will both have the agreement to attack.

                                                            • FateEntity
                                                              FateEntity  19 hours back

                                                              Video IMMEDIATELY jumps into it and I felt lost and confused about what was going on. Maybe have a small few second intro or a preface? Disliked.

                                                              • TechByte
                                                                TechByte  19 hours back

                                                                So how exactly does this fix the two generals problem? There’s still now way for each general to know if his message made it...

                                                                • terrorzilla
                                                                  terrorzilla  19 hours back

                                                                  Had a similar problem ordering pizza in the USA recently. I actually got the order acknowledgement and tracker notice after the pizza arrived. Like you, I suspected it had worked and was right.

                                                                  • Famalamadingdong GE/PD
                                                                    Famalamadingdong GE/PD  20 hours back

                                                                    Suggest recipes for Tom to cook tbh

                                                                    • Mohsen Javaed
                                                                      Mohsen Javaed  20 hours back


                                                                      • Cheese Borger
                                                                        Cheese Borger  21 hours back

                                                                        These comments are excellent, wish I could see them more than once!

                                                                        • Cheese Borger
                                                                          Cheese Borger  21 hours back

                                                                          These comments are excellent, wish I could see them more than once!

                                                                          • Sean Webb
                                                                            Sean Webb  21 hours back

                                                                            Captain Kirk would have solved the problem.

                                                                            • Paul Anderson
                                                                              Paul Anderson  22 hours back

                                                                              Figured it out - the general would turn his entire division, including himself into messengers. Crisis averted, you're welcome.

                                                                              • shake bake
                                                                                shake bake  23 hours back

                                                                                Please do a video that explains to us simple/matrix folk, why we have to enjure annoying adverts that nobody acknowledge's, understands or care's for. Let alone ever buys from? The moon landing or 9/11 makes more sense 🚀🙄

                                                                                • Gold Fishy
                                                                                  Gold Fishy  23 hours back

                                                                                  But his token solution doesn’t actually solve the generals problem presented in the beginning. However, a solution to the generals problem was discovered in 2009. That solution was Bitcoin. Seriously. Google it.

                                                                                  • SnipahWoolF
                                                                                    SnipahWoolF  24 hours back

                                                                                    Wrong! there is a solution for this Problem, it's called quantum entanglement.

                                                                                    • Luny Moon
                                                                                      Luny Moon  1 days back

                                                                                      Couldn't you just have the messengers meet in the middle, shout the time, and then run back quick as they can?

                                                                                      • Dank_Bandit
                                                                                        Dank_Bandit  1 days back

                                                                                        To solve the two generals problem, just tell the other side to raise tall flags before the attack begins to signal that its time. Is there some way that wouldn't work? Both sides of the valley are above the castle so that won't be blocking their view.

                                                                                        • Kronus Exodues
                                                                                          Kronus Exodues  1 days back

                                                                                          okay, what about the solution of brute forcing this?
                                                                                          A sends B a hundred messages that they'll attack at midnight. many of them might get decepted, but a few ought to get through. A then just relies on the brute force being successful, B relies on A relying on it, both attack at midnight and win. and if B gets that message multiple times, that's no tragetdy either.
                                                                                          Is that brute force approach something that get's done in practice?

                                                                                          • GoodISnipr
                                                                                            GoodISnipr  1 days back

                                                                                            Call of Duty is a game of Rock, Paper, Scissors.
                                                                                            Play split screen local.
                                                                                            Choose a loadout. Only 1.
                                                                                            The other player, if they see what you chose, can then choose their loadout to have a very high kill/death ratio.
                                                                                            But, this is why there are 5 custom loadout slots. Use them wisely and then take what you've learned and apply the principles in reality.

                                                                                            • Tevan Pinrut
                                                                                              Tevan Pinrut  1 days back

                                                                                              Power to the deliveroo strikers tho

                                                                                              • StoneyGames
                                                                                                StoneyGames  1 days back

                                                                                                got randomly recommended this video an hour after it came out......... i am now subbed and have been bingeing your videos