Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

The New Coffee Room

  1. TNCR
  2. General Discussion
  3. Puzzle time - prisoners and hats

Puzzle time - prisoners and hats

Scheduled Pinned Locked Moved General Discussion
26 Posts 7 Posters 328 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Klaus
    wrote on 11 Nov 2021, 11:55 last edited by
    #3

    Q: Do we assume that the prisoners cooperate, even when they won't be among the freed?

    Q: Do we know how many distinct colors are on the list?

    J 1 Reply Last reply 12 Nov 2021, 07:33
    • T Offline
      T Offline
      taiwan_girl
      wrote on 12 Nov 2021, 02:27 last edited by
      #4

      Have to think about this more, but I assume that the prisoners can trade hats?

      H 1 Reply Last reply 12 Nov 2021, 03:12
      • T taiwan_girl
        12 Nov 2021, 02:27

        Have to think about this more, but I assume that the prisoners can trade hats?

        H Offline
        H Offline
        Horace
        wrote on 12 Nov 2021, 03:12 last edited by
        #5

        @taiwan_girl said in Puzzle time - prisoners and hats:

        Have to think about this more, but I assume that the prisoners can trade hats?

        Yes. They are trading their hats - which is a metaphor for their very souls, in this puzzle - for their freedom. Their very freedom. I suspect they are God-fearing conservatives, with the hats colored red, with four simple letters on the front. MAGA.

        God bless Donald Trump, God bless America, and God damn imprisonment! I bet they are all minorities, falsely imprisoned!

        The color of their hats? The color of freedom. Sanctified freedom, AMEN!! MAGA!!

        Education is extremely important.

        1 Reply Last reply
        • H Offline
          H Offline
          Horace
          wrote on 12 Nov 2021, 03:13 last edited by
          #6

          Is that the correct answer, jon?

          Education is extremely important.

          1 Reply Last reply
          • K Offline
            K Offline
            Klaus
            wrote on 12 Nov 2021, 06:10 last edited by
            #7

            Let's establish a baseline.

            Assuming that the prisoners would be willing to cooperate even if they are not freed, I think there's a baseline solution that would set 12 prisoners free:

            The odd-numbered prisoners sacrifice themselves and call out the color of the guy in front of them. Which means that 12 of the 25 can be freed.

            So, all we have to do now is improve on 12.

            1 Reply Last reply
            • K Offline
              K Offline
              Klaus
              wrote on 12 Nov 2021, 06:20 last edited by Klaus 11 Dec 2021, 06:23
              #8

              Ah, I do have a solution to set 24 free.

              (spoilers don't work right now. Damn lazy and incompetent forum admin).

              Let's call the colors c-1, c-2, c-3, ... . (These are not the colors of the prisoners but an enumeration of all colors).

              Let d-1, ..., d-25 be the colors of the prisoners.

              Let p-1=2, p-2=3, p-4=5, ... be the sequence of prime numbers.

              The last prisoner sees all colors and computes the number

              n = (p-1^d-1)(p-2^d-2) ... * (p-24*d-24).

              and calls out c-n.

              Thanks to the unique factorization theorem, every d-i can be uniquely computed from n, hence every other prisoner can reconstruct his color from the first color.

              Problem solved.

              (well, the prisoners would need to be quite good at distinguishing a very large amount of different colors 🙂 )

              I think in general the strategy needs to be to encode multiple colors into one color. I've described the limit case.

              1 Reply Last reply
              • K Offline
                K Offline
                Klaus
                wrote on 12 Nov 2021, 06:25 last edited by Klaus 11 Dec 2021, 06:25
                #9

                @jon-nyc said in Puzzle time - prisoners and hats:

                calls out a color from the list

                Ah, damn, missed that one.

                I think the same basic strategy - enocde multiple colors into one - still applies, but now it all depends on how many colors are on the list - which Jon hasn't told us.

                1 Reply Last reply
                • K Klaus
                  11 Nov 2021, 11:55

                  Q: Do we assume that the prisoners cooperate, even when they won't be among the freed?

                  Q: Do we know how many distinct colors are on the list?

                  J Offline
                  J Offline
                  jon-nyc
                  wrote on 12 Nov 2021, 07:33 last edited by jon-nyc 11 Dec 2021, 07:35
                  #10

                  @klaus said in Puzzle time - prisoners and hats:

                  Q: Do we assume that the prisoners cooperate, even when they won't be among the freed?

                  Q: Do we know how many distinct colors are on the list?

                  Yes. The prisoners will.

                  Only non-witches get due process.

                  • Cotton Mather, Salem Massachusetts, 1692
                  1 Reply Last reply
                  • J Offline
                    J Offline
                    jon-nyc
                    wrote on 12 Nov 2021, 08:00 last edited by
                    #11

                    Re your answer I’m afraid the guy can only guess his color from the list of colors

                    Only non-witches get due process.

                    • Cotton Mather, Salem Massachusetts, 1692
                    1 Reply Last reply
                    • J Offline
                      J Offline
                      jon-nyc
                      wrote on 12 Nov 2021, 08:03 last edited by
                      #12

                      Hint - what’s the ideal method if there are only 2 colors, say black and white?

                      Can an analogous method be scaled to n colors?

                      Only non-witches get due process.

                      • Cotton Mather, Salem Massachusetts, 1692
                      1 Reply Last reply
                      • K Offline
                        K Offline
                        Klaus
                        wrote on 12 Nov 2021, 08:24 last edited by
                        #13

                        I can prove that all prisoners must necessarily have the same color.

                        The proof is by induction on the number of prisoners n.

                        Base case n = 1: Surely if there's only a single prisoner, he'll have the same color as himself.

                        Inductive step: n = m + 1.
                        Pick an arbitrary prisoner p1 and look at the remaining m prisoners (including p2 from below). By induction hypothesis, they'll all have the same color.

                        Now pick a different prisoner p2 and look at the remaining m prisoners (which includes p1). By induction hypothesis, they'll also all have the same color.

                        This means that p1 and p2 must have the same color as everyone else. So all prisoners must have the same color.
                        QED.

                        So it's quite easy: all 25 prisoners can be freed!

                        I'm lucky this turned out so well!

                        1 Reply Last reply
                        • J Offline
                          J Offline
                          jon-nyc
                          wrote on 12 Nov 2021, 08:54 last edited by
                          #14

                          For the two color case - black and white:

                          The last guy in line, who sees all hats except his own, calls out “black”, say, to communicate he can see an odd number of black hats. Otherwise, he says “white”, meaning he can see an even number of black hats.

                          He of course has only a chance of guessing his own color.

                          But the next guy will either see the same parity (odd/even) of black hats indicated in the first answer, or not. If he does, he can assume he has a white hat, if not he can assume black. Next in line same, after taking into account any ‘parity switch’ indicated by the second man’s stated color.

                          By that method all but the last in line (first guy to call his color) are freed.

                          Is there an analogous method for n colors?

                          Only non-witches get due process.

                          • Cotton Mather, Salem Massachusetts, 1692
                          J 1 Reply Last reply 14 Nov 2021, 05:58
                          • I Offline
                            I Offline
                            Ivorythumper
                            wrote on 12 Nov 2021, 14:18 last edited by
                            #15

                            If there are 25 colors, everyone can see ahead of themselves, and know what was said behind them, so they can know the color of their own hat.

                            1 Reply Last reply
                            • J Offline
                              J Offline
                              jon-nyc
                              wrote on 12 Nov 2021, 14:55 last edited by
                              #16

                              IT - there can be many people with the same color hat. Also by what method are you assuming the earlier people in line guessed their color correctly?

                              Only non-witches get due process.

                              • Cotton Mather, Salem Massachusetts, 1692
                              I 1 Reply Last reply 12 Nov 2021, 19:48
                              • J jon-nyc
                                12 Nov 2021, 14:55

                                IT - there can be many people with the same color hat. Also by what method are you assuming the earlier people in line guessed their color correctly?

                                I Offline
                                I Offline
                                Ivorythumper
                                wrote on 12 Nov 2021, 19:48 last edited by
                                #17

                                @jon-nyc said in Puzzle time - prisoners and hats:

                                IT - there can be many people with the same color hat. Also by what method are you assuming the earlier people in line guessed their color correctly?

                                "Twenty-five prisoners are given a list of colors ... each will be fitted with a hat whose color is on the list ... each prisoner in turn calls out a color from the list"

                                "If there are 25 colors, everyone can see ahead of themselves... "

                                Process of elimination -- this assumes the given list of colors corresponds to the actual hat colors, and there is only one hat per color -- which is implied by "each will be fitted with a hat whose color is on the list ".

                                1 Reply Last reply
                                • H Offline
                                  H Offline
                                  Horace
                                  wrote on 12 Nov 2021, 19:51 last edited by
                                  #18

                                  Number of colors on the list was never specified in the original problem.

                                  Education is extremely important.

                                  1 Reply Last reply
                                  • L Offline
                                    L Offline
                                    LuFins Dad
                                    wrote on 12 Nov 2021, 20:12 last edited by
                                    #19

                                    Are these male prisoners or female prisoners?

                                    8% of men are colorblind and .5% of women are.

                                    The Brad

                                    H G 2 Replies Last reply 12 Nov 2021, 20:37
                                    • L LuFins Dad
                                      12 Nov 2021, 20:12

                                      Are these male prisoners or female prisoners?

                                      8% of men are colorblind and .5% of women are.

                                      H Offline
                                      H Offline
                                      Horace
                                      wrote on 12 Nov 2021, 20:37 last edited by
                                      #20

                                      @lufins-dad said in Puzzle time - prisoners and hats:

                                      Are these male prisoners or female prisoners?

                                      8% of men are colorblind and .5% of women are.

                                      I doubt the puzzle creator even thought of this, due to our systemic visually impaired hatred. This is why those Microsoft people announce their appearance. I think we’ve all learned something from this puzzle - just not what the puzzle author intended.

                                      Let’s try to be kinder and more compassionate to the color blind moving forward.

                                      Education is extremely important.

                                      1 Reply Last reply
                                      • L LuFins Dad
                                        12 Nov 2021, 20:12

                                        Are these male prisoners or female prisoners?

                                        8% of men are colorblind and .5% of women are.

                                        G Offline
                                        G Offline
                                        George K
                                        wrote on 12 Nov 2021, 21:02 last edited by
                                        #21

                                        @lufins-dad said in Puzzle time - prisoners and hats:

                                        8% of men are colorblind and .5% of women are.

                                        Mens' eyes matter!

                                        "Now look here, you Baltic gas passer... " - Mik, 6/14/08

                                        The saying, "Lite is just one damn thing after another," is a gross understatement. The damn things overlap.

                                        1 Reply Last reply
                                        • J jon-nyc
                                          12 Nov 2021, 08:54

                                          For the two color case - black and white:

                                          The last guy in line, who sees all hats except his own, calls out “black”, say, to communicate he can see an odd number of black hats. Otherwise, he says “white”, meaning he can see an even number of black hats.

                                          He of course has only a chance of guessing his own color.

                                          But the next guy will either see the same parity (odd/even) of black hats indicated in the first answer, or not. If he does, he can assume he has a white hat, if not he can assume black. Next in line same, after taking into account any ‘parity switch’ indicated by the second man’s stated color.

                                          By that method all but the last in line (first guy to call his color) are freed.

                                          Is there an analogous method for n colors?

                                          J Offline
                                          J Offline
                                          jon-nyc
                                          wrote on 14 Nov 2021, 05:58 last edited by
                                          #22

                                          @jon-nyc said in Puzzle time - prisoners and hats:

                                          For the two color case - black and white:

                                          The last guy in line, who sees all hats except his own, calls out “black”, say, to communicate he can see an odd number of black hats. Otherwise, he says “white”, meaning he can see an even number of black hats.

                                          He of course has only a chance of guessing his own color.

                                          But the next guy will either see the same parity (odd/even) of black hats indicated in the first answer, or not. If he does, he can assume he has a white hat, if not he can assume black. Next in line same, after taking into account any ‘parity switch’ indicated by the second man’s stated color.

                                          By that method all but the last in line (first guy to call his color) are freed.

                                          Is there an analogous method for n colors?

                                          Big hint: I can use slightly different words to describe this very same method and it will scale to n colors.

                                          Only non-witches get due process.

                                          • Cotton Mather, Salem Massachusetts, 1692
                                          1 Reply Last reply
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes

                                          12/26

                                          12 Nov 2021, 08:03


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          12 out of 26
                                          • First post
                                            12/26
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups