# The knaves come out at night

Standard knights and knaves problem. There are 10 people in a room, you know that each person will either always tell the truth or always lie, but you don't know who is a truth teller or liar.

You are in a room with 5 doors. Four of the doors lead to horrible hazards like an endless pit, a fiery inferno, or being forced to visit your in-laws (the horror!), one of the doors leads to freedom.

What is the fewest number of questions you may ask to guarantee that you get out to freedom? What process would you use? It is assumed that all of the 10 people have knowledge of which door leads to freedom.

A) In this case I suppose you are allowed to ask only yes-or-no questions.
In this case 2 questions allows you to chose only between 2x2=4 options, so you need at least 3 questions.
It is very easy to formulate them. Just ask each time "What would you answer if I ask you blabla" and you will know the truth about blabla. Let's use WWYA shortcut for all these words. Then 3 questions you will need to ask:
1. WWYA is a freedom-door among first 4?
2. WWYA is a freedom-door among 1 and 2? (or just go to the 5th, if you've just got No)
3. WWYA is a freedom-door the 1st? (or "the 3rd", if you've just got No)

B) It is much more interesting to find a question when you are allowed to ask any questions. You can not ask "What you would answer if you are asked, which door leads to freedom?", since liar would answer the wrong door number and then it would lie about this number, but here he can use another wrong number, fortunately for him he has 3 more bad doors left.