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: www.dashlane.com/tomscott

MORE BASICS: isboths.info?list...

Written with Sean Elliott SeanMElliott/
Directed by Tomek
Graphics by Mooviemakers www.mooviemakers.co.uk/
Audio mix by Haerther Productions 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 dashlane.com/tomscott

I'm at tomscott.com
on Twitter at tomscott
on Facebook at tomscott
and on Instagram as tomscottgo

Ummæli 

  1. Tom Scott

    Tom Scott

    Ári síðan

    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 www.dashlane.com/tomscott

    • Dominoz 2

      Dominoz 2

      3 dögum síðan

      Similar thing happened just a few minutes ago with Dartmouth Crossing payment and reminded me of this video! The transaction went through but it said it didn’t, although I think that’s more the website was being lazy so just redirected me to the wrong page than a miscommunication such as this!

    • Mahdii

      Mahdii

      5 dögum síðan

      @Lewis hughes I just qqrealised realised what what 3you you you you you you you you do

    • Savage wizardwitch

      Savage wizardwitch

      15 dögum síðan

      @Tom Scott Nice to meet you even if it's not face to face but nearly! If you are not completely sociophobic, will see 😉

    • Savage wizardwitch

      Savage wizardwitch

      15 dögum síðan

      @Tom Scott have you heard what happened in Italy yesterday? Think a Phone company has a kind of this problem, persons where not able to make urgencycalls. Is this the same or is this only for war things, I would but away the word "general" and would take instead "communication". You will not believe haply I am to choose to watch your channel I never thought that anywhere on this planet someone is excisting who ..... This is something I am not able to explain in English but its not that important just a information. See this words I put and will put inside your massage board as notes for me, and don't worry, but think I will anchor here for a while.

    • Savage wizardwitch

      Savage wizardwitch

      15 dögum síðan

      @Tom Scott mhhhh that's very interesting I have never heard about that story

  2. Pyre

    Pyre

    2 klukkustundum síðan

    A knows 8:00. A sends to B. B knows 8:00. B sends to A. A sends to B. If both sides receive two ‘Yes’’s, they attack. Otherwise, don’t.

  3. Danny Phantom

    Danny Phantom

    Degi Síðan síðan

    I would simply make it through the valley every time but I’m different

  4. Hooch 802

    Hooch 802

    3 dögum síðan

    I don't know about computers but why couldn't A go to B and A messenger brings B messenger with him back to the castle thry both leave from there back to their own army's knowing each messenger left the death point safe

  5. Eric Starin

    Eric Starin

    3 dögum síðan

    Start a signal Fire eh

  6. Adam Paganini

    Adam Paganini

    6 dögum síðan

    Thanks for pointing out the labor-abuse issues with app-based delivery companies. It's upsetting just how exploitative these practices are.

  7. fredirecko

    fredirecko

    7 dögum síðan

    Ha, who builds a castle in a valley?

  8. Zulu Foxx

    Zulu Foxx

    7 dögum síðan

    I enjoy your videos & appreciate your efforts!!!

  9. Turtlemaster 326

    Turtlemaster 326

    8 dögum síðan

    I found a solution: both systems send up to 3 signals, if a computer got 2 return signals, it knows 100% that the message got through

  10. Dan Brownell Fuzzy

    Dan Brownell Fuzzy

    9 dögum síðan

    Send the message "attack is set for 6 o'clock. Acknowledge message with smoke and for backup have your men march North 5 minutes. We will watch for this"

  11. Imkrhn

    Imkrhn

    9 dögum síðan

    idempotency

  12. Akhilesh

    Akhilesh

    9 dögum síðan

    A single human error is never the cause? I just witnessed the entire internet going down after someone had weird configurations on Fastly CDN.

  13. Anti Gen

    Anti Gen

    9 dögum síðan

    Keep sending people again and again and by chance two people will meet up, discuss a time and they go back to their general, telling them the time (they meet in the middle so they know if the other died)

  14. Jordan Fire Star

    Jordan Fire Star

    9 dögum síðan

    just send the message and then wave a giant flag as acknowledgment or blow a trumpet

  15. Frederic The great

    Frederic The great

    10 dögum síðan

    Just use smoke signals smh

  16. Aurelia

    Aurelia

    12 dögum síðan

    Just decide a time beforehand and give each general a clock, duh

  17. Jason

    Jason

    12 dögum síðan

    for that two generals problem what about this correct me if what I purpose is wrong or does not make sense or why it does not work General A sends a message time of attack (8pm) General B sends an a confirmation once confirmation has been given to general A the same messenger comes back to his General now both know the time

  18. deckard pt

    deckard pt

    13 dögum síðan

    This is not a problem, armies used the lighting of fires to communicate historically

  19. Thatguyujustmet

    Thatguyujustmet

    15 dögum síðan

    unsolvable my arse, light a fire to show that the dude made it back!

  20. superjare23

    superjare23

    16 dögum síðan

    Crypto literally solves this issue! Invest!

  21. superjare23

    superjare23

    16 dögum síðan

    BTW a little story, This exact thing happens with the Mcdonalds app. gives me free mcdonalds but still exactly this situation

  22. superjare23

    superjare23

    16 dögum síðan

    1 word, BLOCKCHAIN

  23. Entropic Blackhole

    Entropic Blackhole

    17 dögum síðan

    what if, for the two generals problem, Messenger A goes all the way to Army B, and requests to take Messenger B with them to the castle, once they're both at the middle they go to each one's Army, and they can know that the other messenger made it since they can just keep looking back (I know this slightly breaks the rules that Tom put but trust me it works), now assuming they get attacked, Messenger A doesn't make it, B does, so as long as Army A doesn't recieve back from Messenger A they can send another Messenger A, doesn't matter if A didn't make it on the way to B or on the way back, Messenger B will know what happened to A and can report back to Army B for a new messenger can come, so eventually both Messenger A and B meet up at the castle, and can decide an hour/date to attack, both can report back to each army, and if one doesn't come back then that Army can just send another messenger while the other Army knows that they didn't come back so they send another Messenger, both meet up, decide a time, split, and just repeat until both messengers know that the other one wasn't caught, report back to each army, and then attack the tower, that's just my solution, and I know it slightly breaks the proposed rules but it does work

  24. Siffrin

    Siffrin

    17 dögum síðan

    As an Australian im confused as to why a UK food delivery service is called Deliveroo.

  25. Zebsy

    Zebsy

    17 dögum síðan

    So I just watched another video about the two generals problem and idempotency tokens were not mentioned. Hmmmm. Not sure this is the solution.

  26. Gabriel Escobar

    Gabriel Escobar

    18 dögum síðan

    I literally paused the video to try to figure out the problem and gave up after 15 minutes just to find out there’s no solution.......

  27. Horatio yen

    Horatio yen

    18 dögum síðan

    the fact that you explained how dashlane works is nice

  28. Watermelon Enthusiast

    Watermelon Enthusiast

    19 dögum síðan

    So there is a way to fix the two generals problem, send 1 messenger with a code on it and send abunch of messangers back, the idepadency key

  29. Haneesh kenny

    Haneesh kenny

    19 dögum síðan

    What if let's suppose.... *both of them sent a messenger to meet at the valley, maybe let them stay overnight*

  30. Phil Wainwright

    Phil Wainwright

    19 dögum síðan

    2 magic words, but it works. Quantum entanglement.

  31. Neon

    Neon

    22 dögum síðan

    The generals should have just texted eachother smh 🙄

  32. Shafi Azgar

    Shafi Azgar

    22 dögum síðan

    I read this as the two genital's problem.

  33. Loerad

    Loerad

    23 dögum síðan

    Or they could agree on the time before they get to the valley...

  34. Bryan Sullo

    Bryan Sullo

    23 dögum síðan

    Me when I woke up this morning: I know all the words. Tom: Idempotency.

  35. Crimson Knight

    Crimson Knight

    23 dögum síðan

    Oh my, I watched this video a year ago and didn’t think about Tom again, now I’m obsessed with his channel.

  36. juan gonzalez

    juan gonzalez

    23 dögum síðan

    Eh, the acknowledgement of the acknowledgment would be good enough in that situation.

  37. Anton Hartman

    Anton Hartman

    24 dögum síðan

    Couldn't you send a total of three messages, one to give general B a message to convey to have one messager from both sides meet up in the middle and confirm a time and return back to their camps?

    • Gillie Monger

      Gillie Monger

      23 dögum síðan

      @Anton Hartman wait. Are talking about the castle and messenger problem or the real world computer problem it represents?? Because if its the latter you need to watch Tom's video again. If it's the former, unrealistic representation then there are probably dozens of ways to get messages from A to B and back! 🤦

    • Anton Hartman

      Anton Hartman

      23 dögum síðan

      @Gillie Monger it's not impossible, it's risky, how else are they sending messages?

    • Gillie Monger

      Gillie Monger

      23 dögum síðan

      No. Because the 'castle' in this case is in fact impossible to actually get passed from A to B no matter what you try.

  38. Christopher Rose

    Christopher Rose

    26 dögum síðan

    I've noticed dilveroo riders are absolute nutters and a nightmare when you're driving. Kinda presumed it was because of having a crappy contract cos they cycle/ride like they wanna die.

    • Gillie Monger

      Gillie Monger

      23 dögum síðan

      No. They're just in a hurry to get past the castle without getting caught.

  39. REDPANDAT

    REDPANDAT

    26 dögum síðan

    Why did I only understand the video 6 minutes in? 😬😬 I guess my brain is slow

  40. Kieiru

    Kieiru

    27 dögum síðan

    They can see each other. So one of them could just wait and attack when the other one moves.

  41. NeoFortunate

    NeoFortunate

    28 dögum síðan

    Send each person from one general, one by one, to the other?? Risky, but a good idea.

  42. Alden Martin

    Alden Martin

    29 dögum síðan

    Yea

  43. Prozonex

    Prozonex

    Mánuði síðan

    The solution is easy. If the sender comes back, the message has been sent. If the sender does not come back, the message wasn't sent.

    • elektrik2704

      elektrik2704

      28 dögum síðan

      But how does the other general find out without also sending a messenger

  44. Ederexia Mir

    Ederexia Mir

    Mánuði síðan

    General 1 to general 2: start the attack at 3pm sharp and we'll do the same General 2 to general 1: U got it bro . There you go, problem solved.

    • Ninjalectual

      Ninjalectual

      27 dögum síðan

      I mean, no

  45. Caged

    Caged

    Mánuði síðan

    You could have General A go to General B and then together attack the castle.

  46. Iliketoast

    Iliketoast

    Mánuði síðan

    Why not just attack from the same side

  47. DonAntón

    DonAntón

    Mánuði síðan

    Red:Oi lets attack at 8pm, tell me if you received this message. Blue: message received ok, lemme know if u received this message. Red:received, lemme know if u received this message. Blue: received lemme know if u received this message. Red: received, reply Blue:received, no need to reply Red:received. The both received a sent and received a confirmation after sending one, i think this would work

  48. The Law

    The Law

    Mánuði síðan

    What if one messenger from both sides meets up at the castle and go back to their respective generals and confirm what time and that both of them are all right

  49. Xrd Scar

    Xrd Scar

    Mánuði síðan

    I think the two generals analogy could be somewhat broken. Ancient Chinese soldiers sometimes used kites to send messages over long distances, army A sends a letter to them to attack at a certain time, army B sends the acknowledgment back and once they see that the kite has made it to the other side problem is solved. Of course the kite being shot down is a possibility but a small one at that.

  50. Jamey

    Jamey

    Mánuði síðan

    Why not send smoke signals in a code only the two army’s know? The castle won’t know if they’re ordering a pizza or an attack 🤷‍♂️

  51. Thomas

    Thomas

    Mánuði síðan

    Congratulations Captain Kirk. You totally passed the Kobayashi Maru.

  52. Mark Bestwina

    Mark Bestwina

    Mánuði síðan

    You send 1 guy to tell the other general to send someone at at certain time, and since both know what time, they send 2 people and if they both get it they both attack. If they don’t both get through just do it again until it works.

  53. Pandora TheClay

    Pandora TheClay

    Mánuði síðan

    What if you send a messenger and unless the messenger comes back,you don’t attack

  54. alun roberts

    alun roberts

    Mánuði síðan

    I have about 11 passwords non the same also non with correct spellings. I do remember them when I use them from time to time. I do keep some in a text folder on a pen drive when I have to use mixed numbers capital an lower case an a special caricature. My thinking all that extra special stuff will make people keep a copy some were. Back in the mid 90s when it was just words I think was safer.

  55. James Runyon

    James Runyon

    Mánuði síðan

    Proposal for a solution both generals send a messenger who then exchange messages in the middle.

  56. Daniel Jakl

    Daniel Jakl

    Mánuði síðan

    i needed to open chrome so i clicked it.. didn't open .. so i clicked again .. still nothing .. so i spammed the mouse and ended up with 45 chrome tabs opened

  57. Prisec

    Prisec

    Mánuði síðan

    02:10 no that's not how it works, if red receives an answer, no need for a second answer, but if they write it they don't have to worry about it getting through because blue isn't waiting for a confirmation it's already ready to attack

  58. tiyenin

    tiyenin

    Mánuði síðan

    4:48 Old Tom: A single human error is *never* the root cause. 18 or 19 y.o. Tom: *ONOSECOND*

  59. Sarah Russell

    Sarah Russell

    Mánuði síðan

    send the entire army as a messenger thereby combining both armies into one

  60. Marquis

    Marquis

    Mánuði síðan

    I am just about to order food

  61. Dave

    Dave

    Mánuði síðan

    like your videos but thumbs down for this one with the 3 min castle intro, way too long.

  62. Garbage Productions

    Garbage Productions

    Mánuði síðan

    Well, they would know the message got through when the messenger gets back to the generals right?

  63. Anoni Mouse

    Anoni Mouse

    Mánuði síðan

    lmao theres an easy way to solve the two generals problem

  64. Semmyd27

    Semmyd27

    Mánuði síðan

    How do you make the advertisement interestinf?!?!

  65. Jade Smith

    Jade Smith

    Mánuði síðan

    I work on... Bring it hitch 🤷

  66. undeadgaming

    undeadgaming

    Mánuði síðan

    If you or someone you love is suffering from idempotency know that you aren't alone. There are pills for that.

  67. AlloMain 13

    AlloMain 13

    Mánuði síðan

    Well, for the starting problem, if whenever 1 arrived a different one left for the other side, then by the time everyone has changed position , after a waiting period for the final soldiers to arrive then everyone will know both the hour and that the message has been received.

  68. Yakov Brod

    Yakov Brod

    Mánuði síðan

    Easy, they should use Vechain to track their supply and solve their logistics problem.

  69. Hooos

    Hooos

    Mánuði síðan

    can't you just send 2 messangers at the same time who meet in the middle, then turn back? Then they will know that the other messenger didn't die in the middle and they can confirm a time

    • Astfgl

      Astfgl

      Mánuði síðan

      But how will the two generals know at which time to send their messengers? It’s just a different version of what’s still the same problem, you’ve only moved it around a bit.

  70. Commander Cody

    Commander Cody

    Mánuði síðan

    Smoke signals?

  71. Coenraad van Essen

    Coenraad van Essen

    Mánuði síðan

    If you send a message to attack at 8 and the other army returns a confirmation, can't you just leave it there and attack at 8 knowing the other army will be there?

  72. Fenno

    Fenno

    Mánuði síðan

    Uhhhh... just get siege artillery?

  73. Robert Snook

    Robert Snook

    Mánuði síðan

    Send one messenger with the time and a message to light a big fire as acknowledgement (in a real world version of the theory)

  74. Punocchio

    Punocchio

    Mánuði síðan

    These food delivery apps should have a "resend order" functionality

  75. Mac Was

    Mac Was

    Mánuði síðan

    Surely once you've received the acknowledgement acknowledgement acknowledgement, both of you know that each of you are aware of the time to attack.

  76. BlueG

    BlueG

    Mánuði síðan

    wave their flag?

    • BlueG

      BlueG

      Mánuði síðan

      nevrmind

  77. Traffic Light

    Traffic Light

    Mánuði síðan

    It's common sense to check if a payment went through before considering another attempt.

  78. FCSΩ //FCSectorΩ

    FCSΩ //FCSectorΩ

    Mánuði síðan

    Send a guy to the other side and require them to come back. If they do not come back after a reasonable time, send another

  79. Ruff_man

    Ruff_man

    Mánuði síðan

    Generally when things like this happen, I check my pending transactions through my bank (I know the uk bank I used to work with has only within the past few years allowed you to see these). Its a great way to double check, but their are instances where this may not work, I.e. offline transactions.

  80. goober

    goober

    Mánuði síðan

    It was until BTC came along...

  81. Basti

    Basti

    Mánuði síðan

    What if they both send messenger and the same time

    • Basti

      Basti

      Mánuði síðan

      @Xrd Scar I mean one of them can see if other one gets attacked runs back home and tells it the king. They do this so many times till it works. Also I know this doesn't make sense so don't take it seriously

    • Xrd Scar

      Xrd Scar

      Mánuði síðan

      How would they co-ordinate...

  82. Icelife

    Icelife

    Mánuði síðan

    I thought computers were boring and complicated so I still can't believe that I am watching this and also subscribed Awesome video thanks

  83. 十四+1Number

    十四+1Number

    Mánuði síðan

    So what happened to those that ordered more then once?

  84. Ezekiel Arincorayan

    Ezekiel Arincorayan

    Mánuði síðan

    What if both sides sent a messenger at the same time, asked if would do this time, and went back to tell their side and in the middle the messengers find a good time to attack

  85. Sub Bot 1,000

    Sub Bot 1,000

    Mánuði síðan

    Ok with the generals you could possibly maybe have them set off a fire work?

    • Anders And

      Anders And

      Mánuði síðan

      Did you even watch the video

  86. scrappylikemetal

    scrappylikemetal

    Mánuði síðan

    Easy. Just attack. The castle's forces get focused on one side while the other attacking force finds a skeleton crew on the other. They'll know when they start seeing smoke.

    • Anders And

      Anders And

      Mánuði síðan

      Did you even watch the video, this is a computer problem, not real life

  87. John Price

    John Price

    Mánuði síðan

    Here, we call it the byzantine general problem

  88. Michael Sherwin

    Michael Sherwin

    Mánuði síðan

    Should have let the Post Office handle the communications. ....everyone would have been shafted !

  89. Nicholas Cleaves

    Nicholas Cleaves

    Mánuði síðan

    what do you mean not such high stakes. My teammate might not hear my callout in warzone.

  90. Elija Barz

    Elija Barz

    Mánuði síðan

    What tom does while waiting for his food

  91. Aaron Long

    Aaron Long

    Mánuði síðan

    Idk, tom. Sending 800 messengers probably wouldn't send the message to attack **later**

  92. logon235

    logon235

    Mánuði síðan

    Try using this to explain the silliness of the dominion voting allegations. Running the ballot through the machine again will not duplicate the vote.

  93. Toilet Fox

    Toilet Fox

    2 mánuðum síðan

    ok but why doesn't general a send a person to meet general b then go back? (sorry for the bad grammar I'm running on coffee and energy drinks)

  94. nanorider426

    nanorider426

    2 mánuðum síðan

    WeI had this problem in class once - waaay long ago - and Scot is right.

  95. Ali 2JZ

    Ali 2JZ

    2 mánuðum síðan

    Ahh yes the old SYN/ACK

  96. moonshiry

    moonshiry

    2 mánuðum síðan

    i dont get it. isnt this problem solved/worked around by TCP communication?

  97. A.J. Steinman

    A.J. Steinman

    2 mánuðum síðan

    2:55 Is this a "series called The Basics"? I've never seen such a title on these videos.

  98. nebulousJames12345

    nebulousJames12345

    2 mánuðum síðan

    debounce that sucker.

  99. Mary Gibson

    Mary Gibson

    2 mánuðum síðan

    This is the only time I've wanted to use dashlane. Every other sponsor says dashlane "saves" your passwords for you. Or that it "stores them." And my brain always goes "nooooo way!"

  100. David Ayliffe

    David Ayliffe

    2 mánuðum síðan

    Very interesting. Thanks for taking the time to make this

Áfram