The Two Generals’ Problem

  • нийтэлсэн 5 сарын өмнө

    Tom Scott

    Үргэлжлэх хугацаа: 8:26

    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: mnclip.info/playlist/PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha
    Written by Sean M Elliott and Tom Scott
    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

Tom Scott
Tom Scott

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

6 сарын өмнө
Caleb Gonsalves
Caleb Gonsalves

We in India have an option to call the restaurant and the delivery driver so that solves the two generals problem here...

10 өдрийн өмнө
deltor 12
deltor 12

Fire signals to show u received the message. So what can be the fire signal for computers

24 өдрийн өмнө
Артем
Артем

Also if you are a real computer nerd than you surely must know that the weakest point of a system is a human being. So storing all passwords in one place under one probably not complicated master password since you probably will enter quiet often - is the dumbest thing to do!

28 өдрийн өмнө
Clockwork Games
Clockwork Games

Use just eat not deliveroo - its more ethical as well as this event

29 өдрийн өмнө
Ana Paula
Ana Paula

Tom Scott send 10 messengers or more so that the probabilities are in your favor and then attack, it’s likely that at least one will make it, checkmate mate

Сарын өмнө
Jason Sun
Jason Sun

Two messengers meet in the valley, signs a note saying order was received, then comes back with a note with both messengers signature. PROBLEM SOLVED.

3 өдрийн өмнө
TheRassad
TheRassad

What if after signing, GenB's messenger is killed? Then GenB receives no confirmation and wont attack. GenA dies...

Өдрийн өмнө
Rui Pratz
Rui Pratz

Just use smoke signals

5 өдрийн өмнө
St0ner1995
St0ner1995

a possible "solution" to the two generals problem. send 3 messages with an identical identifier (so that it's clear that it is the same message), respond to each individual message with it's own acknowledge, respond to those individual responses with an acknowledge and as long as those are all done at slightly different intervals (say a few milliseconds for the app, or 15 minutes for the problem itself), the chances of all 3 failing are greatly reduced, though not zero

6 өдрийн өмнө
samkachar
samkachar

Not bad videos, but having been a computer engineer for many many years now I can say there are many many times huge issues caused by a single person.

8 өдрийн өмнө
Junior
Junior

I think the solution to it would be that both of the generals know that the only logical thing to do would be to attack immediately right when they pop into existence, since without doing that it would be unsolvable.

8 өдрийн өмнө
jrw
jrw

Why would anyone order food to their home when they can cook a good meal in half the time for 1/10th the cost?

8 өдрийн өмнө
Sdsdfdu
Sdsdfdu

"a single human error is never the root cause" Didn't Cloudflare's servers break all because of one single regular expression?

8 өдрийн өмнө
Chapi
Chapi

Still company's fault for not catching the faulty regex before going into production (code reviews, stress tests, etc)

6 өдрийн өмнө
Stanley Wilcox
Stanley Wilcox

My solution which is dumb but would probably work. When each general thinks they’ve received a lot of acknowledgments, say 7 or 8, they just go.

10 өдрийн өмнө
tristan 123455
tristan 123455

Why did I read the title as genitals lmao...

10 өдрийн өмнө
Thomas Birtles
Thomas Birtles

I’d just send a messenger to the other general, and tell him to send a messenger at a specific time to confirm the time to attack, then both parties would send a messenger.

10 өдрийн өмнө
007 Dragon
007 Dragon

I'm not sure if I understand you correctly, but how would General B sending a messenger at a time specified by General A help? When the messenger sent by General B arrives on time exactly as General A expected, General B still wouldn't know if the messenger got through. This is a problem because at this moment, General B does not know whether General A knows that General B knows what time to attack. IF General A does not know that General B knows what time to attack, General A will not attack at the planned time. P.s. it also does not help to send both messengers at the same time, as one of them will not have any new useful information to pass on / transmit. Sorry if this was confusing, feel free to clarify your idea if I misunderstood it:)

9 өдрийн өмнө
Jason Gilliland
Jason Gilliland

The real problem is that you need at least 5 more armies or you'll never conquer Byzantium!

11 өдрийн өмнө
Ewan Biesinger
Ewan Biesinger

What if they need the messenger to come back so they know that the message has received

12 өдрийн өмнө
Anirudh Panguluri
Anirudh Panguluri

Says certain delivery app in beginning just a couple seconds later shows news articles accusing deliveroo of unethical practices.

13 өдрийн өмнө
Nate Youmans
Nate Youmans

Could army A send two messengers over then at the halfway point, one of them turn back to give army A the all-clear, while the other messenger delivers the message?

13 өдрийн өмнө
Desu Vult
Desu Vult

A. Send a message announcing a time of attack and ask for them to send a messenger back as proof B. Sends a message back saying that they've read the message A. Send a message announcing that the decision is final and to send a messenger back as proof, but this time without expecting a response. If you get a message back, then you just attack at the determined time A and B are the 2 generals

13 өдрийн өмнө
Kuriii
Kuriii

Just send three, if one makes it, the B sends another back, if that one makes it the other sends one back. Then they know they both recieved it and the time is right.

14 өдрийн өмнө
Vikrant Panday
Vikrant Panday

Well I mean if you have three acknowledgements I think it's fair to assume the other got the message. If A send B a message then A wont know B got the message but if they did and sent an acknowledgment back then A got the message but B doesn't know that. So now both A and B know to go at 8 since As the one that made the message and also received an acknowledgment and B got the message and sent it back but even if they didn't know A got it, A still was the one that made the time so they'd go anyway. Just to be safe, A can send another acknowledgment and if B gets it, they'll know both sides are going to go at 8.

15 өдрийн өмнө
Yoovie
Yoovie

Mans looks like the hobbit

16 өдрийн өмнө
ChokeNation
ChokeNation

what about quantum entaglement? uwu

16 өдрийн өмнө
Angus Campbell
Angus Campbell

Smoke. Done.

17 өдрийн өмнө
nikoladd
nikoladd

Here's a computer science suggestion: Use transactional promise driven model and thus make your confirmations explicit. In the same way actual payments work.(i.e. reserve and confirm) While the theoretical problem has no guaranteed solution the practical problem does have reasonably guaranteed solutions and that app was poorly designed.

17 өдрийн өмнө
Viking Ninja
Viking Ninja

That example doesn't seem to work because they would just need A to tell B 8pm, B acknowledges, then A acknowledges. Both armys know the other knows to attack at 8pm.

17 өдрийн өмнө
Michael Betts
Michael Betts

What if A's acknowledgement never gets to B. B doesn't attack because it wasn't acknowledged, and A attacks because it was acknowledged. The problem is not knowing the time. It is that there is no way for both parties to be 100% certain that the other party is certain, and will attack. One "solution" (stuff like TCP) is A sends B an initial message repeatedly until it receives an acknowledgement, and B then starts sending acknowledgements to A, until A's response is received. Every time A receives a return message from B it responds that it received the acknowledgement. B knows that the chain is over with the final message, and A knows that it is over when it stops receiving acknowledgements from B, but this could also happen if every acknowledgement messenger from B was killed. In the real world it is unlikely that every messenger from B would be "killed" via some random chance and not some detectable error in the connection, but it could happen if something like a microwave being turned on interferes with a wireless connection, and A is programmes to think it can close the communication after 5 seconds without a response, and other traffic is still getting through.

15 өдрийн өмнө
Konstantin Führ
Konstantin Führ

I actually came up with a better solution : Dont attack and dont make war at all :D.

17 өдрийн өмнө
Wreck-It Rolfe
Wreck-It Rolfe

Imagine paying again after it's said you've already paid.

17 өдрийн өмнө
T C
T C

dont show up with two armies, there done.

18 өдрийн өмнө
Luner Link
Luner Link

just send 1 person from each general at the same time

18 өдрийн өмнө
Δημήτρης Ντάβος
Δημήτρης Ντάβος

what if they walk to the castle? the other side will see them and walk aswell

18 өдрийн өмнө
X.Illuminati.XGamer Productions
X.Illuminati.XGamer Productions

Possible solution to the Two General Problem. One general sends two messengers to the other general. One messenger stays back before it passes the castle, and the other messenger passes the castle. The messenger that stayed back will watch the other messenger pass the castle, and will be able to tell if the messenger passing the castle has been killed or has safely passed the castle. The messenger that passed the castle would have a time for the generals to attack. The messenger that watched would report back to the general who had sent the two.

18 өдрийн өмнө
WalrusWarlord
WalrusWarlord

Have both go at the same time, and meet in the center, thus letting them both confirm a time, and success

19 өдрийн өмнө
Michael Betts
Michael Betts

And then one gets killed walking back and the other doesn't see it. Also that isn't solving the two generals problem, because it's a computer science problem, and so there is no middle, the castle represents anytuing with a non 100% success rate, like a wireless connection between two computers, that could be broken temporarily by noise from something else, like a microwave for example.

15 өдрийн өмнө
Like a Bossk 627
Like a Bossk 627

Can we get an f for our fallen messengers

19 өдрийн өмнө
D Parker
D Parker

I was working at a burger restaurant at the time that this issue was happening. 7 drivers arrived with the request for the same meal. You were smart for recognizing this issue initially and ordering one order

19 өдрийн өмнө
Catriona
Catriona

Best solution: Ignore the generals and go to the local pub for some food. :P

19 өдрийн өмнө
Combine Echo
Combine Echo

Morse code via smoke

19 өдрийн өмнө
Jesus From Hyrule
Jesus From Hyrule

I what if u send someone with one person behind and another behind them etc. so that when one gets confirmation they can give the army info right before the others get to The Valley ? I can’t quite explain

20 өдрийн өмнө
Konstantin Führ
Konstantin Führ

Solution for the problem is : arrange a certain time /sun stand ( other certain events that are global and recognizable to both armies ) and trust ;).

20 өдрийн өмнө
Wood Kidneys
Wood Kidneys

Realistically, couldn’t the other general just fire off a cannon or two in acknowledgement to the letter? I understand I am ignoring the computer science portion of this, but I came here for generals and armies and I will leave on those terms.

20 өдрийн өмнө
InfinityBoss
InfinityBoss

Possible solution: One general could send a letter saying what time to attack. It would also say to shoot a flaming arrow in the air if they got the message and if they agree. If one general sees the arrow then the other would also shoot an arrow signaling that they both agree to attack at a specific time.

20 өдрийн өмнө
OneObjective
OneObjective

The problem operates under the assumption that the two armies cannot actually see eachother

17 өдрийн өмнө
Random Ashe
Random Ashe

Surely after 300 messengers confirming it, I don't REALLY need to confirm the 301st.

20 өдрийн өмнө
William Klueg
William Klueg

The two generals problem might be solved by sending a letter every day for a thousand days that says "Once every day for the next one thousand days (more or less depending on how arbitrarily difficult the valley is to pass) send a letter in confirmation of this letter. Mark down instances of letters getting through in your correspondence. On a specific date (at least 1,000 days in the future) we will attack, pending your confirmation." If it is reasonably possible for a letter to get through the dangerous valley this will work. If it is not then no coordinated attack is possible and no attack will take place.

20 өдрийн өмнө
Kyle
Kyle

I was like signal fires

21 өдрийн өмнө
E030E03
E030E03

Using flags in the general problem is badically using quantum entanglement

21 өдрийн өмнө
Ay lmoa
Ay lmoa

...There is castle in the middle of the valley... *Sun Tzu left the group*

21 өдрийн өмнө
canis pugnator
canis pugnator

Could the general write we will attack at 12pm light a fire If you received it or we will not attack

21 өдрийн өмнө
Red Ace
Red Ace

Clicked this video genuinely thinking this was a hypothetical war paradoxical scenario, like if The Metatron and Vsauce2 collaborated or something. It's apparently not. I can't say I disliked it.

21 өдрийн өмнө
roftar
roftar

Didn't they create war horn for that exact purpose?

21 өдрийн өмнө
Tobey
Tobey

What if I actually wanted to order the same thing twice in a short ammount of time?

21 өдрийн өмнө
azurephantom100
azurephantom100

my phone's messenger app is bugged where it will receive the same text message from someone over and over again. i didnt know about the two generals problem till now. though i figured out that is what was happening my phone. it was getting the message but the "i got it" signal wasnt going through so the other person's phone kept sending the message it didnt show for them but i would get the same text more then 20 times within a few seconds

22 өдрийн өмнө
MadHatters7120
MadHatters7120

I thought this would be a historical/military themed video judging by the title and the thumbnail.

22 өдрийн өмнө
Michael van Panhuys
Michael van Panhuys

but the armies have the high ground, shouldn't they easily be able to win?

22 өдрийн өмнө
Jblockminer MC
Jblockminer MC

The solution to the problem of the two generals is simple, just have one army advance very slowly so the other army can easily see it’s going to attack and join the fight in time.

22 өдрийн өмнө
catman 15
catman 15

wht dont the generals just send a menssager in a route that doesnt pass right in the place they are trying to counquer

22 өдрийн өмнө
TheDeadlypanda 12
TheDeadlypanda 12

Why doesn't the messanger return?

22 өдрийн өмнө
Sezlych yeeyee
Sezlych yeeyee

wait just send multiple messengers with the same thing

23 өдрийн өмнө
Leonardo Brito
Leonardo Brito

But and if an army 1 send a messenger to army 2, then back to the middle of the valley with a messenger of army 2, then the two messegers go to oposite sides with the 8PM proposed time? Both messengers knew the other were not killed, because they left the middle spot seeing the other, and if both were attacked and die any army will attack, because they dont recieve the time of attack, so its just send another messenger and repeat until the messengers dont die...

23 өдрийн өмнө
Brian Roden
Brian Roden

You only need to stop at 5

23 өдрийн өмнө
Snoop Dogg
Snoop Dogg

Why not just use smoke signals?

23 өдрийн өмнө
Derek Whittom
Derek Whittom

I like this. Got into an argument with a coworker once about a similar situation, where the logic had thought there was a failure, but there wasn't.

23 өдрийн өмнө
King Le
King Le

Speaking about protecting your information from hackers and glitches I’d like to talk about today’s sponsor Nord VPN.... what’s that? Today’s sponsor is dashlane?

23 өдрийн өмнө
Miles Mitchell
Miles Mitchell

It's like when you go to print, nothing prints, hit it again, and repeat. Printer needs paper...boom 50 sheets

23 өдрийн өмнө

Дараах

There is No Algorithm for Truth - with Tom Scott

59:35

There is No Algorithm for Truth - with Tom Scott

The Royal Institution

Үзсэн тоо 543

I'm Not A Robot ✅

7:40

I'm Not A Robot ✅

Tom Scott

Үзсэн тоо 1

This Video Is Sponsored By ███ VPN

7:26

This Video Is Sponsored By ███ VPN

Tom Scott

Үзсэн тоо 1

Why Snow and Confetti Ruin YouTube Video Quality

4:20

Why You Can't Trust Me

9:38

Why You Can't Trust Me

Tom Scott

Үзсэн тоо 1

Why Computers Can't Count Sometimes

8:44

Why Computers Can't Count Sometimes

Tom Scott

Үзсэн тоо 1

How Auto-Tune Works

2:41

How Auto-Tune Works

Tom Scott

Үзсэн тоо 822

Will YouTube Ever Run Out Of Video IDs?

5:10

Will YouTube Ever Run Out Of Video IDs?

Tom Scott

Үзсэн тоо 3

The Image That Can Break Your Brain

1:43

The Image That Can Break Your Brain

Tom Scott

Үзсэн тоо 4

How Neurosurgeons Navigate Inside The Brain

7:18

How Neurosurgeons Navigate Inside The Brain

Tom Scott

Үзсэн тоо 363

The Language Sounds That Could Exist, But Don't

6:31

Why 1/1/1970 Bricks Your iPhone

5:00

Why 1/1/1970 Bricks Your iPhone

Tom Scott

Үзсэн тоо 4

I Can't Show You How Pink This Pink Is

3:52

I Can't Show You How Pink This Pink Is

Tom Scott

Үзсэн тоо 5