A (hopefully) new variant on the Knights & Knaves problem.
On the island of D'Israel, the inhabitants fall into three types: Liars, Damned Liars, and Statisticians. They are visually indistinguishable except that each type of person wears a different colour of hat. If you ask them questions, their responses are as follows:
- a Liar will always give you a false response
- a Damned Liar will give you a false response and also stab you
- a Statistician will give you a true or false response with 50% probability.
You are trying to escape from a prison on this island, and you are nearly out when you reach a row of three doors, each one guarded by a solid-looking sentry. The three sentries wear red, green, and blue hats, so you know that one is a Liar, one a Damned Liar, and one a Statistician, but you don't know which is which. You also know (from the prison map which was smuggled in to you and which you have now lost) that one of the doors leads to freedom, one to the prison warden's office, and one to a first-aid room; but again you don't know which is which. Your aim is to pass through the door that leads to freedom, but if you are stabbed by the Damned Liar, you will first need to visit the first-aid room. If you go to the warden's office, you will be recaptured; but going through either of the other doors allows you the chance to double back and try again if necessary.
You are being pursued, so you only have time to ask the guards one yes/no question to find out which door you should go through. What question should you ask? What is the probability you will escape?
How does the answer change if you have time for two or three questions?
This is a logic puzzle. Please, no lateral-thinking answers.