Index
Boolean Enlightenment

The path to enlightenment lies behind one of two doors. In front of each door stands a guard who knows which door leads to enlightenment, but one of the guards always lies and the other one always tells the truth. In your search for enlightenment, you are allowed to ask one guard only one question that can be answered "yes" or "no", but unfortunately, you do not know which guard is the liar. You will be banished to the dungeon of logical illiteracy if you fail in your quest. What question should you ask to find the path to enlightenment?

If you ask a guard directly "Are you guarding the path to enlightenment?", and the answer is "no", he could be guarding the path to enlightenment and be lying about it, or he could be telling the truth and the path to enlightenment is behind the other door.

The question that you ask has to involve both guards at the same time:

"Would the other guard say that you are guarding the path to enlightenment?"

When we ask a guard this question, there are 4 cases:

1. The liar is guarding the path to enlightenment. He answers "no" because the truthful guard would say "yes".
2. The liar is not guarding the path to enlightenment: He answers "yes" because the truthful guard would say "no".
3. The truth teller is guarding the path to enlightenment. He answers "no" because the other guard (liar) would say "no".
4. The truth teller is not guarding the path to enlightenment. He answers "yes" because the other guard (liar) would say "yes".

So, if a guard answers "no", he is guarding the path to enlightenment. If he answers "yes", the path to enlightenment is the other door. Notice that even though we have learned which is the path to enlightenment, we still don't know which guard is the liar. To find out who is the liar we would have to ask a question like: "Would the other guard say that you always tell the truth?" A reply of "no" means you are talking to the truth teller, a reply of "yes" means you are talking to the liar.

Reader Jay Jordan analyzed this problem carefully and had this to say:

I really enjoyed your web page. I am an amateur puzzle enthusiast and have a comment (and a correction) on the "Boolean Enlightenment" puzzle. In this puzzle one guard always tells the truth and one always lies, the problem being which question to ask and can only ask one yes/no question of either of two indistinguishable guards in front of the road which might be to enlightenment.

There really are an infinite number of questions you can ask (though the phrasing of them gets tedious as I will explain...) but the correct answer provided on the site certainly isn't the only one.

The statement on the site "The question that you ask has to involve both guards at the same time" isn't exactly true. The real nature of the question is that it has to be a self-referential question, with an odd number of "nestings" or "layers" of reference regardless of whom the question is about.

By way of example, you can disprove the need for involvement of both guards by asking one guard, "If I were to ask YOU: 'Are you protecting the road to enlightenment', would you say yes?" This only involves one guard and does not reference the other. Using a similar format to your distribution of possible permutations, consider the following scenarios:

1. The liar is guarding the road to enlightenment
2. The truthful guard is guarding the road to enlightenment
4. The truthful guard is guarding the road not leading to enlightenment

If the guard says Yes, you can be confident it is the road to enlightenment he is guarding. If he says No, the opposite is true. The reason for this is, the guard is making a response about how he would evaluate your question, rather than an answer to the direct question "embedded" in your query to him:

1. He says Yes because he has to lie about the fact that he is a liar and would have tried to deceive you by answering "No"
3. He answers No because he has to lie about the fact he would have lied by saying Yes this is the road
4. He answers No because he tells the truth about how he would have responded.

Whom you ask 'about' doesn't matter, whether you ask about "he" would have responded or the "other" guard would have responded simply inverts the answer and you take the face value of his response as being opposite to the truth; a No means it's the right one and vice-versa.

1. No
2. Yes
3. Yes
4. No

You are thus confused because you can't discern from the answer whether it's the liar or the truth-teller, and thus the ultimate meaning of his response.

However, if you add yet another layer (third layer) it again inverts the response given by the liar and once again removes the ambiguity. The increasingly complex question would sound something like this: "If I were to ask the question: 'If I were to ask you the question: 'If I were to ask you whether you're guarding the road to enlightenment, would you say yes', would you have responded to that question in the affirmative?'... would you respond to THAT question in the affirmative?" The truth table again looks like this:

1. Yes
2. Yes
3. No
4. No

You can see the truth teller's response doesn't change but the liar's does with each 'layer' you add. For example examining outcome #1, the liar guarding the road to enlightenment knows he's guarding the road to enlightenment, so:

Layer 0 - If you were to ask him Are you guarding the road to enlightenment, he would have lied and said, No.
Layer 1- He knows he would have lied and said no, so the answer to the question-about-the-question he would have given is Yes.
Layer 2- He knows he would have lied with a Yes, and thus he lies and instead says No (question about a question about a question)
Layer 3- He knows he would have lied with a No, and says Yes (question about a question about a question about a question).

Another way of looking at it is by plotting the "nesting levels" against the Y/N response. If you were to use brackets to help clarify, a highly 'nested' question might begin something like "If I were to ask you (If I were to ask you (If I were to ask you (If I were to ask you..." etc. etc. Once you grasp the pattern you can see what I mean about the even or odd numbers of nesting.

 Scenario# Nesting level 1 2 3 4 5 6 ... #1 Y N Y N Y N ... #2 Y Y Y Y Y Y ... #3 N Y N Y N Y ... #4 N N N N N N ...

You can see how the liar flips his response with each added layer but the truth-teller is consistent in his answer no matter how many levels of questions nor how complex it starts to sound. The real solution is thus that you have to phrase the question with an odd number of self-references, one, three, five, seven, etc. The simplest is a question with only 'one' layer. But again, it won't matter if you ask the question about how "he" would answer or the "other guard" would answer, both are valid tests so long as you recognize that changing the subject (guard) of the hypothetical question inverts the answer.

George Boole (1815-1864) was an English mathematician and logician who devised a system for representing logical symbolic relationships now known as Boolean algebra. The logical relationships, called Boolean expressions, use the logical operators AND, OR, and NOT between entities. These expressions have application in computer circuit design, information retrieval strategies, and logic problems such as this. Tables that list all the outcomes of a logical expression, like our four cases above, are known as "Truth Tables".