AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

The Hat Riddle and Other AI Conundrums
 
 

The following is an advanced logic problem which requires the use of “Don’t Know” and “Don’t Care” to solve, in addition to the more familiar “True” and “False” values and the usual predicates such as “implies”, “and”, “or” etc. As impossible as it might seem at first glance, there really is a robust, provable solution.

I wonder how WATSON would cope with this one.

———————————————————————————————————

The prison warden tells his three best behaved prisoners that in the morning he will give them all one chance to get out of jail free.

When they wake up, they are to dress quickly and all go to a specific room. At no time are they allowed to communicate with each other in any way. They will each have a red dot or a white dot on their foreheads.

Anyone who can see a red dot on another’s forehead is to tap on the floor. Anyone who can guess the colour of the dot on his own forehead correctly will go free, but if he gets it wrong, he will never be released.

In the morning they do as they have been told. All three prisoners tap on the floor. After a couple of minutes, one of them tells the warden the colour of the dot on his forehead and he is allowed to go free.

What colour was the dot on his forehead, and how did he know?

 

 
  [ # 1 ]

That’s an interesting problem, Andrew. I think the “obvious” answer, that all the dots were red, would have to be incorrect, based on nothing more than the “that’s too easy” principle. As to how the prisoner deduced his color, I’m completely clueless, but given the circumstances involved, my intuition says that the mark was red. I just can’t tell you why that would be. smile

 

 
  [ # 2 ]

He saw a mirror while getting dressed. smile

Okay, serious attempt. Assuming there must be both red and white dots present, then whoever sees 2 red dots will know he is the white dotted one. No floor tapping required.

Or more rigorously: Each prisoner only looks at one other prisoner at a time. He sees the other prisoner’s red or white dot and taps the floor accordingly. Each man learns his own dot color and so long as there are at least two red dots, each man will have tapped the floor at least once (it is never specified how often they tap the floor).

Now taking into account the “don’t know, don’t care” philosophy: The prisoner decided he didn’t care about this tapping nonsense, so just took a guess and got it right. smile

I think I’ve heard of a variation of this puzzle with colored hats in which there is no definite winning strategy and one must use probability to choose the best possible strategy. Which may be where you’re going with “requiring the use of don’t know”.

 

 
  [ # 3 ]

At least two of the prisoners must have red dots, as all three tapped the floor. If two were white and one red, the one with the red dot wouldn’t have tapped. If all three were red, the puzzle is unsolvable I think.

Now assume that there are two red dots and one white, the prisoner who shouts out his colour must have a red dot, as he can see a red dot and a white dot on the other two prisoners. If he had a white dot, the other prisoner with a red dot would not have tapped, as he would only be able to see two white dots.

Hope I explained that correctly. It is 11:30pm here in England and I am just about ready for my bed.

 

 
  [ # 4 ]

My deduction:
The dot on the free prisoner’s head is red.
The other two are white and red.
WWW-no taps
WWR- 2 taps
WRR- 3 taps
RRR - 3 taps

The free prisoner sees a white and red dot on the other 2.
If he had a second white dot then the prisoner with the red dot would have seen 2 whites and not tapped.

 

 
  [ # 5 ]

That’s what I figured out too but I don’t know why he would wait a couple of minutes unless there’s more to it than we’ve understood.

 

 
  [ # 6 ]

If he had waited until the other 2 had guessed;

The white hat guessed red, seeing 2 reds. He only had a 50/50 chance, because with 3 taps his could have been either red or white.
The other red guessed white, seeing a red and white, thinking it a 50/50 chance. He could have also guessed correctly.

 

 
  [ # 7 ]

He waited for the others to figure it out.  Since they could not, they both must have seen red.  Since he couldn’t tell quickly, he must see both the others had red dots.  Therefore he concluded that he had red also otherwise it would have been too easy to be freed. Anyway, what did he have to lose?  He probably would not be freed ever anyway, especially when the warden played these kind of games, all had red dots!

 

 
  [ # 8 ]

Gary is correct.

The points to note are that the penalty for a wrong answer was severe so nobody would have been prepared to guess, and nobody knew the answer straight away.

As Merlin pointed out, there are four possible combinations of coloured dots and while it is not possible to narrow the answer down to the correct one based on direct observation, if you take into account what everybody knows or doesn’t know, then you can eliminate all but one possibility.

WWW - 0 taps, nobody sees red so everybody knows they must have white
WWR - 2 taps, one person cannot see red, so the two who can see red know they must be white
WRR - 3 taps, two people can see a red and a white so they know they must be red
RRR - 3 taps, three people can see red but nobody can be sure if they are red or white

 

 
  [ # 9 ]

But if all three tapped then there must be either RRR or RRW. Assuming RRW, as the puzzle is impossible otherwise, any prisoner with a red dot would instantly know they had a red dot, as they can see one red and one white. I still don’t follow why they waited?

 

 
  [ # 10 ]

In the RRW case, two of the prisoners would have been able to work out that they had red dots without having to know anything but what they could see for themselves, and that all three had been able to see a red dot. That’s the “don’t care” case.

In the RRR case, none of the prisoners could work out with certainty which colour they had based on the dots that they could see for themselves, and knowing that all three had been able to see a red dot.

Since none of them were able to answer straight away, they could eliminate RRW as a possibility if they waited, leaving RRR as the only possible combination. That’s the “don’t know” case.

 

 
  [ # 11 ]

Ah I see. So all three must have had red dots. I get it now *doh*

 

 
  [ # 12 ]
Steve Worswick - Jul 6, 2011:

That’s what I figured out too but I don’t know why he would wait a couple of minutes unless there’s more to it than we’ve understood.

Maybe he was like me and it took him some time to work it out.wink

 

 
  [ # 13 ]

Hey I saw this problems, here and there, and can shed some light on this

All this issues (even the 4 states: TRUE / FALSE / DON’T CARE and DON’T KNOW logic) can be modeled easily converting them into FOL (First Order Logic) and then solving them as logic propositions, using Euler method or whatever theorem solver engine (google this). Normally this problems are converted into a PROLOG program and queried inside the inference engine. SWI prolog is a good one. The logic can be written as propositions and even as N3 notation (triads)

This logic should be inside AIML and every serious bot engine, like WATSON, but unfortunately no one (I might know of) managed this to work fine, even Chatscript engine which is much more advanced than AIML!

There are several kind of problems convertible into FOL, not all are solved, but its a start!

For example the famous Einstein problem is one of them, also easier problems like Family-Relations are solved this way easily. for example (this is not intended to be a puzzle)

Bob is son of Peter, Mary is mother of Bob, Angela has a sister called Mary, Robert is son of Angela, Karl is friend of the father of Peter, Andrew is Friend of Robert and son of Mary’s sister, Peter is Robert’s uncle.  ¿what relation has Bob and Andrew? ¿get all emerging relations and possibilities?

Many of this problems have no solution at all, other do have many solutions, and other do have only one, the spectrum is full, this kind of problems are memory-intensive and depending upon each specific structure, they can be NP hard, so they could not be solved in polynomial times!

Another way to model all this things is Fuzzy-Logic, but there are no general solver for this logic, only converting the problems into multiple propositions FOL, may attach a solution-method.

in the hope this may render useful to anyone here! smile
best regards!

 

 
  [ # 14 ]

FOL would have only got you to the point of a case where they might not know what to answer. It doesn’t make the connection that a duration of time elapsing can also confirm the answer. These class of problems are best solved with plot-units. As I pointed out, further support of the conclusion included the intentions of the actors such as what the warden was doing by presenting the test.  Plot-units explain why the prisoners did not answer quickly and what was involved with that. Stories are created by applying plot-units.

This is different from other time oriented math problems such as: Alice is thrice the age as Sue. In three years Alice will be twice the age of Sue. How old are Alice and Sue?

It those math problems, the wait is something totally different.

Again, knowing all the possible outcomes of the meaning of the taps (FOL) brings you to a blocking point for resolving the situation. Understanding how people act overcomes that impasse.

 

 
  [ # 15 ]

Understanding how people act overcomes that impasse.

Good point.

 

 1 2 3 >  Last ›
1 of 5
 
  login or register to react