A tourist is enjoying an afternoon refreshment in a local pub in England when the bartender says to him: “Do yu see those 3 men over there? One is Mr. X who always tells the truth, one is Mr Y who always lies and one is Mr. Z who sometimes lies by randomly answering questions with yes or no.
You may ask them 3 yes or no questions indication who should answer. If after asking these questions you can identify Mr. X, Mr. Y and Mr.Z, they will buy you a drink. What yes or no questions should the thirsty tourist ask?
The first question is important. It should be asked in such a ways so that you can eliminate Mr.Z. It is easier to deal with a person who always tells the truth or who always lies.