Author Topic: Prisoners  (Read 5980 times)

0 Members and 2 Guests are viewing this topic.

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Prisoners
« on: January 29, 2007, 01:48:34 pm »
I think this was on Car Talk or something like that, so if you've heard it, please don't answer.  Feel free to comment, but don't ruin it for everyone else!  If you're really considerate, you could post the answer in rot13.



A prison guard is in a dilemma.  His prison is full and he has a new shipment of prisoners due to arrive within a few days.  To clear out the prison, he picks 10 random inmates.  He can't decide whether he should let them go or to kill them, so he decides to put their fate into their own hands.  He invents a game.  Each prisoner is placed in a chair that's in a straight row.  Then, a hat of either green or red is placed on each prisoner's head.  He then tells them: each one of you is to guess which color your hat is.  If you're right, then you're free to go; if not or you say anything other than your hat color, I shoot you on the spot.



The rules of the game are given to the prisoners the night before the game takes place.  The guard gives them the chance to converse before the event as to maximize the number of prisoners allowed free.

Goal: Maximize the number of prisoners that live by inventing a strategy that can be used.

Rules:
    * The prisoners can only say "red" or "green."  If anyone does anything else, the guard shoots all of them.
    * The prisoners can't look at their own hat colors or turn around to see other prisoners' hats.  If this happens, the guard kills all of them.
    * Each prisoner only has one chance to speak a color.  He can say "red" or "green" once and then their turn is over.
    * The prisoners are asked their hat colors sequentially, starting with prisoner 0.
    * Each prisoner must answer immediately after his turn begins or they're shot.

Here are a few pseudo-hints:
    * The diagram is a mere representation of a possible configuration of hats.  The order and number of each color is purely random.
    * The prisoner in the first seat can see all hat colors but his own.  Prisoner 1 can see prisoners 2-9, etc.
« Last Edit: January 29, 2007, 10:33:03 pm by Sidoh »

trust

  • Guest
Re: Prisoners
« Reply #1 on: January 29, 2007, 03:08:15 pm »
What is the question?

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Prisoners
« Reply #2 on: January 29, 2007, 03:17:47 pm »
The guard gives them the chance to converse before the event as to maximize the number of prisoners allowed free.

Offline deadly7

  • 42
  • x86
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: Prisoners
« Reply #3 on: January 29, 2007, 04:15:29 pm »
Why couldn't the person in the very back just say every color hat he sees?  He'd be the only one with a 50% chance, then... or am I thinking about it all wrong?
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
 [17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Prisoners
« Reply #4 on: January 29, 2007, 04:19:21 pm »
Why couldn't the person in the very back just say every color hat he sees?  He'd be the only one with a 50% chance, then... or am I thinking about it all wrong?

I'm not being clear enough; you have my apologies.  I'll edit my post.  Re-read the rules section and I'll have added a few things.

Offline dark_drake

  • Mufasa was 10x the lion Simba was.
  • x86
  • Hero Member
  • *****
  • Posts: 2440
  • Dun dun dun
    • View Profile
Re: Prisoners
« Reply #5 on: January 29, 2007, 06:30:42 pm »
Hrmmm.... here goes the answer I thought up after thinking for a few seconds; it's nothing too elaborate. Prisoner 0 would say prisoner 1's color.  Prisoner 1 would say his color.  Prisoner 2 says prisoner 3's color, and so on.  5 are guaranteed to live.  But really, why does the guard want them to leave?  Just waste them all.  ;D
errr... something like that...

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Prisoners
« Reply #6 on: January 29, 2007, 07:25:20 pm »
Hrmmm.... here goes the answer I thought up after thinking for a few seconds; it's nothing too elaborate. Prisoner 0 would say prisoner 1's color.  Prisoner 1 would say his color.  Prisoner 2 says prisoner 3's color, and so on.  5 are guaranteed to live.  But really, why does the guard want them to leave?  Just waste them all.  ;D

Yes, that's one way, but it's not the best way.

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Prisoners
« Reply #7 on: January 29, 2007, 09:05:56 pm »
Since they are allowed to converse before hand, they can set up a system.  0 will tap 1's chair once for red, twice for green (or something) before saying his own color, and each can do the same for the one in front of them.  That way 9 are guaranteed to live, while 0 has a 50% chance.

Also, do they have the hats on when they are allowed to converse?  Cause if so they could all just get told their color...

Offline dark_drake

  • Mufasa was 10x the lion Simba was.
  • x86
  • Hero Member
  • *****
  • Posts: 2440
  • Dun dun dun
    • View Profile
Re: Prisoners
« Reply #8 on: January 29, 2007, 09:19:16 pm »
[size=0pt]I have a way, but only 9 would be guaranteed to survive.

Hrmm.... Prisoner 0 would wait 10 seconds if prisoner 1's hat were green and 20 seconds if his hat were red.  Prisoner 1 would do the same for prisoner 2, and so on. 
[/size]
Quote it for my answer.  :-\
« Last Edit: January 29, 2007, 09:21:54 pm by dark_drake »
errr... something like that...

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Prisoners
« Reply #9 on: January 29, 2007, 09:36:35 pm »
Since they are allowed to converse before hand, they can set up a system.  0 will tap 1's chair once for red, twice for green (or something) before saying his own color, and each can do the same for the one in front of them.  That way 9 are guaranteed to live, while 0 has a 50% chance.

Also, do they have the hats on when they are allowed to converse?  Cause if so they could all just get told their color...

That's not outside of the rules I specified, but I'd hope your intuition at least indicated that it is out of the rules of the riddle.  The only form of communication they're allowed is saying "red" or "green."

So, in conclusion: no on both accounts. ;p

drake, sorry, I missed your post.  That's a clever answer, but it's not the one I'm thinking of.  I'll add that as another rule.
« Last Edit: January 29, 2007, 10:32:24 pm by Sidoh »

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Prisoners
« Reply #10 on: January 31, 2007, 11:30:38 am »
Va lbhe qvntenz, gurer ner svir erq ungf naq svir terra ungf. V'z abg fher vs gurl jrer vagragvbanyyl rira, ohg V'yy nffhzr gurl jrer, orpnhfr gung znxrf vg rnfvre. :)

Gur ynfg cevfbare pbhagf hc ubj znal terra ungf naq ubj znal erq ungf gurve ner. Gurer jvyy or svir bs bar naq sbhe bs gur bgure, fb gur bar gurerf sbhe bs vf ba uvf urnq.

Gur frpbaq cevfbare yvfgraf gb jung ur fnlf naq jvyy nffhzr gurerf bayl sbhe bs gung bar yrsg, lrg svir bs gur bgure. Juvpurire unf gur jebat ahzore vf ba uvf urnq.

Pbagvahvat yvxr guvf, gur guveq cevfbare fhogenpgf obgu gur svefg ung naq gur frpbaq ung, naq lrg ntnva juvpu vf vapbeerpg vf ba uvf urnq.

Gurl pbagvahr yvxr guvf hagvy gurl ernpu gur svany cevfbare, jub fubhyq unir abj pbhagrq rvgure 4 be 5 erq ungf, naq gur bccbfvgr ahzore bs terra ungf. Juvpu rire unf bayl sbhe yrsg, ur'f jrnevat.

Ol guvf zrgubq, hayrff nalbar unf n fubeg nggragvba fcna, abobql fubhyq cbffvoyl qvr. Ohg V'q cebonoyl qvr, orpnhfr V unir n fubeg nggragvba fcna. Nsx, fpubby.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Prisoners
« Reply #11 on: January 31, 2007, 11:31:20 am »
[size=0pt]I have a way, but only 9 would be guaranteed to survive.

Hrmm.... Prisoner 0 would wait 10 seconds if prisoner 1's hat were green and 20 seconds if his hat were red.  Prisoner 1 would do the same for prisoner 2, and so on. 
[/size]
Quote it for my answer.  :-\

Each prisoner must answer immediately as his turn begins or he will be shot.

Unless Sidoh added that later, in which case, good job. :)
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Prisoners
« Reply #12 on: January 31, 2007, 11:38:34 am »
Each prisoner must answer immediately as his turn begins or he will be shot.

Unless Sidoh added that later, in which case, good job. :)

drake, sorry, I missed your post.  That's a clever answer, but it's not the one I'm thinking of.  I'll add that as another rule.

Joe, your answer is reasonably close, but you missed this:

    * The diagram is a mere representation of a possible configuration of hats.  The order and number of each color is purely random.