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: nonet.info/fast/PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha
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

Kommentarer 

  1. Tom Scott

    Tom Scott

    År siden

    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

    • undeadgaming

      undeadgaming

      2 dager siden

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

    • allahm-ast3mnly wlatstbdlny

      allahm-ast3mnly wlatstbdlny

      26 dager siden

      Mashallah tbark Allah alhamudillah inshallah better astgfrallah

    • Tomas

      Tomas

      Måned siden

      Bitwarden does the same thing for free

    • absol761

      absol761

      Måned siden

      that video is dumb they will no if they got it if the messenger comes back

    • Olives Of Truth

      Olives Of Truth

      3 måneder siden

      @Azarus . jj

  2. Anoni Mouse

    Anoni Mouse

    4 timer siden

    lmao theres an easy way to solve the two generals problem

  3. Semmyd27

    Semmyd27

    Dag siden

    How do you make the advertisement interestinf?!?!

  4. Jade Smith

    Jade Smith

    2 dager siden

    I work on... Bring it hitch 🤷

  5. undeadgaming

    undeadgaming

    2 dager siden

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

  6. AlloMain 13

    AlloMain 13

    2 dager siden

    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.

  7. Yakov Brod

    Yakov Brod

    3 dager siden

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

  8. Hooos

    Hooos

    3 dager siden

    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

      2 dager siden

      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.

  9. Qaaq

    Qaaq

    3 dager siden

    Smoke signals?

  10. Coenraad van Essen

    Coenraad van Essen

    3 dager siden

    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?

  11. Fenno

    Fenno

    4 dager siden

    Uhhhh... just get siege artillery?

  12. Robert Snook

    Robert Snook

    4 dager siden

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

  13. Punocchio

    Punocchio

    4 dager siden

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

  14. Mac Was

    Mac Was

    4 dager siden

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

  15. BlueG

    BlueG

    5 dager siden

    wave their flag?

    • BlueG

      BlueG

      5 dager siden

      nevrmind

  16. Traffic Light

    Traffic Light

    5 dager siden

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

  17. FCSΩ //FCSectorΩ

    FCSΩ //FCSectorΩ

    6 dager siden

    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

  18. Ruff_man

    Ruff_man

    6 dager siden

    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.

  19. goober

    goober

    6 dager siden

    It was until BTC came along...

  20. Basti5454

    Basti5454

    7 dager siden

    What if they both send messenger and the same time

  21. artm pir

    artm pir

    7 dager siden

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

  22. 十四Ralph

    十四Ralph

    8 dager siden

    So what happened to those that ordered more then once?

  23. Ezekiel Arincorayan

    Ezekiel Arincorayan

    9 dager siden

    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

  24. Sub Bot 1,000

    Sub Bot 1,000

    9 dager siden

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

    • Anders And

      Anders And

      5 dager siden

      Did you even watch the video

  25. scrappylikemetal

    scrappylikemetal

    11 dager siden

    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

      5 dager siden

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

  26. John Price

    John Price

    12 dager siden

    Here, we call it the byzantine general problem

  27. Michael Sherwin

    Michael Sherwin

    15 dager siden

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

  28. Nicholas Cleaves

    Nicholas Cleaves

    15 dager siden

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

  29. Elija Barz

    Elija Barz

    17 dager siden

    What tom does while waiting for his food

  30. Aaron Long

    Aaron Long

    19 dager siden

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

  31. logon235

    logon235

    19 dager siden

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

  32. Diogo Macena

    Diogo Macena

    21 dag siden

    General B should be fired.

  33. Foxy

    Foxy

    21 dag siden

    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)

  34. nanorider426

    nanorider426

    22 dager siden

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

  35. Ali 2JZ

    Ali 2JZ

    23 dager siden

    Ahh yes the old SYN/ACK

  36. moonshiry

    moonshiry

    23 dager siden

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

  37. A.J. Steinman

    A.J. Steinman

    24 dager siden

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

  38. nebulousJames12345

    nebulousJames12345

    24 dager siden

    debounce that sucker.

  39. Mary Gibson

    Mary Gibson

    25 dager siden

    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!"

  40. David Ayliffe

    David Ayliffe

    25 dager siden

    Very interesting. Thanks for taking the time to make this

  41. White Line

    White Line

    25 dager siden

    I have watched this several times before and now I still have no idea what this is gonna be about

  42. C0ma_T0astッ

    C0ma_T0astッ

    25 dager siden

    just send the same messanger both times so if the messanger that a sent doesnt come back with the message they dont fight

  43. P77777777

    P77777777

    25 dager siden

    Option C: Both sides just sit there and let the forces in the castle who are cut off from the outside sit and run out of supplies

  44. Riptide Anomy

    Riptide Anomy

    26 dager siden

    If we’re talking castles, starting a fire can help signal, then it sets as a beacon, it’s up to the other side to do the same, then when both are put out they’re ready to attack

  45. Roger Szmodis

    Roger Szmodis

    26 dager siden

    A few weeks ago a pizza place sent my order twice by mistake. Got a free pizza out of it though

  46. Colleen Forrest

    Colleen Forrest

    26 dager siden

    This video won't age well when quantum computers become a thing :)

  47. Robert Porter

    Robert Porter

    27 dager siden

    The "Example" of two Generals is Flawed! In reality, attacks in actual conflicts have had less coordination that your scenario! Anyone who knows history will get disinterested and not think of a solution ;)

  48. George Stanmore

    George Stanmore

    28 dager siden

    Er that solves the order problem but not the generals

  49. Jakub S.

    Jakub S.

    28 dager siden

    Post pigeons.

  50. David Whittaker

    David Whittaker

    28 dager siden

    The person will be back

  51. Eli Nors

    Eli Nors

    28 dager siden

    Just use a paper airplane and fly it over the castle to deliver the other army.

    • Mr. Hat

      Mr. Hat

      27 dager siden

      the castle could have SAM batteries

  52. Momo

    Momo

    29 dager siden

    I thought this said "the two genitals problem"

  53. Gerandar

    Gerandar

    29 dager siden

    Flags and smokes no need to run a message.

  54. ThomasHaberkorn

    ThomasHaberkorn

    29 dager siden

    a castle would never be in a valley

  55. catoleg

    catoleg

    29 dager siden

    TCP three way handshake is there to solve this problem

  56. no nono

    no nono

    29 dager siden

    You need A to send the message, then B to send an acknowledgement, then A to send one and in the last B needs to send one but this one is different. It doesn't matter if the last one will be received or not as both generals will already have an acknowledgment of receipt of the original message at this point.

  57. Hans and his panzerfaust

    Hans and his panzerfaust

    Måned siden

    What if A sent an acknowledgment saying: if you retrieve this letter give us a signal, like a horn or flag waving after B sent an acknowledgment to A’s message of attack at 8pm? Or just walk around to the other army then attack from one side?

    • Punocchio

      Punocchio

      4 dager siden

      This works in real life, but try to give light signals or a flag signal over the internet. walking to the other side means driving to the pizza place yourself to get your food.

  58. A Rock.

    A Rock.

    Måned siden

    Hello there

  59. Puerto Alto

    Puerto Alto

    Måned siden

    Satoshi Nakamoto enters the chat...

  60. Romaphile

    Romaphile

    Måned siden

    Send a small division (20 soldiers, 4 messengers) because there’s no way they could’ve been killed with that number

  61. John Doe

    John Doe

    Måned siden

    easy solution. One army runs whenever they feel like it, and when the other army sees them running, they also run.

  62. Bene

    Bene

    Måned siden

    Actually by the 6th message (arriving or not) both sides know that both sides know.

  63. ares106

    ares106

    Måned siden

    I thought this was called Byzantine generals problem.

  64. Debbiebabe69

    Debbiebabe69

    Måned siden

    How would the identiwhatsit token work though? Say you order a full pizza, then you get a message that the order has failed. You create a new order, select a pizza, then pay. Since thats a completely new order, wont it have a completely different identitywhatsit token?

  65. Deej Eh

    Deej Eh

    Måned siden

    Once Gen. A acknowledges Gen. B's acknowledgment it's over. Ex: 1-attack 2-attack confirmed 1- attack confirm acknowledged

  66. VALSGARDE gaming

    VALSGARDE gaming

    Måned siden

    Just send two men, one sits in the middle and waits for the other to return while the message to B is delivered. B runner returns saying message aknowledged and they both return to their respective sides. This is still not perfect but by meeting and leaving in the most dangerous area, if they aren't found, then you can assume they have a high likelyhood of having delivered the message.

  67. Bert Ernie

    Bert Ernie

    Måned siden

    Same reason you can’t measure the 2 way speed of light

  68. Bert Ernie

    Bert Ernie

    Måned siden

    This dude just makes interesting videos...

  69. Rational Agent

    Rational Agent

    Måned siden

    Send all the troops of one army to the other as messengers

  70. DEDSEC17

    DEDSEC17

    Måned siden

    Ummm I thought instantly couldn’t you just have a general use a code or a signal using sound that could easily work. e.g. morse code

  71. rojoshow13

    rojoshow13

    Måned siden

    I think I had something similar happen to me at Walmart several years ago when I tried buying a PS4 Pro. I put my debit card in and the cashier said the transaction "timed out", which usually happens when it can't connect online. So I had to swipe my card again. And my bank account ended up being charged for 2 PS4's. Walmart blamed my bank and said it was an error on their end where the money is in "limbo" and it'll be recredited within a few days. And the bank blamed Walmart and told me that it was definitely showing 2 separate transactions for $400. But Walmart couldn't find the 2 transactions in their system. Only the 1 transaction.

  72. Scabeiathax Novastorm

    Scabeiathax Novastorm

    Måned siden

    Which clot built a castle in the valley rather than on the adjacent ridges?

  73. Insertname Here

    Insertname Here

    Måned siden

    Easy!, as army A is red that means its the Brotherhood of Nod, so all you do is build a temple of Nod then nuke the castle! Sorted.

  74. bakunicorn

    bakunicorn

    Måned siden

    who tf builds a castle in a valley?

  75. Professor Haystacks

    Professor Haystacks

    Måned siden

    I haven't checked this, but it seems like the original problem set stakes so high the only rational solution is to not attack at all. Plus side, you'd get fewer wars that way.

  76. Guilherme F. Arantes Souza

    Guilherme F. Arantes Souza

    Måned siden

    Wait, isn't that what TCP is for?! Does TCP use idempotency tokens?

  77. Michael Taylor

    Michael Taylor

    Måned siden

    A simple smoke signal solves this entire delima

  78. IWAG

    IWAG

    Måned siden

    To make sure the other general gets the letter just make them send a smoke signal back to verify, idiots.

  79. Joey Buttafucko

    Joey Buttafucko

    Måned siden

    You are totally wrong about the communication problem. The General B could send up a smoke signal when message was received, just like American Indians did. Dude, learn some history.

  80. Jack Gilcrest

    Jack Gilcrest

    Måned siden

    *stares in byzantine consensus*

  81. Randall Cell

    Randall Cell

    Måned siden

    Tom where did you get the name of this problem? Is it from "Byzantine Generals"?

  82. Andy West

    Andy West

    Måned siden

    Dashlane's all well and good until you forget the master password and lock yourself out of all your data

  83. uhhhscizo

    uhhhscizo

    Måned siden

    Agree beforehand that when you start a fire they both attack and then start a fire

  84. Lloyd Winslow

    Lloyd Winslow

    Måned siden

    "a single human error is never the real cause" citation needed

  85. Cheese Biscuits

    Cheese Biscuits

    Måned siden

    The solution is to talk in person beforehand about the time.

  86. Lordlouckster

    Lordlouckster

    Måned siden

    Dashlane, THE password manager

  87. NS777

    NS777

    Måned siden

    Here’s what you do to solve the problem (in practice): send like 5 people instead of one, vastly increasing your chances of getting one there

  88. Harry Parkin

    Harry Parkin

    Måned siden

    This "fix" can actually work the other way round. When I tried to update my NOnet profile picture, I uploaded one called profile.jpg or whatever, then when I realized one part looked slightly dark when actually on NOnet, I went back and edited it slightly. However, because it still had the same file name, it didn't change it on NOnet when I tried, and I could see that despite me clicking the "upload image" button, it wasn't actually changing anything.

  89. Cookie_flop_K

    Cookie_flop_K

    Måned siden

    What if a general from team A is to send a message to team B saying”we will attack at 8:00. Send a message back.if we do not get your message then we will send this message to you again” if the message from team A does not make it to team B then team B wont send a message back so team A knows something went wrong and so they send the same message again. If team B gets team A,s message but team B,s message doesn’t make it then team A will again send the same message. So no matter what both of them get the message so they both fight at the same time and win.

  90. Mr Mora

    Mr Mora

    Måned siden

    My solution is send a acknowledgment with different contents, a yes or no message. If no message is received resend the question message. Send a response each time a question is sent.

  91. sunalwaysshinesonTVs

    sunalwaysshinesonTVs

    Måned siden

    Ummm... isnt the real logic problem presented here is why in hell did some schmo aristocrat build a castle in a valley?

  92. This statement is false Nothing is true

    This statement is false Nothing is true

    Måned siden

    Why can’t they just make like a big ass sign and then when they see it they make a sign

  93. James Porter

    James Porter

    Måned siden

    Ew. Opening is "I did something not very woke, but I am very woke trust me." Why? What did that add to this video?

  94. Catweasle

    Catweasle

    Måned siden

    Easy. Don't order a pizza by using a f**king app. Ring and speak to a human. Get his / her name and ring back to abuse him / her if there is an issue with the order. It's worked for many many years.

  95. Vincrand

    Vincrand

    Måned siden

    I'm just wondering why the castle is in the valley and not on the hill.

  96. mdavis7298

    mdavis7298

    Måned siden

    I wonder if his use of the word "semaphore" in a computer science video was on purpose. MULTI THREADED PROGRAMMING JOKE?

  97. Peter B

    Peter B

    Måned siden

    Hey I work with things that are possibly life involved... I watch this because Tom Scott is good at entertainment for me

  98. Alexander Finney

    Alexander Finney

    Måned siden

    Have general A give all his men torches through a forced night March to close the gap to the castle but not attack. General B will see the marker and approach. When General A gets to the castle, then send the runners. The force projection will cause the castle scouts to return and the runners will be fine. Siege when both armies are position

  99. Keith Bird

    Keith Bird

    Måned siden

    No one builds a castle in the dip of a valley.

  100. Nathan Lang

    Nathan Lang

    Måned siden

    I have been on the receiving end of two identical orders. Happened on two occasions, actually. But where I work, we usually only get around 3-4 grubhub orders on a given day, so it's very noticeable when the exact same order comes through twice with a 30 minute delay. Unfortunately, we have no way to actually contact the customer if this happens; only the driver can do that. So we have to wait around for the driver to show up, get the driver to contact the customer, greatly wasting everybody's time.

Neste