The Two Generals’ Problem

Commentaires

  1. Tom Scott

    Tom ScottIl y a 24 jours

    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

  2. steve d

    steve dIl y a 13 heures

    Doesn"t mention food delivery company by name, shows headline with delivery company's name...

  3. Andrew F

    Andrew FIl y a jour

    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?

  4. john smith

    john smithIl y a jour

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

  5. ERMAN ATES

    ERMAN ATESIl y a 2 jours

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

  6. John Jennings

    John JenningsIl y a 4 jours

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

  7. lampree

    lampreeIl y a 5 heures

    why did this video get uploaded 3 times??

  8. Robert South

    Robert SouthIl y a 6 heures

    Seems like once both generals have received at least one acknowledgement they can just attack since the time hasn't changed.

  9. 007one

    007oneIl y a 6 heures

    Bitcoin

  10. TheTech9

    TheTech9Il y a 7 heures

    This channel is awsome, and this guy is pleasant voice to listen to. No homo

  11. Carl

    CarlIl y a 9 heures

    Hey dude do you still see dead people? oh nevermind.

  12. Jake Wish

    Jake WishIl y a 10 heures

    What if someone wanted to do the same order for multiple people. A certain restaurant verifies double orders

  13. Stuart Wilson

    Stuart WilsonIl y a 10 heures

    err, Works fine for me... sounds like user error....

  14. Tinka Like AngelOK

    Tinka Like AngelOKIl y a 10 heures

    Justeat 😂

  15. hmmm

    hmmmIl y a 10 heures

    No plussed how this solves the two generals actual problem. Poorly explained.

  16. xirsamoht x

    xirsamoht xIl y a 11 heures

    Speckled Jim & his friends!

  17. Imelda Chandra

    Imelda ChandraIl y a 12 heures

    I wonder what if like this : Gen A sent message (8 pm) to Gen B Gen B reply (ok. 8 pm) to Gen A is it possible?

  18. Imelda Chandra

    Imelda ChandraIl y a 12 heures

    I wonder what if like this : Gen A sent message (8 pm) to Gen B Gen B reply (ok. 8 pm) to Gen A is it possible? or there is another hindrance?

  19. Ailsa Ni

    Ailsa NiIl y a 13 heures

    ally with the other general, and then assume the message got through.

  20. Verne Jules

    Verne JulesIl y a 13 heures

    Tom, I understand that the idempotency token/key can solve the problem of double orders/messages. But how does that solve the Two Generals Problem? Forgive my slow brain.

  21. Ailsa Ni

    Ailsa NiIl y a 13 heures

    So the solution to the two generals problem is to send a third of your army into the dangerous valley, all of them with a message to attack at a certain time with the survivors to

  22. Cullenak47

    Cullenak47Il y a 13 heures

    A sends a messenger to b. If it makes it , b sends both that messenger and a new messenger from b to the castle. Messenger B turns back and messenger A continues to a. B knows if A made it and A knows B made it. Both army’s attack. Solved. I know this wouldn’t work in computers but it is a solution if it were just a puzzle

  23. Daniel Newton

    Daniel NewtonIl y a 16 heures

    Have each army send a messenger when they're ready. When the two messengers meet in the middle (taking precautions to avoid getting spotted), each one goes back to their army and says "we're good to go". If the messengers don't make it back, they will assume that they died so can send another, until the two meet and send a return message.

  24. Kingsly9802

    Kingsly9802Il y a 17 heures

    >If you are in computer science and working on a problem that involves potential loss of life, I really hope you aren't watching a series called "The Basics". But they're fun!

  25. soSAMuk's UK slot channel

    soSAMuk's UK slot channelIl y a 17 heures

    Why do kids toys adverts have to say “batteries not included?”

  26. TheDeathMongrel

    TheDeathMongrelIl y a 18 heures

    2 Generals is an interesting conundrum in and of itself but I think it's a poor paradigm for avoiding the processing of repeated messages. In 2 Generals, no one proceeds without an acknowledgment. It's a Schrodinger's Cat problem. You don't know the answer until 8 p.m. when either everyone is at the castle or is still waiting for another acknowledgment. Applying idempotency (which would be against the "strict" rules) to 2 Generals, still wouldn't solve the problem. It would only affirm that additional messages, if any, are the same (attack at 8 p.m.), and only if the messages actually make it. 2 Generals doesn't guarantee message delivery in either direction, so even with idempotency tokens, Army B may still take no action if they don't get their acknowledgment. With the delivery issue, if the additional messages don't make it, it doesn't matter, the other side will respond appropriately to the original message. In delivery, the return acknowledgment goes far beyond the 2 Generals' (receipt of message), as you can get an erroneous message, a success or failure, and is likely not to have an effect on processing if no acknowledgment is sent. In any case, I think the delivery problem and applications of idempotency tokens as you've described, is its own best explanation of what's going on, not 2 Generals, which idempotency can't be used to solve (again strict rules).

  27. Max Mouse

    Max MouseIl y a 19 heures

    General A sends "8pm" General B sends "8pm ack" - General a doesn't attack unless it receives the ack...

  28. Aaron

    AaronIl y a 19 heures

    General A sends 2 Messengers. Both go to general B to confirm the message was received. Both go to General A but when passing the castle at the exact halfway point one messenger goes back to general b the other goes on to a. They both know the message was received by general b and the acknowledgement got through back to a.

  29. Jasmine

    JasmineIl y a 19 heures

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

  30. 1dgram

    1dgramIl y a 19 heures

    Hey, I'm allowed to watch a series called "The Basics" even if I am working on safety of flight software!

  31. 1dgram

    1dgramIl y a 18 heures

    @Jasmine It's one if those words that are pronounced differently in the UK than in the US. You have the correct American pronunciation.

  32. Jasmine

    JasmineIl y a 19 heures

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

  33. KryskZ09

    KryskZ09Il y a 19 heures

    At the point where he's talking about sending 200 messengers, and I'm thinking of a solution right now, I will see how wrong I am once I finish the video. General A sends a messenger to meet a messenger sent by General B half way to the valley, one with a letter of an estimated time and another of "Hey, here's my letter" The messengers swap messages, both now know that once they leave the 50% point they're free of danger. They make their way back to their sending General with the opposing General's note in hand. Repeat this process once the messenger arrives at their designated outpost, this time with the other General agreeing (or disagreeing) with the time. If they disagree, repeat this process. Now they have the correct schedule and a guarantee that the messenger has arrived. Edit: I guess I was incorrect, although my answer wasn't explored. I would assume that it would cause more margin of error though. I still don't understand the concept of an idempotence key, sure you're ensuring nothing if fulfilled twice, but what if it breaks to begin with? There's no way for the other side to know...

  34. Aline Fernanda

    Aline FernandaIl y a 20 heures

    You are so handsome hehe I like your channel! Greats from Brazil.

  35. shinvergil

    shinvergilIl y a 20 heures

    The example was weak, imo. But good info.

  36. X

    XIl y a 21 heure

    their is an almost guaranteed way to get it to work general A sends a message, general B continues to send a message until general A responses, if another messenger from general B arrives, General A can assume general B didnt receive the message, and send another message, once General As messenger arrived, at which point no more messages from general B will arrive, so they both attack edit: this is under the assumption that the fail rate of messengers is below 100% and their is plenty of time between attacks

  37. Mr. Pinkpig

    Mr. PinkpigIl y a 21 heure

    Wait couldn't one messenger for A and one messenger from B meet in the valley and give each other a set time?

  38. Tulip

    TulipIl y a 22 heures

    So this is how the generals communicate Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation Messenger one: we attacking at 8 General 1:cool let me sound a confirmation Messenger two: i can confirm that we are attacking at 8 General 2: alright, let me send a confirmation

  39. Killer Germ

    Killer GermIl y a 23 heures

    This is a shitty hypothetical, as reasonable suggestions will not be accepted.

  40. Jake Hartman

    Jake HartmanIl y a 23 heures

    pls get patreon and premium memberships and no cemmercials thnx

  41. Z-Statistic

    Z-StatisticIl y a jour

    So the solution to the two generals problem is to send a third of your army into the dangerous valley, all of them with a message to attack at a certain time with the survivors to ally with the other general, and then assume the message got through.

  42. Hater Bart

    Hater BartIl y a jour

    Initially, I completely misread the title.

  43. Eric Tripps

    Eric TrippsIl y a jour

    So the idempotency token solves the double send error but how does it solve the generals problem?

  44. Winston Churchill

    Winston ChurchillIl y a jour

    I know that this video is not about military tactics, but it would be extremely easy, I feel, to coordinate that attack.

  45. Paul Brooks

    Paul BrooksIl y a jour

    Theoretically quantum entanglement, more specifically quantum computing does in fact solve this problem. For reference, research the two slits photon phenomena.

  46. Bill Green

    Bill GreenIl y a jour

    I must be missing something as I see how it stops you getting two pizzas but I don't see how it helps the generals at all.

  47. Paul Nikonowicz

    Paul NikonowiczIl y a jour

    "idempotency". One of the sexiest words in computer science that no one really knows how to pronounce.

  48. Matthew Booth

    Matthew BoothIl y a jour

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

  49. David Alan Gilbert

    David Alan GilbertIl y a jour

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

  50. Arindam Nandi

    Arindam NandiIl y a jour

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

  51. D.N.A Travel

    D.N.A TravelIl y a jour

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

  52. d

    dIl y a jour

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

  53. Crimson Vulpes

    Crimson VulpesIl y a jour

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

  54. Schadenfreude

    SchadenfreudeIl y a jour

    The solution is to use flags as long distance communication

  55. Bloodthirsty

    BloodthirstyIl y a jour

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

  56. Patrick Armstrong

    Patrick ArmstrongIl y a jour

    OMG look at all those IBM PCs!!

  57. Red Jellonian

    Red JellonianIl y a jour

    ...tcp

  58. Anikthias

    AnikthiasIl y a jour

    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.

  59. J G P

    J G PIl y a jour

    google already does for free what dashlane charges for.

  60. Mostwanted

    MostwantedIl y a jour

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

  61. Frank Harr

    Frank HarrIl y a jour

    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.

  62. Frank Harr

    Frank HarrIl y a 23 heures

    True, that's got going to work either. Nothing does. I'm trying to fit this solution into the parable.

  63. HudsonA

    HudsonAIl y a jour

    It's not that B knows A is serious, but B has to know that A got its reply, both sides need to know this. What if B never gets any message and A attacks anyway?

  64. cubeincubes

    cubeincubesIl y a jour

    Huh?

  65. Dominykas Turčinavičius

    Dominykas TurčinavičiusIl y a jour

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

  66. RipleySawzen

    RipleySawzenIl y a jour

    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.

  67. dfasdfasdfasdf

    dfasdfasdfasdfIl y a jour

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

  68. Ricky

    RickyIl y a jour

    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.

  69. a z

    a zIl y a jour

    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

  70. Neodimium

    NeodimiumIl y a jour

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

  71. Wolf Slayer

    Wolf SlayerIl y a jour

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

  72. 4our 20wenty

    4our 20wentyIl y a jour

    The actual same thing happens to me

  73. Louis Wouters

    Louis WoutersIl y a jour

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

  74. Ursula Panzer

    Ursula PanzerIl y a jour

    Just go around the castle and talk to them

  75. Vagabond Wastrel

    Vagabond WastrelIl y a jour

    obviously war drums or bag pipes.

  76. The Sinful Gamer

    The Sinful GamerIl y a jour

    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.

  77. HudsonA

    HudsonAIl y a jour

    The problem is the last message is always crucial, but only one side knows if it got through, and the receiver knows that the sender needs to know that it got through. A sends message 1, and A must find out if that message was sent. So B sends message 2 to A, to confirm the crucial message 1. Because message 2 confirms message 1, message 2 is also crucial. So B needs confirmation on message 2. Thus A sends message 3 to confirm the crucial message 2, but this makes message 3 crucial, so B sends message 4 to confirm it. But if message 3 was crucial, then B has to know that A got its confirmation, which makes message 4 crucial. So A receives message 4, which is crucial, thus it needs confirmation, so they send message 5, which is now crucial because A needs to know if B knows the crucial message 4 was confirmed. Because message 5 is now crucial, B has to send message 6 to let A know B got it, but this makes message 6 crucial. This repeats forever. Both sides know that they need confirmation, but they also know that the tentative time hasn't changed. After 100 messages each asking for confirmation on the same time, it would be safe to attack at that time without confirmation, but a computer would have to be programmed to give it a threshold over which to attack without confirmation.

  78. Matt Kazachinsky

    Matt KazachinskyIl y a jour

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

  79. ano nym

    ano nymIl y a jour

    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.

  80. ano nym

    ano nymIl y a jour

    @Cobalt57 True, saw that I had one to few, but if blue replied again, they would both know! Or am I missing something?

  81. Cobalt57

    Cobalt57Il y a jour

    If the last message from Red doesn't make it, Blue could go on faith, but they'd rather have a guarantee Red is going to attack. And Blue knows that maybe their own message didn't get through, if so then Red won't be sending a reply, and they know Red won't attack alone, thus the problem in the video. You don't know your confirmation got through unless you get a further confirmation back. So no end to the chain, if you're looking for that absolute guarantee.

  82. FateEntity

    FateEntityIl y a jour

    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.

  83. TechByte

    TechByteIl y a jour

    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...

  84. terrorzilla

    terrorzillaIl y a jour

    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.

  85. Famalamadingdong GE/PD

    Famalamadingdong GE/PDIl y a 2 jours

    Suggest recipes for Tom to cook tbh

  86. Mohsen Javaed

    Mohsen JavaedIl y a 2 jours

    Brexit

  87. Cheese Borger

    Cheese BorgerIl y a 2 jours

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

  88. Cheese Borger

    Cheese BorgerIl y a 2 jours

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

  89. Sean Webb

    Sean WebbIl y a 2 jours

    Captain Kirk would have solved the problem.

  90. Paul Anderson

    Paul AndersonIl y a 2 jours

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

  91. shake bake

    shake bakeIl y a 2 jours

    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 🚀🙄

  92. Gold Fishy

    Gold FishyIl y a 2 jours

    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.

  93. SnipahWoolF

    SnipahWoolFIl y a 2 jours

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