# I do not speak lies

A person was travelling in the middle of an empty road.

As he walked, he saw five doors, with guards in front of each one.

The first guard said, "If all the other four tell the truth, then so shall I. Pass through my door, it is safe."

The second guard said, "Whom you ask before me, if he has lied, then so will I. Pass through my door, it is safe."

He then asked the third guard, who replied, "You shall ask a guard after me. Shall he say the truth, and the first guard doesn't lie, I shall not lie. Shall he say falsehood, and the first guard doesn't lie, I shall say the truth. In other cases, I shall always be a liar. Pass through my door, it is safe."

When he asked the fourth guard, the fourth guard replied, "If the number of liars is more than the number of truth tellers, I shall lie. If the number of truth tellers is more, I shall tell the truth. Pass through my door, it is safe."

When the fifth guard was questioned, he replied, "If guards 2 and 4 lie, I shall not lie. Pass through my door, it is safe."

Guards will only lie about which door is safe. They won't lie about other things.

There is only one actually safe door. Which one is it?

• In a comment, @TheBitByte says that the first guard tells the truth only if the other four tell the truth. I think this should be stated in the question. – JiK Sep 9 '16 at 9:39

Door 5 is safe.

Why?

The first guard's statement means he can't tell the truth, considering there's only 1 correct door. 1 is out.

Okay...

Guard 2 says that if Guard 1 lies, he will also. 2 is out.

Nice.

The third guard's only two truth-telling scenarios all rely on Guard 1 telling the truth. Therefore, he must be lying. 3 is out.

Coolio. Last elimination now...

The fourth guard's going to follow the majority. The problem requires that only 1 door be correct, so he will lie because 3 other guards must lie as well. Plus, we've already deduced that three of them are lying. 4 is a liar as well.

Wrapping up...

The fifth guard will tell the truth if the first even guards lie. They do, so door 5 is safe to pass through!

• (Personally I think the question is rather ambiguous, and the sort of reasoning apparently required here -- employed by both you and Rand despite your disagreement on some of the details, and clearly the kind of thing the questioner intends -- is also the sort of thing that lets you prove anything ("Either this sentence is false, or Santa Claus exists").) – Gareth McCaughan Sep 9 '16 at 1:17
• It's absolutely standard here for someone who thinks an answer is wrong to just say so and explain why, and if you find that rude then I fear you'll be shocked at what a rude lot we are. On the other hand, telling someone to shut up is definitely not polite. – Gareth McCaughan Sep 9 '16 at 1:20
• I'm not expecting a full forum of "You're right! Everyone's right!" I'm just saying, be humble! If you're really right, your logic and your original version of the answer will rise to the top. – ToTheMax Sep 9 '16 at 1:28
• @ToTheMax Congrats on getting the right answer! – Buffer Over Read Sep 9 '16 at 2:06
• Why does the first guard's statement mean he can't tell the truth? – JiK Sep 9 '16 at 9:37

We know that only one of the five doors is actually safe. But each guard says his door is safe, so four of them are lying and one is telling the truth.

This means we can draw the following conclusions.

• There are more liars than truth-tellers, so the 4th guard is lying.

• If the 3rd guard is telling the truth, then

the 1st guard must be lying. So according to his own third sentence, he (the 3rd guard) is a liar. Contradiction.

• Now, if the 2nd guard is telling the truth, then

the 1st guard must be lying. So according to his own first sentence, he (the 2nd guard) is a liar. Contradiction.

• Now the 5th guard's statements contradict each other. The 2nd and 4th guards are lying, so by his first statement he's telling the truth; but if he's telling the truth, then the 1st and 3rd guards must be lying, so by his second statement he will never tell the truth.

• The 1st guard's statement, "If all the other four tell the truth, then so shall I", is vacuously true, since the other four can't all tell the truth. However, the OP of the question has also said in a comment that the 1st guard tells the truth only if all the other four tell the truth too. This extra information means the 1st guard is lying.

So the correct solution must be

the 5th door.

• The first guard tells the truth only if all the other four tell the truth too. Are you aware of this? – Buffer Over Read Sep 9 '16 at 1:34
• @TheBitByte I wasn't aware of it, because you just said "if" and not "only if" :-) Now I am ... let's see what that changes. – Rand al'Thor Sep 9 '16 at 1:37
• @TheBitByte Hang on - with the latest edit to the question, the first guard's first statement ("If all the other four tell the truth, then so shall I") is still vacuously true! – Rand al'Thor Sep 9 '16 at 1:38
• @TheBitByte That's fair - he did get the intended answer first. However, the 5th guard's second statement is still incorrect (1 and 3 do lie, but 5 still tells the truth) and the 1st guard's first statement should be its converse ("if I tell the truth, then so do all the other four" rather than the other way round). I'm sorry to keep nitpicking, but you should have got all these things fixed up before you posted the question :-) I ended up losing out by doing the logic too rigorously, while someone who was less careful got the intended answer without spotting why it doesn't quite work. – Rand al'Thor Sep 9 '16 at 2:26
• Sorry if my question was confusing. I did edit it to clear up some things, so I hope it's fine now. I'll try to sort out all issues before I post the next time. – Buffer Over Read Sep 9 '16 at 2:27

So, I think I got it as well. Only one door is safe, so that means only one guard is telling the truth.

Guard 1:

He could be telling the truth (since it doesn't say he ONLY tells the truth if all others are telling the truth), but it isn't certain because the other four are definitely not all telling the truth.

Guard 2:

There are 2 possibilities: If Guard 1 has lied, he is a liar according to his statement. If Guard 1 told the truth, then since there is only one speaking the truth, Guard 2 is still a liar. Thus, we can conclude that Guard 2 is a liar.

Guard 3:

He's a liar, but that is not relevant for searching the truth-teller.

Guard 4:

4 lairs, 1 truth-teller. That means, he's a liar according to his own statement.

Guard 5:

We have deduced that #2 and #4 are liars, so he's telling the truth and therefore his door is safe. We can also conclude that the unknown, #1, is a liar because the truth of #5 is 100% certain and therefore eliminates #1.

To conclude:

Guard 5's door is safe.

After looking at the other answers, I'm glad I got here after the edits were made, it was much clearer.

Door 5 is safe.

Guard 1 only tells the truth if all of the others tell the truth in which case everyone would be telling the truth, which cannot be, so he has to lie.

Guard 2 has to lie because Guard 1 has.

Guard 3 always lies if Guard 1 has lied, so he has to lie.

We now have 3 liars out of 5 therefore Guard 4 also has to lie.

Guard 5 has to tell the truth because 2 and 4 are liars.

• Welcome to Puzzling! This answer seems to duplicate content from the accepted answer from 14 hours ago. Make sure to read other answers before posting your own! – Deusovi Sep 9 '16 at 14:39