Prisoner Hat PUZZLE || 10 Prisoners || RED & BLUE Hats

Поделиться
HTML-код
  • Опубликовано: 9 янв 2017
  • A jailer lines up 10 prisoners facing one direction in the increasing height order and randomly places either red hat or blue hat on each prisoner's head. A prisoner can see the color of hats of the prisoners in front of him, but not his own or of the prisoners behind him.
    Starting from the last prisoner in the line, the jailer is going to ask the prisoner the color of his own hat.
    For correct answer, he will be saved, else he will be executed.
    The Same Procedure will be repeated for all the prisoners.
    The jailer announces that, if at least 9 prisoners answer their own hat color correctly, all of them will be released.
    Before being lined up, the prisoners are allowed to discuss a strategy, to develop a plan for their survival.
    PUZZLE : What would be their strategy to make sure that all of the them survive.
    The video explains the Puzzle's solution and the Logic behind.
    Please comment below your answers and suggestions. Also LIKE the video and SUBSCRIBE to my channel if you are new.

Комментарии • 382

  • @kratos952
    @kratos952 5 лет назад +451

    IIT graduated prisoners

    • @warfyaa6143
      @warfyaa6143 5 лет назад +1

      LOOL

    • @qqq1234x
      @qqq1234x 4 года назад

      LooooL i was thinking he same. XD

    • @ritvikkaran967
      @ritvikkaran967 4 года назад +1

      and another iit graduated find a loophole in metro
      ruclips.net/video/DCo8o4q_GNA/видео.html

    • @Rizwan1875
      @Rizwan1875 3 года назад +1

      Hahaha 🤣

    • @yourdad5471
      @yourdad5471 3 года назад

      Underrated bro🤣🤣🤣

  • @sriramsubramanian1291
    @sriramsubramanian1291 6 лет назад +200

    Great! I never thought about this logic. I was thinking the prisoner can see through the policeman's specs mirror and answer the color. Lol.

  • @Raj-hm6qi
    @Raj-hm6qi 5 лет назад +78

    We can solve this pblm like below also:
    1. Last prisoner know the color of his front prisoner. So he loudly says either Red or blue.. If it is loudly said then same color his front prisoner also wearing.. that's the hint here..
    2. Next prisoner know his hat color from previous prisoner based on whether previous prisoner said his hat color loudly or not.. Now he know the hat color of his front prisoner.. if his hat color and his front prisoner hat color are same then he will say his hat color loudly otherwise he will say his hat color no loudly.. by this way next prisoner will understood his hat color..
    3. The same logic follows
    Only the first prisoner don't know his own hat color so he will loudly say his front prisoner hat color always..

    • @Sab_Moh_Maya_Hal
      @Sab_Moh_Maya_Hal 5 лет назад +2

      great man

    • @shreyanray7624
      @shreyanray7624 4 года назад +1

      Good one

    • @sunilsigar3145
      @sunilsigar3145 4 года назад +1

      Better one

    • @bosskiang4238
      @bosskiang4238 4 года назад +10

      Nope, your method would require the passing of more than 1 bit of information (red/blue).It is mentioned in the video that hints such as melodies are not allowed, you are strictly allowed to solely answer either red/blue. I answered the same way as you did in Parallel Computation class this morning and got corrected.

    • @nassymcnute
      @nassymcnute 4 года назад +1

      I know one thing
      that's not right

  • @ppmnox
    @ppmnox 2 года назад +8

    I found the solution not only logical, but also compelling in the sense that I wondered if odd/even would play into the solution.

  • @brianaresendes966
    @brianaresendes966 4 года назад +15

    I was really hoping the guard was wearing sunglasses/glasses and they could use their reflections, but this is cool too.

    • @mayukh_
      @mayukh_ 3 года назад +1

      I hate this kind of answers.. If you guys are not serious, then don't answer.

  • @nileshmittal9971
    @nileshmittal9971 6 лет назад +85

    I'm sad, no prisoners should be released like this... 😂

  • @merlinsheeba244
    @merlinsheeba244 7 лет назад +7

    Mind blowing logic. Thanks for clear explaination.

    • @LOGICALLYYOURS
      @LOGICALLYYOURS  7 лет назад +2

      Thanks Sheeba for the appreciation. I hope you'd like other puzzles too :)

  • @tonir299
    @tonir299 5 месяцев назад +1

    1. Simple solution
    During discussing the strategy prisoner 10 can tell everybody the color of his hat.
    2. If 1. is not allowed (and even talking is not allowed at all)
    Prisoner 10 can form 2 groups of prisoners with the same color. Every prisoner can see if he is in the same group as the prisoner standing in front of him. So he knows his color. Prisoner 1 says the color as his group members.

  • @cool-aquarian
    @cool-aquarian 3 года назад +13

    I’m just glad that I am attempting this puzzle sitting at home and not one of those prisoners.
    Solution idea is good, but implementation is 10x difficult. One moron prisoner in the line, and everyone in front of him is doomed.

    • @touristtam
      @touristtam 2 года назад

      think nodes and throwing a pool if the nodes cannot verify themselves. Not actual prisoners.

    • @sorsocksfake
      @sorsocksfake Год назад

      Yes. This eventually led to the Goldenrock massacre in 2098 CE, where a foolish prisoner caused the Overlord to go to war with and exterminate Mexico. The world recoiled in horror, and henceforth, only logical mathematicians would be sent to jail.
      The subsequent shortage of logicians and mathematicians caused the re-election of Donald Trump, but fortunately he had calmed down a lot, having died 73 years prior, and he became such a good president that he has been re-elected ever since.
      #funfacts

  • @hypercubemaster2729
    @hypercubemaster2729 4 года назад +4

    I got it after leaving it alone for a day, lol. Very awesome line of logic and puzzle! Subscribed!

  • @maxkashyap3810
    @maxkashyap3810 2 года назад

    Awesome Problem. Upon this logic I sat down to program this approach. Really fascinated.

  • @komalagarwal9830
    @komalagarwal9830 6 лет назад +2

    Superb puzzle...n superb srategy...out of box situation.. awesome

  • @jackpigeon2263
    @jackpigeon2263 2 года назад

    Wonderful logic Amar ji. Keep rocking with questions like this.

  • @TheDeepakkandpal
    @TheDeepakkandpal 4 года назад +13

    Calculations can save you from being hanged 😂 ~ hence proved - be with mathematics

  • @mdmubashir743
    @mdmubashir743 7 лет назад +6

    amazing dude.....too good..

  • @hyperfairy7779
    @hyperfairy7779 7 лет назад +53

    do they get to keep the hats?

  • @swedishpsychopath8795
    @swedishpsychopath8795 7 месяцев назад +1

    Stupid puzzle: MY strategy would be: The last person tells the color the person in front of him has. The second to last will hear what color HE has and repeat his color. BUT: If he sees the next person has the same color then he will say the color name quickly. If the hext person has a different color then he will say his own color slowly. Every person will then know what color they have. Or they could have different intonation of the words. Starting high and going down for same color, and from low to high for different color.

  • @alabamaal225
    @alabamaal225 2 года назад +8

    The puzzle initially stated that the red/blue hats were placed randomly on the ten prisoners. However, it did not state that there were five red hats and five blue hats. (Indeed, the first illustration showed the prisoners wearing six blue and four red hats.) Conceivably, there could be eight blue and only two red hats, or any other combination of red and blue hats, including all the hats being either red or blue. Not knowing the number of red and blue hats in the total of hats would make logically solving the puzzle impossible.

    • @bnitinb
      @bnitinb 2 года назад +1

      You didn't read the puzzle, total prisoners are 10

    • @ktera
      @ktera Год назад

      watch the video again, folk

    • @curosity276
      @curosity276 Год назад

      Yeah,I am also thinking the same , let's take 2 blue and 8 red hats consecutively. It fails in first attempt.

    • @kippe1221
      @kippe1221 Год назад +1

      @@bnitinb you didnt understand what he wrote. Number of red and blue hats, not number of prisoners.

    • @1Pandaking
      @1Pandaking 10 месяцев назад

      @@curosity276 It doesn't, the last prisoner calls out Even (Red), the second to last still sees even and calls out Blue thus correct, The third to last sees odd so calls out Red switching the Count from Even To Odd. Then each one in front of him sees the inverse of the count and Call out Red continuing down the line each one switching the count. Leading to all but the one in back has called out the right color and they are all free to go.

  • @CardCaptor32584
    @CardCaptor32584 2 года назад

    Your guard is a nice guy. When my friend told me this riddle, he let the last prisoner be the noble sacrifice.

  • @mcger5624
    @mcger5624 4 месяца назад +1

    great - well done mate

  • @harnek.singh77
    @harnek.singh77 5 лет назад +35

    If they were tht smart thy won't be in prison 🤣🤣

  • @YEC999
    @YEC999 3 года назад +1

    cool logic nicely explained - came close but what i was missing the trick with the odd and even...

  • @touchme2733
    @touchme2733 3 года назад +1

    Great video by the way loving your content so far

  • @NK-fx1qs
    @NK-fx1qs 2 года назад

    nice thanks! these are fun to watch.

  • @becalmandquiet881
    @becalmandquiet881 3 года назад

    Great video

  • @saj157
    @saj157 6 лет назад +3

    Awesome!! I finally got it!! yay!!:) you’re genius.

  • @anushams9828
    @anushams9828 5 лет назад +1

    Nice one🙂

  • @matitiudeforever8155
    @matitiudeforever8155 5 лет назад +14

    that was the best riddle i've ever come across

  • @nandhagopal8699
    @nandhagopal8699 5 лет назад +1

    Amazing

  • @charlesbromberick4247
    @charlesbromberick4247 2 года назад

    Sounds like Schria Law to me. Thanks for the puzzles - i really like them.

  • @ajaykumargupta8504
    @ajaykumargupta8504 4 года назад

    Awesome 👌

  • @index_s580
    @index_s580 2 года назад +1

    You gave a key tip to solving by precisely describing 10th person position.

  • @AmritEdits13
    @AmritEdits13 3 года назад +1

    Your riddles are best than others
    It has a logic like your channels name

  • @patrickjinks
    @patrickjinks 5 лет назад +10

    I thought shout your own colour if the person in front is wearing a red hat and whisper it if they're wearing a blue one but only after listening to the answer, even though there's nothing against doing that, I feel I've let myself down

  • @mrgyani
    @mrgyani Год назад

    Wow, this was brilliant.

  • @SAIMRIAZ
    @SAIMRIAZ 5 лет назад +1

    Nice

  • @canale2303
    @canale2303 2 года назад +3

    I'd have answered differently. Prisoner 10 always says the hat's color of the prisoner 9. Prisoner 9 knows his hat's color. The agreed strategy is that each prisoner looks at the color of the prisoner in front of him and in case it is blu he SHOUTS his hat's color, otherwise it says it normally. So each prisoner knows his own hat's color just because of his partner's voice volume.

    • @bm-ub6zc
      @bm-ub6zc Год назад

      yeah i have the almost same solution (just with high pitched or low pitched voice, and with "next one has same/different color"), but in principle it's the same solution.
      the parity stuff is too difficult to figure out or memorize.

    • @mrgyani
      @mrgyani Год назад

      You cannot give any kind of signal, be it with volume or whatever.

  • @swapniljain2464
    @swapniljain2464 5 лет назад

    Awesome

  • @hsingh-13
    @hsingh-13 3 года назад

    Wow! 👍

  • @dy4e02
    @dy4e02 5 лет назад +1

    The only way i up to that he should says the number of red he sees,
    And saying odd or even let the other hit the number while been asked, great job

  • @madhesh18
    @madhesh18 4 года назад +1

    Terrific strategy

  • @priyanshuchaurasiya6184
    @priyanshuchaurasiya6184 4 года назад +1

    Very typicall puzzle but also an exellent solution!

  • @poornimanagaraju8534
    @poornimanagaraju8534 7 лет назад +17

    Hey Amar..Awesome man!..Your passion towards puzzle has grown so much and it's spreading now!..Good to see you on youtube!..Nice explaination!

    • @LOGICALLYYOURS
      @LOGICALLYYOURS  7 лет назад +3

      Thanks Poornima... solved a lot.. now its time to teach to the world :) :) :P Must subscribe :)

  • @bishnunepali3018
    @bishnunepali3018 4 года назад

    nice...

  • @termin01
    @termin01 5 лет назад

    Amazing video bro

  • @basiliobastardo255
    @basiliobastardo255 2 года назад +1

    if the back prisoner can see in front and can pass message, why don't he just say the color of hat in front of him as a message?

  • @rajancherian4259
    @rajancherian4259 2 года назад

    What if there are 0 red hats? Will it be seen as an even count? I think that calling out the color with an odd number of appearances is better. Cos even if red is 0, there will be 9 blue hats and vice versa.

  • @qc1okay
    @qc1okay 4 месяца назад

    Mr. Ammar, surprised you didn't first solve a case of just 4 or 5 prisoners, like you often do to show proof of concept, for viewers to catch on with. And I think if my life were on the line, I'd just be doing simple counting, not thinking about the concept of parity. "OK, so the first guy said "Red", so the other nine of us in front of him have an even number of red hats in total, and I see two reds in front of me, so I just have to listen to how many times the guys behind me say 'Red'." Then when it gets to be his turn, he thinks, "OK, so I've heard only one guy behind me say 'Red', so with one red behind me and two in front of me, that's three reds, so mine has to be red for there to be an even number of reds in front of the first guy. RED!"

  • @akashmore6249
    @akashmore6249 4 года назад

    nice

  • @akhtar_Alee
    @akhtar_Alee 5 лет назад +2

    I will see in reflexion of jailor's glasses

  • @fomori2
    @fomori2 2 года назад

    Took about 3 minutes to figure out that the last guy in line will say "blue" if he sees an even number of blue hats, and "red" if he see an odd number of blue hats. This alerts the prisoners what the starting target count of hats is, even or odd.
    Each prisoner will count the number of blue hats and will know if his hat is blue, if the number of blue hats he sees is the opposite of the odd/even target count, or red, if the number of blue hats matches the odd/even target count.
    Whenever someone calls out blue the odd/even count target switches to the other. Zero is considered even.

  • @joshmays7058
    @joshmays7058 5 лет назад +3

    No way you get ten guys to do that correctly the first time!

  • @ABCXYZ-zt3dr
    @ABCXYZ-zt3dr 3 года назад +6

    I have easier approach to this :
    Last prisoner will tell second last prisoners hat color, if third last prisoner's hat color is equal to the second last prisoner's hat color then second last prisoner will tell his own hat color in louder voice otherwise in lower voice.
    From this third last prisoner will conclude his own hat color

    • @vichu8206
      @vichu8206 3 года назад

      This dont need any calculations. Yes you are right

    • @mayukh_
      @mayukh_ 3 года назад

      How does last prisoner would know his hat color?

    • @ABCXYZ-zt3dr
      @ABCXYZ-zt3dr 3 года назад

      @@mayukh_ last prisoner can see second last prisoner's hat color

    • @jlugger
      @jlugger 2 года назад +1

      I got something similar and far easier than the original solution. Each prisoner says his hat color in either a loud voice or a soft voice. If his hat is the same as the prisoner in front of him he is soft and if it is different he is loud.
      EX: Prisoner sees P9 hat is blue. P10 guesses his own hat is blue so he says "blue" in a soft voice. P9 then knows his hat is blue. P9 sees P8 hat is red so he states "BLUE" in a loud voice. P8 knows his hat is different. This way 9-1 are correct and even if 10 was incorrect they all go free.

  • @shreyamaurya6410
    @shreyamaurya6410 5 лет назад +2

    Gr8

  • @kidsgameslearning
    @kidsgameslearning 2 года назад +1

    Nice. This logic will
    Work only if the total number of prisoners are even. If it is odd, difficult to solve. Because last prisoner can saw both Color ok odd number or even numbers. So difficult to give the clue to others.

  • @PuzzleAdda
    @PuzzleAdda 5 лет назад +7

    My goal as a puzzle designer is to create a meaningful experience for the player, not just 'I solved it.'

  • @tombratcher6938
    @tombratcher6938 3 года назад

    I remember getting told this and thinking... " parity?... yep, works"

  • @shubham2927
    @shubham2927 2 года назад

    wONDERFUL eXPLANATION sER

  • @subhajitpal2407
    @subhajitpal2407 2 года назад

    Is this puzzle's logic actually comes in any real life implementation like in computer science concepts?

  • @ottovaughnjr.9282
    @ottovaughnjr.9282 6 лет назад +4

    What type of jailor is that...?

  • @uberfu
    @uberfu 2 года назад +1

    There's a flaw to the puzzle -- the puzzle assumes that the jailor will go in order of prisoners from back to front. Which is the only way this puzzle works. If the jailor calls out random prisoners or starts fromt eh front the entire puzzle fails.

  • @ShanmukhaPulavarthy
    @ShanmukhaPulavarthy 7 месяцев назад

    Here's how the logic works:
    If there are an even number of red hats in front of the counter, the guessers can deduce the color of their hat by counting the number of red hats they see. If the count of red hats among the first 9 prisoners (excluding the counter) is even, then the color of their own hat must be blue. If it's odd, their own hat must be red.
    If there are an odd number of red hats in front of the counter, the guessers can similarly deduce the color of their hat.
    This strategy ensures that the counter can make a correct guess based on the parity (odd or even) of the red hats in front of him, and the guessers can correctly infer their hat color based on the counter's response. This way, at least 9 prisoners will survive, and they will all be released.

  • @arnabpersonal6729
    @arnabpersonal6729 5 лет назад

    Real genius

  • @dreamstory979
    @dreamstory979 2 года назад +1

    Amar I have question if there are only 2 red cap then how it possible

  • @tigergaming7052
    @tigergaming7052 5 лет назад

    Who will arrange hat according to they calculation?

  • @michaelbauers8800
    @michaelbauers8800 4 года назад

    I love hat puzzles

  • @ammararfeen5644
    @ammararfeen5644 5 лет назад +2

    My Naam is also ammar and your logic so clear and high I appreciate you for giving this knowledgful videos

  • @mohammedzubair8618
    @mohammedzubair8618 7 лет назад +6

    very good logic. Good way of presenting. plz continue the same

  • @unbrokenriven1455
    @unbrokenriven1455 3 года назад

    so how do you solve for the same problem but there are 3 different color hats?

  • @johndanson4427
    @johndanson4427 Месяц назад

    Buy the guard mirrored sunglasses.

  • @bm-ub6zc
    @bm-ub6zc Год назад

    I have a much simpler solution:
    Prisoner 10: Says whatever color in front of him.
    Prisoner 9: Says the color said by prisoner 10, in a low pitched voice if the next one has the same color, and in a high pitched voice if the next one has a different color.
    And so on.

  • @aldenasuemia
    @aldenasuemia 2 года назад

    Wow this is what I call genius.

  • @hxong4733
    @hxong4733 5 лет назад

    Genius

  • @saadmanahmed860
    @saadmanahmed860 5 лет назад +2

    prisoners were really discerning... would i be in such a prison where gaoler makes redemption of prisoners such a logical way...!!!!

  • @CarlEmilKjellstrand
    @CarlEmilKjellstrand 2 года назад

    Checksums are the best :)

  • @ankitakamble9514
    @ankitakamble9514 3 года назад

    👌

  • @prashantkumargupta4996
    @prashantkumargupta4996 6 лет назад +6

    elegant explanation.

  • @programming_hut
    @programming_hut 3 года назад

    wow

  • @abhinavgupta7930
    @abhinavgupta7930 5 лет назад

    could not each prisoner just see their respective cap colours in jailors glasses.lol.XD

  • @haribattula5187
    @haribattula5187 3 года назад

    Do the front prisoner listens to answer told by back prisoner..and if he listens what if all hats are blue or red and only one blue or one black

  • @himanshusingh5056
    @himanshusingh5056 3 года назад +1

    Prisoners with calculus like idea's

  • @Mark-qg8hm
    @Mark-qg8hm 3 года назад +4

    They should have strategies how to bum rush the jailer and overpower him, since there is just one guy.

  • @murugankaruppaiah9537
    @murugankaruppaiah9537 4 года назад +2

    I think they are studied in oxford university

  • @sorsocksfake
    @sorsocksfake Год назад

    Prisoner 10 will count whether the red hats are even or odd. If even, he says blue; if odd, he says red.
    Thus the other prisoners know whether the first 9 *including them* are an odd or even number.
    They can also see the prisoners in front of them, and have heard the ones behind them. So they know whether the first 9 *except themselves* is an odd or even number.
    If the two match, then their own hat must be blue. If they do not match, it's because their own hat is red. They speak accordingly.

  • @V7B817
    @V7B817 2 года назад

    Finally got the answer by odd/even logic
    10th person would have said that I will told you the colour of the hat which is in odd number

  • @vikashtiwari5505
    @vikashtiwari5505 6 лет назад +3

    Brilliant

  • @piedpiper3314
    @piedpiper3314 2 года назад +1

    Why can't 10 simply tell 9 color of his hat...9 tell 8 color of his and so on...
    Did I miss something in question pls explain anyone

    • @TB-up4xi
      @TB-up4xi 2 года назад

      You must only answer red or blue - and it must be the colour of your own hat - 10 can say red or blue signalling to 9 the colour of 9's hat but 9 must only answer the colour of their own hat anything else any everyone dies.

    • @V7B817
      @V7B817 2 года назад

      Just imagine prisoners wearing the blue/red hats alternatively

  • @YatharthSharma
    @YatharthSharma 4 года назад +2

    Kaaliya from SHOLE movie after watching this video "bhaiya ye trick hame bhi bta dete us bhosdiwale sardar gabbar singh se ham bhi bach jate" 😄😄😄

  • @aryanrawat5961
    @aryanrawat5961 Год назад

    Simplest tareeka: peeche wala apne aage wale ko bata de usne kaunsi pehni hai. Bas ho jaayega sab

  • @abcdefgabcdefg3017
    @abcdefgabcdefg3017 Год назад

    Why should they even do that. Except the last one , everyone can know their colour from the previous person . Only the last person has to apply the given strategy to guess his own colour.

  • @SS-cr8hb
    @SS-cr8hb 5 лет назад

    Very nice puzzle sir .According to me if the 10th prisoner speaks the colour of hat which is more in number among the 9(odd no.) hats infront of him, then also each prisoner would know his hat colour keeping in mind possible combinations of hats- 5,4 6,3 ....

    • @LOGICALLYYOURS
      @LOGICALLYYOURS  5 лет назад +1

      Dear SS.... nice to see that you tried to come up with a different approach(max), but it has limitation.... assume that only the first prisoner(front) and 9th prisoner are wearing Red Hat. Now, the prisoner 10 will call out "BLUE" (because they are more in number). But what would the 9th prisoner call out ?? For him still, majority is BLUE, but he can't decide what he is wearing.
      So, eventually an Even-Odd approach can get at least 9 correct answers.

    • @SS-cr8hb
      @SS-cr8hb 5 лет назад +1

      You are right sir. Thank you so much for the explanation.

  • @babyyoda5074
    @babyyoda5074 5 лет назад +7

    It's not fair
    Such intelligent prisoners should not be released from rhe jail.😂😂😂

  • @sharukhshaik7476
    @sharukhshaik7476 4 года назад

    As a digital design engineer, I have an idea to design a digital circuit using XOR gates, a Comparator, and Multiplexer for this problem 😉

  • @LaughterPlanet-mu1yp
    @LaughterPlanet-mu1yp Год назад

    There is another simplest way, prisonor 10 will say colour of 9th hat... Now 9th know the color of his hat, so if the color of his next is same as him he will answer his hat color within 1 second or if the color of his next hat is different he will answer his hat colour in 5 seconds.. So this 1 or 5 second time interwal will give hint to the next prisnor and so on... As we know that 10th prisonor will be release even if he is incorrect so in this way all of them will be released.

  • @balajik8688
    @balajik8688 2 года назад

    Y do they releasing the prisoners so freely..it's not even Gandhi jayanthi now 😂

  • @rajivpokharel88
    @rajivpokharel88 2 года назад

    didnt understand one bit...but enjoyed it anyways...xD

  • @aashishkohli2387
    @aashishkohli2387 3 года назад

    Man fuck it this is hamming code 😬😬im so excited !! there not a better explanation of this thing thanks ammar

  • @rnegoro1
    @rnegoro1 5 лет назад +7

    You can actually work it from the odd numbers too at the beginning instead of even.

  • @Hemalatha...
    @Hemalatha... 2 года назад

    2nd would inform 1st that he is wearing red,
    3rd to 2nd as blue ,4th to 3rd as red .................

  • @lovefor011
    @lovefor011 5 лет назад

    so here I am assuming that prisoners knows that the blue and red hats are in even or odd numbers..