Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 25th, 2015 at 5:07:15 PM permalink
The king gathers 100 prisoners on death row. He explains to them collectively the rules of a challenge he is going to do, which are as follows:

  1. They shall be lined up from shortest in front to tallest in back.
  2. All shall face the person in front.
  3. A black or white hat shall be placed on each man.
  4. In order, starting with the man last in line, each shall be asked the color of his hat.
  5. The king shall note each answer and execute everybody who got the wrong answer after all 100 prisoners have tendered their answers.
  6. Exchanging of information outside of the white/black answers is strictly forbidden and will result in everybody being killed if anybody is caught.
  7. The king shall give the prisoners some time to confer on a strategy before the line up.


Every prisoner shall be able to see all hats in front of him, but not his own nor any behind him. The questions are (1) what is the maximum number of the guaranteed number of lives that can be saved and (2) what strategy will achieve that goal?

If I were president, I wouldn't pardon the Thanksgiving turkey, but eat it instead.


First correct answer and solution gets a mystery gift, but you must be present at an official WoV event to collect it and warn me ahead of time that you'll be there.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 25th, 2015 at 5:59:11 PM permalink

All lives can be saved. The last prisoner says white if he sees an even number of white hats, and black if he sees an odd number. Then each successive prisoner can deduce the color of his own hat based on whether he sees an even or odd number along with the colors that were announced behind him. For example, if the second to the last prisoner sees the same parity (even/odd) as the last prisoner, then he knows his hat is black, otherwise it is white. His announcement then informs the next prisoner whether he sees an even or odd number, white meaning the parity flips from the last guy, and black meaning it stays the same. Each successive announcement of white flips the parity while black keeps it the same. Each prisoner then keeps track of the parity, and if he sees the same parity, he knows his hat is black, otherwise it is white.
BleedingChipsSlowly
BleedingChipsSlowly
  • Threads: 23
  • Posts: 1033
Joined: Jul 9, 2010
November 25th, 2015 at 6:24:39 PM permalink
Maximum guaranteed saves is 31. Each man gives the majority color he can see in front of him or else repeats the color given by the man behind him.
“You don’t bring a bone saw to a negotiation.” - Robert Jordan, former U.S. ambassador to Saudi Arabia
mason2386
mason2386
  • Threads: 39
  • Posts: 159
Joined: Apr 3, 2015
November 25th, 2015 at 6:34:01 PM permalink

I am stuck on the fact that there is no set amount of black or white. The pattern could be totally random
BleedingChipsSlowly
BleedingChipsSlowly
  • Threads: 23
  • Posts: 1033
Joined: Jul 9, 2010
November 25th, 2015 at 6:36:19 PM permalink
Precisely...
“You don’t bring a bone saw to a negotiation.” - Robert Jordan, former U.S. ambassador to Saudi Arabia
mason2386
mason2386
  • Threads: 39
  • Posts: 159
Joined: Apr 3, 2015
November 25th, 2015 at 6:43:45 PM permalink

The white hats could be, person(P)3, P8, P18, P19, P23, P35, P37, P41, P64, P70, P88, P90, P97, P98, P99. A coin toss kind of bet, missing a crucial piece of information.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 25th, 2015 at 6:45:31 PM permalink
Quote: BruceZ


All lives can be saved. The last prisoner says white if he sees an even number of white hats, and black if he sees an odd number. Then each successive prisoner can deduce the color of his own hat based on whether he sees an even or odd number along with the colors that were announced behind him. For example, if the second to the last prisoner sees the same parity (even/odd) as the last prisoner, then he knows his hat is black, otherwise it is white. His announcement then informs the next prisoner whether he sees an even or odd number, white meaning the parity flips from the last guy, and black meaning it stays the same. Each successive announcement of white flips the parity while black keeps it the same. Each prisoner then keeps track of the parity, and if he sees the same parity, he knows his hat is black, otherwise it is white.



You say 100 lives can be saved. However, isn't there only a 50/50 chance the first person to declare is right? Remember, he is stated the color of his own hat.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
BleedingChipsSlowly
BleedingChipsSlowly
  • Threads: 23
  • Posts: 1033
Joined: Jul 9, 2010
November 25th, 2015 at 6:48:06 PM permalink
I believe the intent of the puzzle is the hats could be all one color or any random mix.
“You don’t bring a bone saw to a negotiation.” - Robert Jordan, former U.S. ambassador to Saudi Arabia
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 25th, 2015 at 6:55:04 PM permalink
Quote: Wizard

Quote: BruceZ


All lives can be saved. The last prisoner says white if he sees an even number of white hats, and black if he sees an odd number. Then each successive prisoner can deduce the color of his own hat based on whether he sees an even or odd number along with the colors that were announced behind him. For example, if the second to the last prisoner sees the same parity (even/odd) as the last prisoner, then he knows his hat is black, otherwise it is white. His announcement then informs the next prisoner whether he sees an even or odd number, white meaning the parity flips from the last guy, and black meaning it stays the same. Each successive announcement of white flips the parity while black keeps it the same. Each prisoner then keeps track of the parity, and if he sees the same parity, he knows his hat is black, otherwise it is white.



You say 100 lives can be saved. However, isn't there only a 50/50 chance the first person to declare is right? Remember, he is stated the color of his own hat.


Yes, but it doesn't matter. The problem says the king only kills people who get it wrong after someone says a color. The last man is spared, and all the others will get their color right.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 25th, 2015 at 7:08:59 PM permalink
Let me make a couple things clear.

1. The king will note what everybody said and whether it correctly matched the color of his own hat. After all 100 people are done, he will separate those who got it wrong and execute them. Alternatively, I could have said he silently kills people who made a wrong guess immediately.

2. It is correct I did not state any distribution of colors. They could each be determined by a coin flip, the whim of the king, or anything.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 25th, 2015 at 7:15:52 PM permalink
Quote: Wizard

Let me make a couple things clear.

1. The king will note what everybody said and whether it correctly matched the color of his own hat. After all 100 people are done, he will separate those who got it wrong and execute them. Alternatively, I could have said he silently kills people who made a wrong guess immediately.

2. It is correct I did not state any distribution of colors. They could each be determined by a coin flip, the whim of the king, or anything.


In that case my method will save all 100 with probability 1/2, and 99 with probability 1/2, for an average of 99.5. The distribution of colors is irrelevant.
andysif
andysif
  • Threads: 23
  • Posts: 433
Joined: Aug 8, 2011
November 25th, 2015 at 7:16:13 PM permalink
Quote: BleedingChipsSlowly

Maximum guaranteed saves is 31. Each man gives the majority color he can see in front of him or else repeats the color given by the man behind him.


your number is obviously understated.
Under the worst case, you can make 50 groups of 2 and the first guy can call out the 2nd person's color. That would be 50 correct answers, plus those lucky groups that both persons happen to have the same color
BleedingChipsSlowly
BleedingChipsSlowly
  • Threads: 23
  • Posts: 1033
Joined: Jul 9, 2010
November 25th, 2015 at 7:34:29 PM permalink
Quote: andysif

Quote: BleedingChipsSlowly

Maximum guaranteed saves is 31. Each man gives the majority color he can see in front of him or else repeats the color given by the man behind him.


your number is obviously understated.
Under the worst case, you can make 50 groups of 2 and the first guy can call out the 2nd person's color. That would be 50 correct answers, plus those lucky groups that both persons happen to have the same color



My number is based on a spreadsheet simulation, and my maximum guaranteed number is the lowest I saw after banging the recalc button for a while. Your solution is much better.
“You don’t bring a bone saw to a negotiation.” - Robert Jordan, former U.S. ambassador to Saudi Arabia
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 25th, 2015 at 7:46:12 PM permalink
Quote: BruceZ

In that case my method will save all 100 with probability 1/2, and 99 with probability 1/2, for an average of 99.5. The distribution of colors is irrelevant.



Correct!!! You win the prize.


Let it be known that BruceZ has claimed the prize but please keep trying for benefit of the honor of figuring it out.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
andysif
andysif
  • Threads: 23
  • Posts: 433
Joined: Aug 8, 2011
November 25th, 2015 at 7:53:46 PM permalink
Quote: BleedingChipsSlowly

Quote: andysif

Quote: BleedingChipsSlowly

Maximum guaranteed saves is 31. Each man gives the majority color he can see in front of him or else repeats the color given by the man behind him.


your number is obviously understated.
Under the worst case, you can make 50 groups of 2 and the first guy can call out the 2nd person's color. That would be 50 correct answers, plus those lucky groups that both persons happen to have the same color



My number is based on a spreadsheet simulation, and my maximum guaranteed number is the lowest I saw after banging the recalc button for a while. Your solution is much better.


I don't understand how you get the number xx, and I am thinking along the same path as yours.

My thought:
luckiest combination is all 100 hats are black, in which case calling the majority that you see in front of you will get 100 correct answers.
In other cases, every wrong answer should guarantee one correct answer. i don't know how to quantify it, but it's like if you are the minority and you call the majority color, and you are wrong, then the someone in front of you will have to be correct until the remaining is 50/50.

PS: actually when I do the simulation, my correct guess is always the number of majority. ie if i get 78 or 63 B, then my correct answer is always 78 or 63.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 25th, 2015 at 9:03:43 PM permalink
Quote: Wizard


Let it be known that BruceZ has claimed the prize but please keep trying for benefit of the honor of figuring it out.


I wish to donate my prize to the first person who correctly answers the following, but you must correctly answer BOTH questions.

The evil king from the Wizard's problem is frustrated that his subjects outsmarted him, so he devises a different game. He places black hats on the heads of 50 prisoners and white hats on the heads of the remaining 50 prisoners. This time each prisoner is allowed to observe the hats of all the other prisoners. No one is allowed to observe their own hat, and the prisoners aren't told how many black hats there are, only that everyone has either a white or black hat. Within 24 hours, all of the prisoners with black hats, and only the prisoners with black hats, must leave the room. If any prisoners with black hats are still in the room after 24 hours, or if any of the prisoners with white hats have left the room in those 24 hours, everyone will die. Otherwise, all will be spared. No information about the color of each other's hats can be communicated other than observing who has left the room. They are given a brief period to devise a plan.

Upon hearing of this new game, the prisoners protest that this is impossible. So the king says, "OK, to be sporting, I will give you one piece of information. At least one of you has a black hat". With this knowledge, the prisoners are able successfully complete their task and save themselves.

Question 1 is how did they do it?
Question 2 is what did the king's hint tell them that they didn't already know?
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 25th, 2015 at 10:17:23 PM permalink

Here is what the plan could have been before the hint. Through this there is just one mass exodus. Once that happens, that is it, you don't need the rest of the time.
1. Everyone should agree that if you see all white hats, then leave and nobody else. This would work if the split were 1 black and 99 white.
2. If after a brief pause, nobody leaves, then there is at least 2 black hats.
3. After this pause, if you see exactly one black hat, then leave. This would work if the split were 2 black and 98 white.
4. If after another brief pause, nobody leaves, then there is at least 3 black hats.
5. After this pause, if you see exactly two black hats, then leave. This would work if the split were 3 black and 97 white.
...

You keep repeating this process until there is an exodus. It will require some method of marking how long a "pause" is. Where it breaks down is if everybody has a white hat. Everyone will leave and everyone will have been wrong.

So, the hint of at least one black hat removes that possibility and makes the challenge winnable.


I'd like to add that if I'm right I'd like to re-give my prize back to the next person to get this one correct.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 25th, 2015 at 10:49:06 PM permalink
Quote: Wizard


Here is what the plan could have been before the hint. Through this there is just one mass exodus. Once that happens, that is it, you don't need the rest of the time.
1. Everyone should agree that if you see all white hats, then leave and nobody else. This would work if the split were 1 black and 99 white.
2. If after a brief pause, nobody leaves, then there is at least 2 black hats.
3. After this pause, if you see exactly one black hat, then leave. This would work if the split were 2 black and 98 white.
4. If after another brief pause, nobody leaves, then there is at least 3 black hats.
5. After this pause, if you see exactly two black hats, then leave. This would work if the split were 3 black and 97 white.
...

You keep repeating this process until there is an exodus. It will require some method of marking how long a "pause" is. Where it breaks down is if everybody has a white hat. Everyone will leave and everyone will have been wrong.

So, the hint of at least one black hat removes that possibility and makes the challenge winnable.


I'd like to add that if I'm right I'd like to re-give my prize back to the next person to get this one correct.


Your algorithm is correct for question 1; however, they already know that there is at least 1 black hat before the hint. In fact, they all know that there are at least 49 black hats because they each see at least that many. I specified that there were 50 black hats assigned. You may have read a version of my post where I left that out, but they cannot execute your algorithm even when they can each see black hats and still be logical. Yet they can execute it and be logical when the king tells them that there is at least 1 black hat, something that they already knew! Question 2 then is what specifically did the king tell them that they didn't already know?
Ayecarumba
Ayecarumba
  • Threads: 236
  • Posts: 6763
Joined: Nov 17, 2009
November 25th, 2015 at 11:20:23 PM permalink
Quote: Wizard

Quote: BruceZ

In that case my method will save all 100 with probability 1/2, and 99 with probability 1/2, for an average of 99.5. The distribution of colors is irrelevant.



Correct!!! You win the prize.


Let it be known that BruceZ has claimed the prize but please keep trying for benefit of the honor of figuring it out.



Using this strategy, if all the hats are black, doesn't everyone say "white" and subsequently die?
Simplicity is the ultimate sophistication - Leonardo da Vinci
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 25th, 2015 at 11:32:39 PM permalink
Quote: Ayecarumba


Using this strategy, if all the hats are black, doesn't everyone say "white" and subsequently die?


No, if all the hats are black, the last guy sees an even number of whites (0) and says "white". Then the next guy also sees an even number of whites, so he knows his hat must be black and says "black". Then the next guy is able to deduce that the guy behind him saw an even number of whites, and since he does too, he knows his hat is black and says "black". And so on, everyone else says "black" and gets it right.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
November 25th, 2015 at 11:37:45 PM permalink
Quote: BruceZ

I specified that there were 50 black hats assigned. You may have read a version of my post where I left that out, but they cannot execute your algorithm even when they can each see black hats and still be logical. Yet they can execute it and be logical when the king tells them that there is at least 1 black hat, something that they already knew! Question 2 then is what specifically did the king tell them that they didn't already know?

If each prisoner can actually see all 99 other hats, each prisoner therefore sees either 49 or 50 black hats and knows "at least one hat is black". I'm not sure what the king told them they didn't already know, unless there's a language trick I'm missing in here somewhere because it's almost midnight and I've had a few drinks. But I don't think it's impossible without the added disclosure by the king:
Everyone stands in a circle, facing inward. One at a time starting with the shortest (or some other selected "first"), each prisoner goes to stand behind someone wearing a white hat if they can, otherwise just stand still. Keep going around the circle until it's been 101 prisoners since the last time someone moved. When everyone has stopped, there will be some short rows of people starting with N white hats and ending in one black hat, and other singleton black hats standing around. The singletons and the end of each row leave the room all at once, everyone else stays. This approach wouldn't work for the edge case of all white hats -- and that might be what the "at least one" hint would have provided if the prisoners hadn't already seen all the hats -- but because they can all see at least 49 black hats while they're conferring, everyone would agree that this approach would work and nobody would think it's impossible.
However, if that solution is considered "communicating information about the color of a hat" then this approach won't work. If so, what kinds of actions do not constitute "communicating" and are permissible?

BTW, my tongue-in-cheek solution to the original question saves all 100 prisoners, because
the 99 guys at the back of the line hold down the short guy at the front and cut out his tongue. When the king finally gets around to asking him for an answer, he can't give one. Therefore, "after all 100 prisoners have tendered their answers" never occurs and the prisoners' sentences are never carried out. The first 99 prisoners to answer can use BruceZ's parity solution, or just say "I'm white-black colorblind, you pompous royal bastard" -- it doesn't matter because the conditions for execution are never met.
Or maybe that was a tongue-not-in-cheek solution. Bwahahaha!
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 12:31:38 AM permalink
Quote: MathExtremist

If each prisoner can actually see all 99 other hats, each prisoner therefore sees either 49 or 50 black hats and knows "at least one hat is black".


Yes, but that's not enough for the Wizard's algorithm to start logically. There is something else very subtle that they must know that they don't learn until the king gives them that hint.


Quote: MathExtremist

However, if that solution is considered "communicating information about the color of a hat" then this approach won't work. If so, what kinds of actions do not constitute "communicating" and are permissible?


Only the act of leaving or staying can be used to determine color, no other actions. It isn't a trick question or language trick or think outside the box type question. The solution is completely logical.
andysif
andysif
  • Threads: 23
  • Posts: 433
Joined: Aug 8, 2011
November 26th, 2015 at 12:48:35 AM permalink
Quote: Wizard


Here is what the plan could have been before the hint. Through this there is just one mass exodus. Once that happens, that is it, you don't need the rest of the time.
1. Everyone should agree that if you see all white hats, then leave and nobody else. This would work if the split were 1 black and 99 white.
2. If after a brief pause, nobody leaves, then there is at least 2 black hats.
3. After this pause, if you see exactly one black hat, then leave. This would work if the split were 2 black and 98 white.
4. If after another brief pause, nobody leaves, then there is at least 3 black hats.
5. After this pause, if you see exactly two black hats, then leave. This would work if the split were 3 black and 97 white.
...

You keep repeating this process until there is an exodus. It will require some method of marking how long a "pause" is. Where it breaks down is if everybody has a white hat. Everyone will leave and everyone will have been wrong.

So, the hint of at least one black hat removes that possibility and makes the challenge winnable.



This my work for small number of black, but when you got say 48 blacks, it may be difficult to decide after that "long pause" is it up to 47 or 48 or 49 that we are talking about. Way around it is to use an announcer, yelling 1,2,3 .... but if that is not allowed, then I think your method doesn't work


Quote: MathExtremist

If each prisoner can actually see all 99 other hats, each prisoner therefore sees either 49 or 50 black hats and knows "at least one hat is black". I'm not sure what the king told them they didn't already know, unless there's a language trick I'm missing in here somewhere because it's almost midnight and I've had a few drinks. But I don't think it's impossible without the added disclosure by the king:

Everyone stands in a circle, facing inward. One at a time starting with the shortest (or some other selected "first"), each prisoner goes to stand behind someone wearing a white hat if they can, otherwise just stand still. Keep going around the circle until it's been 101 prisoners since the last time someone moved. When everyone has stopped, there will be some short rows of people starting with N white hats and ending in one black hat, and other singleton black hats standing around. The singletons and the end of each row leave the room all at once, everyone else stays. This approach wouldn't work for the edge case of all white hats -- and that might be what the "at least one" hint would have provided if the prisoners hadn't already seen all the hats -- but because they can all see at least 49 black hats while they're conferring, everyone would agree that this approach would work and nobody would think it's impossible.
However, if that solution is considered "communicating information about the color of a hat" then this approach won't work. If so, what kinds of actions do not constitute "communicating" and are permissible?


I have that concern too. I have kind of figure out a way but it essentially boils down to "communicating information about the color of a hat"


everyone do this in turn
1. if you see other blacks, leave the group.
2. if you don't see other blacks, but other still leave the group, until you are the only one left , you know you are black
3. if after a while nobody leaves the group, that you know all the remaining are white
4. this find either 1 black or a group of white. they can sit aside and those who left early repeat the whole process again until everyone is classified.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 1:15:53 AM permalink
Quote: andysif

Quote: Wizard


Here is what the plan could have been before the hint. Through this there is just one mass exodus. Once that happens, that is it, you don't need the rest of the time.
1. Everyone should agree that if you see all white hats, then leave and nobody else. This would work if the split were 1 black and 99 white.
2. If after a brief pause, nobody leaves, then there is at least 2 black hats.
3. After this pause, if you see exactly one black hat, then leave. This would work if the split were 2 black and 98 white.
4. If after another brief pause, nobody leaves, then there is at least 3 black hats.
5. After this pause, if you see exactly two black hats, then leave. This would work if the split were 3 black and 97 white.
...

You keep repeating this process until there is an exodus. It will require some method of marking how long a "pause" is. Where it breaks down is if everybody has a white hat. Everyone will leave and everyone will have been wrong.

So, the hint of at least one black hat removes that possibility and makes the challenge winnable.



This my work for small number of black, but when you got say 48 blacks, it may be difficult to decide after that "long pause" is it up to 47 or 48 or 49 that we are talking about. Way around it is to use an announcer, yelling 1,2,3 .... but if that is not allowed, then I think your method doesn't work


That's not a problem as they could (edited) just make the action periods far enough apart, like every 10 minutes you take an action based on what happened on the last period. That wasn't the point of the problem, and I could just as easily said there was a clock in the room, but that would have given things away too much, or they could allow someone to be the official time keeper by counting, or have them gather together in a group periodically, but those are actions. The Wizard's algorithm is right for question 1, it's just that it can't start logically until after the hint.


Quote: andysif

Quote: MathExtremist

If each prisoner can actually see all 99 other hats, each prisoner therefore sees either 49 or 50 black hats and knows "at least one hat is black". I'm not sure what the king told them they didn't already know, unless there's a language trick I'm missing in here somewhere because it's almost midnight and I've had a few drinks. But I don't think it's impossible without the added disclosure by the king:

Everyone stands in a circle, facing inward. One at a time starting with the shortest (or some other selected "first"), each prisoner goes to stand behind someone wearing a white hat if they can, otherwise just stand still. Keep going around the circle until it's been 101 prisoners since the last time someone moved. When everyone has stopped, there will be some short rows of people starting with N white hats and ending in one black hat, and other singleton black hats standing around. The singletons and the end of each row leave the room all at once, everyone else stays. This approach wouldn't work for the edge case of all white hats -- and that might be what the "at least one" hint would have provided if the prisoners hadn't already seen all the hats -- but because they can all see at least 49 black hats while they're conferring, everyone would agree that this approach would work and nobody would think it's impossible.
However, if that solution is considered "communicating information about the color of a hat" then this approach won't work. If so, what kinds of actions do not constitute "communicating" and are permissible?



I have that concern too. I have kind of figure out a way but it essentially boils down to "communicating information about the color of a hat"


everyone do this in turn
1. if you see other blacks, leave the group.


If you leave and you're white, everyone dies.
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 26th, 2015 at 1:26:51 AM permalink
Quote: BruceZ

Quote: andysif

Quote: Wizard


Here is what the plan could have been before the hint. Through this there is just one mass exodus. Once that happens, that is it, you don't need the rest of the time.
1. Everyone should agree that if you see all white hats, then leave and nobody else. This would work if the split were 1 black and 99 white.
2. If after a brief pause, nobody leaves, then there is at least 2 black hats.
3. After this pause, if you see exactly one black hat, then leave. This would work if the split were 2 black and 98 white.
4. If after another brief pause, nobody leaves, then there is at least 3 black hats.
5. After this pause, if you see exactly two black hats, then leave. This would work if the split were 3 black and 97 white.
...

You keep repeating this process until there is an exodus. It will require some method of marking how long a "pause" is. Where it breaks down is if everybody has a white hat. Everyone will leave and everyone will have been wrong.

So, the hint of at least one black hat removes that possibility and makes the challenge winnable.



This my work for small number of black, but when you got say 48 blacks, it may be difficult to decide after that "long pause" is it up to 47 or 48 or 49 that we are talking about. Way around it is to use an announcer, yelling 1,2,3 .... but if that is not allowed, then I think your method doesn't work


That's not a problem as they could make the time limit say 1 minute to act, but don't make a decision on the action of others until after 5 minutes. So there's some "hysteresis" between acting and deciding so we don't need to be able to measure time intervals precisely. Anyone can tell the difference between 1 minute and 5 minutes. You'd have to make those time intervals get progressively longer though so you can know when the decision phase stops and the next action phase starts. That wasn't the point of the problem, and I could just as easily said there was a clock in the room, but that would have given things away too much, or they could allow someone to be the official time keeper by counting, but then that's an action. The Wizard's algorithm is right for question 1, it's just that it can't start logically until after the hint.


Quote: MathExtremist

If each prisoner can actually see all 99 other hats, each prisoner therefore sees either 49 or 50 black hats and knows "at least one hat is black". I'm not sure what the king told them they didn't already know, unless there's a language trick I'm missing in here somewhere because it's almost midnight and I've had a few drinks. But I don't think it's impossible without the added disclosure by the king:

Everyone stands in a circle, facing inward. One at a time starting with the shortest (or some other selected "first"), each prisoner goes to stand behind someone wearing a white hat if they can, otherwise just stand still. Keep going around the circle until it's been 101 prisoners since the last time someone moved. When everyone has stopped, there will be some short rows of people starting with N white hats and ending in one black hat, and other singleton black hats standing around. The singletons and the end of each row leave the room all at once, everyone else stays. This approach wouldn't work for the edge case of all white hats -- and that might be what the "at least one" hint would have provided if the prisoners hadn't already seen all the hats -- but because they can all see at least 49 black hats while they're conferring, everyone would agree that this approach would work and nobody would think it's impossible.
However, if that solution is considered "communicating information about the color of a hat" then this approach won't work. If so, what kinds of actions do not constitute "communicating" and are permissible?


I have that concern too. I have kind of figure out a way but it essentially boils down to "communicating information about the color of a hat"


everyone do this in turn
1. if you see other blacks, leave the group.


If you leave and you're white, everyone dies.



Well, your last caveat kills my solution. I figured you could go in and out as much as you wanted during the 24 hours as long as, when the 24 hours were up, you were in the correct area by color, which your original rules implied could be done. If so, it becomes a "goose and fox" rowboat problem. But apparently not.
If the House lost every hand, they wouldn't deal the game.
andysif
andysif
  • Threads: 23
  • Posts: 433
Joined: Aug 8, 2011
November 26th, 2015 at 1:33:04 AM permalink
Quote: andysif


If you leave and you're white, everyone dies.



not exactly.
they just leave the group, not the room, per se.
and after 1 black or a number of white is classified, all those who "left" repeats the whole process again.

everyone do this in turn
1. if you see other blacks, leave the group.
2. if you don't see other blacks, but other still leave the group, until you are the only one left , you know you are black
3. if after a while nobody leaves the group, that you know all the remaining are white
4. this find either 1 black or a group of white. they can sit aside and those who left early repeat the whole process again until everyone is classified.

andysif
andysif
  • Threads: 23
  • Posts: 433
Joined: Aug 8, 2011
November 26th, 2015 at 1:34:52 AM permalink
Quote: beachbumbabs


If you leave and you're white, everyone dies.

Well, your last caveat kills my solution. I figured you could go in and out as much as you wanted during the 24 hours as long as, when the 24 hours were up, you were in the correct area by color, which your original rules implied could be done. If so, it becomes a "goose and fox" rowboat problem. But apparently not.



Just don't leave the room. go to the east side or the back or whatever.
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 26th, 2015 at 1:48:03 AM permalink
So, my solution to BruceZ's problem is:


Before the hats are placed or anyone moves, the prisoners decide they will form a circle and someone is designated number 1 to act, followed by the person to his left, on around. The hats are placed. The 1st person moves and takes a slow step out of the circle to the left. If his hat is black, nobody moves. If his hat is white, the person to his left takes a slow step to follow. The first person stops if the second moves because his hat must be white. If the nobody moves, the first person continues to take slow steps towards the door, as the others have confirmed he has a black hat and should leave.

The second person does the same, waiting at least a few slow steps to confirm for the first he's wearing a black hat; if the person to his left takes a step to follow right away, he stops from leaving. If nobody else remaining moves, he continues slowly to the door and out. There would be an overlap of movement for each white next to a white, but each man is depending on the one following him to indicate his color.

If the last person leaving has a black hat, no one moves until he has left. If he has a white hat, which #1 has seen while in the circle, #1 takes another step, and the last man stops.


I do not know the significance of the king saying "there is at least 1 black hat" when the prisoners can see each other and already know that.
If the House lost every hand, they wouldn't deal the game.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 1:51:28 AM permalink
Quote: beachbumbabs


From the problem:

" If any prisoners with black hats are still in the room after 24 hours, or if any of the prisoners with white hats have left the room in those 24 hours, everyone will die. "
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 1:53:30 AM permalink
Quote: andysif

Just don't leave the room. go to the east side or the back or whatever.


Prohibited by "No information about the color of each other's hats can be communicated other than observing who has left the room. "
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 26th, 2015 at 1:55:15 AM permalink
My alternate solution to the Wiz's problem is:

The last man in line says the color of the hat immediately in front of him. He has a 50% chance of being right. The man in front of him now knows what color his hat is. If that color matches the one he sees in front of him, he says the same color immediately. If it is the opposite color, he pauses a beat or two before he says his own color, given him by the man behind. The pause tells the person in front of him to say the opposite.

Again, if the color the man behind him names matches what he sees in front of him, he repeats it immediately. If it doesn't, he pauses, then repeats the color. The pause is what tells each man ahead whether to speak immediately or pause a moment before speaking.


This will give the same 99.5% chance of success as BruceZ's solution while conforming to the rules.
If the House lost every hand, they wouldn't deal the game.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 1:59:23 AM permalink
So no forming of circles or what not. The Wizard has the right solution. It just isn't logically valid until the hint is given, and the reason for that is the real problem. I might as well give this hint that will probably give it away, but I have to be up in an hour to catch a plane and won't be back for a couple days.

Think about what happens if there were only 2 total people in the room and both their hats are black.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 2:01:57 AM permalink
Quote: beachbumbabs

My alternate solution to the Wiz's problem is:

The last man in line says the color of the hat immediately in front of him. He has a 50% chance of being right. The man in front of him now knows what color his hat is. If that color matches the one he sees in front of him, he says the same color immediately. If it is the opposite color, he pauses a beat or two before he says his own color, given him by the man behind. The pause tells the person in front of him to say the opposite.

Again, if the color the man behind him names matches what he sees in front of him, he repeats it immediately. If it doesn't, he pauses, then repeats the color. The pause is what tells each man ahead whether to speak immediately or pause a moment before speaking.


This will give the same 99.5% chance of success as BruceZ's solution while conforming to the rules.


That violates the Wizard's condition that the only communication about the color of someone else's hat can be in naming a color. So you can't use pauses.
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 26th, 2015 at 2:10:44 AM permalink
A pause is an absence of communication, significant only to the prisoners who arranged it ahead of time, not to the king. The rules say nothing about a time interval between the colors being named.
If the House lost every hand, they wouldn't deal the game.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 2:14:20 AM permalink
Quote: beachbumbabs

A pause is an absence of communication, significant only to the prisoners who arranged it ahead of time, not to the king. The rules say nothing about a time interval between the colors being named.


An absence of a communication is a communication if it were pre-arranged as such. It's like people who take a certain amount of time to bid in bridge in order to communicate their hand to their partner. It's not legal, and the only communication allowed to do that is the bid itself.
HeyMrDJ
HeyMrDJ
  • Threads: 9
  • Posts: 101
Joined: May 29, 2015
November 26th, 2015 at 2:27:49 AM permalink
This is my version, pretty simple really, but it feels like I might of missed something if you lot didnt come up with the same.

The guy who goes first simply names the colour of the hat in front of him, that way the next person knows their hat colour, the person who goes next then simply says "my hat is black" if the next hat is white, or "black" if the next hat is black. The "may hat is" is the indicator that the colour is different. First guy has a 50/50 chance of surviving assuming his hat matches the guy in front. this would save a minimum of 99 people and doesnt require any sort of timing or exit strategy
Guess who peed in my Cheerios? Romes did...
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 26th, 2015 at 2:32:36 AM permalink
Knowing your hat color doesn't save you if you have to name the next person's hat color and it's different from your own.
ISMeister
ISMeister
  • Threads: 0
  • Posts: 1
Joined: Nov 26, 2015
November 26th, 2015 at 4:40:26 AM permalink
Quote: BruceZ

So no forming of circles or what not. The Wizard has the right solution. It just isn't logically valid until the hint is given, and the reason for that is the real problem. I might as well give this hint that will probably give it away, but I have to be up in an hour to catch a plane and won't be back for a couple days.

Think about what happens if there were only 2 total people in the room and both their hats are black.



Giving q2 some thought given that they all just assume there is a black hat they can still survive:

if everyone has a white hat, after the first few seconds everyone will think they have a black hat and start leaving. Since everyone has the same assumptions, when they see other people with white hats leaving thinking they are the only black hat,, that must mean they are all wearing white hats .
SOOPOO
SOOPOO
  • Threads: 123
  • Posts: 11465
Joined: Aug 8, 2010
November 26th, 2015 at 6:08:10 AM permalink
Well done. Wiz has informed me your prize is a black hat....
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 26th, 2015 at 6:20:27 AM permalink
First, in every response, please make it clear whether you are referring to question #1 (mine) or question #2 (Bruce Z). I started to try to split the thread but it was too confusing so I'm going to leave it alone.

Second, regarding question #1, communicating information via how long it takes to answer is not allowed. This would violate this rule:

"Exchanging of information outside of the white/black answers is strictly forbidden and will result in everybody being killed if anybody is caught."
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 26th, 2015 at 6:54:00 AM permalink
RE: BruceZ question #2

Quote: BruceZ

Your algorithm is correct for question 1; however, they already know that there is at least 1 black hat before the hint. In fact, they all know that there are at least 49 black hats because they each see at least that many. I specified that there were 50 black hats assigned. You may have read a version of my post where I left that out, but they cannot execute your algorithm even when they can each see black hats and still be logical. Yet they can execute it and be logical when the king tells them that there is at least 1 black hat, something that they already knew! Question 2 then is what specifically did the king tell them that they didn't already know?



This is going to be hard to explain:

1. Given that there are 50 black hats, those with a black hat will see 49 black hats.
2. So, given 50 black hats, those with a black hat can infer there are either 49 or 50 black hats.
3. If, there were 49 black hats, then those with black hats would see 48 black hats, and think there were 48 or 49 black hats.
4. If there were 48 black hats then those with a black hat would see 47 black hats and think there are either 47 or 48 black hats.
5. You keep peeling back this logic to the point that if somebody saw zero black hats he wouldn't know if his hat was black or white. So, when the king says there is at least one black hat it eliminates this problem.

So, while the king's statement may seem obvious, by using 50 layers of recursive logic, it does convey necessary information.

What bothers me about this response is I feel that I implied this in my original solution. Maybe I'm overlooking something that doesn't require 50 levels of recursive logic. Argh.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
RS
RS
  • Threads: 62
  • Posts: 8626
Joined: Feb 11, 2014
November 26th, 2015 at 9:18:55 AM permalink
Quote: Wizard

RE: BruceZ question #2



This is going to be hard to explain:

1. Given that there are 50 black hats, those with a black hat will see 49 black hats.
2. So, given 50 black hats, those with a black hat can infer there are either 49 or 50 black hats.
3. If, there were 49 black hats, then those with black hats would see 48 black hats, and think there were 48 or 49 black hats.
4. If there were 48 black hats then those with a black hat would see 47 black hats and think there are either 47 or 48 black hats.
5. You keep peeling back this logic to the point that if somebody saw zero black hats he wouldn't know if his hat was black or white. So, when the king says there is at least one black hat it eliminates this problem.

So, while the king's statement may seem obvious, by using 50 layers of recursive logic, it does convey necessary information.

What bothers me about this response is I feel that I implied this in my original solution. Maybe I'm overlooking something that doesn't require 50 levels of recursive logic. Argh.




But wouldn't the recursive solution require some form of communication, even if it's by delay?
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 26th, 2015 at 9:43:42 AM permalink
Quote: RS


But wouldn't the recursive solution require some form of communication, even if it's by delay?



Yeah. However Bruce never said my method was wrong, he just didn't like my explanation of why the hint was necessary.

I will say that measuring the length of a pause is definitely not allowed in my problem.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 26th, 2015 at 3:54:40 PM permalink
Quote: Wizard

Quote: RS


But wouldn't the recursive solution require some form of communication, even if it's by delay?



Yeah. However Bruce never said my method was wrong, he just didn't like my explanation of why the hint was necessary.

I will say that measuring the length of a pause is definitely not allowed in my problem.



Sure. Add more rules after I met all of yours. That's what I get for thinking outside the box. Grrrr....lol!
If the House lost every hand, they wouldn't deal the game.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 26th, 2015 at 4:36:43 PM permalink
Quote: beachbumbabs

Sure. Add more rules after I met all of yours. That's what I get for thinking outside the box. Grrrr....lol!



I thought it was implied when I said that no communication was allowed besides "white" and "black." If the time to submit a guess means something, then that is conveying information.

My problem has nothing to do with "thinking outside the box." There is a logical solution and it is not any kind of trick.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
November 26th, 2015 at 4:48:39 PM permalink
Quote: Wizard

I thought it was implied when I said that no communication was allowed besides "white" and "black." If the time to submit a guess means something, then that is conveying information.

My problem has nothing to do with "thinking outside the box." There is a logical solution and it is not any kind of trick.



I was teasing you. I saw you approved BruceZ's solution already and I was good with that. Just having some fun with it.
If the House lost every hand, they wouldn't deal the game.
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 29th, 2015 at 2:07:12 PM permalink
Quote: Wizard

RE: BruceZ question #2



This is going to be hard to explain:

1. Given that there are 50 black hats, those with a black hat will see 49 black hats.
2. So, given 50 black hats, those with a black hat can infer there are either 49 or 50 black hats.
3. If, there were 49 black hats, then those with black hats would see 48 black hats, and think there were 48 or 49 black hats.
4. If there were 48 black hats then those with a black hat would see 47 black hats and think there are either 47 or 48 black hats.
5. You keep peeling back this logic to the point that if somebody saw zero black hats he wouldn't know if his hat was black or white. So, when the king says there is at least one black hat it eliminates this problem.

So, while the king's statement may seem obvious, by using 50 layers of recursive logic, it does convey necessary information.

What bothers me about this response is I feel that I implied this in my original solution. Maybe I'm overlooking something that doesn't require 50 levels of recursive logic. Argh.


What the king's hint told them that they didn't already know was that...

...everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that everyone knows that there is at least 1 black hat.

That was 50 everyones. Before the hint, everyone knew that there was at least one black hat. Everyone knew that everyone knew that. Everyone knew that everyone knew that everyone knew that. And so on up to 49 everyones. But prisoner 1 did not know that prisoner 2 knew that prisoner 3 knew that prisoner 4 knew, that...that prisoner 50 knew that there is at least 1. He didn't learn that until the king made his announcement to all of them in each other's presence. Without that knowledge, they could not logically proceed with the inductive algorithm that the Wizard has described.

You can see this most simply when there are exactly 2 prisoners that each have black hats. They both know that there is at least 1 black hat, but neither will leave because neither one knows that the other one knows that there is at least 1 black hat. If someone tells them both at once, then they each know that the other knows, and then they will both leave when they observe that the other one has not left. When there are 3 people with black hats, prisoner 1 knows there is at least 1 black hat, and he knows that prisoner 2 knows this, but he does not know that prisoner 2 knows that prisoner 3 knows this. So he cannot deduce anything about the color of his own hat from the fact that 2 and 3 didn't leave.

Note that for the king's announcement to change anything, he must make it to everyone in each other's presence (or at least all the black hats) so that each can observe it being made to the others. If he merely tells them all separately it does no good. It would have been better had I said that they all came to the king at once and he told them, but you can deduce that must have happened in order for the king's hint to have made a difference.

This knowledge that everyone knows that everyone knows...forever has a name. It's called "common knowledge". In everyday speech, common knowledge just means that everyone knows something, but here it means much more than that. The fact that there was at least 1 black hat was known to everyone, but it did not become common knowledge until the king gave his hint. Then after the first time period, it became common knowledge that there were at least 2 black hats. After the second time period it became common knowledge that there were at least 3 black hats. After the 50th time period, it became common knowledge that there were at least 50 black hats. Everyone with a black hat then left, at which point it became common knowledge to those remaining that there were exactly 50 black hats.

Knowing what others know you know they know is an important part of poker. You think about what your opponent has, then you think about what he thinks you have, and then you think about what he thinks you think he has, etc. The goal is to think one level higher than your opponent.

The Wizard is correct about the 50 level recursion breaking down at the deepest level where we consider a player who sees 0 black hats. Apparently that's what he was alluding to even in his first reply. It's important to state that the knowledge the king gave them had to do with knowing what others know others know others know.... The case where someone sees 0 black hats is only important in the sense that prisoner 1 didn't know if prisoner 2 knew if prisoner 3 knew, that... that prisoner 50 knew there aren't 0 black hats. Prisoner 1 knew that there were at least 49 black hats, but he only knew that prisoner 2 knew there were at least 48, and he only knew prisoner 2 knew that prisoner 3 knew that there were at least 47, etc. They had no common knowledge that there was even 1 black hat. That is what the hint gives them. While I would like to have seen this stated explicitly , it's actually implicit in his recursion where he talks about what people infer. The people who see 49 are actually inferring something about what the people who see at least 48 would infer about the people who see at least 47, etc. So in my judgement I think that's sufficient for a win. I'll let the Wizard overrule me if he feels it shouldn't be sufficient.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27037
Joined: Oct 14, 2009
November 29th, 2015 at 2:29:07 PM permalink
Quote: BruceZ

I'll let the Wizard overrule me if he feels it shouldn't be sufficient.



I choose to let your decision stand ;-). So, I guess I never had to give out my mystery gift. Time for a new problem. If it is hard enough, I'll let it ride on that one.

Stay tuned.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
November 29th, 2015 at 3:19:48 PM permalink
I gave the wrong link for common knowledge before. That was just the everyday definition. Here's the logic definition. Note that this was only given a mathematical formulation in the relatively recent past (1976) and then in the 80s it became a topic of computer science.
  • Jump to: