Salaams

just ask the first 4 people which door leads to Islam.

the order can either be

t,f,t,f

or

f,t,f,t

either the lies will be insynch or they won't be in synch

If they are not in synch, then there is your answer.

ex. people may say:

door 1, door,3, door1, door 4

so obviously door 1 is it.

IF they are in synch like

door1,door2,door1,door2

then

then just ask the last person if door 3 is it.

if the person answers yes then he is lieing bcaz it has to be either

door1 or door 2.

If the person says no, then he is not lieing thus the

person before him must be lieng...

so if the person before him said door2, the answer will be door 1

?

Thank you llogical for your logical answer. But, as I said to LibertÃ©, the 5 persons can only say "Yes" or "No". Can you please modify your answer so that it takes this condition into consideration?

I don't think you made it a condition that the questions had to be answered with a Yes or No, but I should have guessed!

So...

Since we now know which person is truthful or a liar (by establishing which of the 2 the first person was).

We can ask the second person (P2) if door 1 (D1) is the one we want.

If the first person is truthful, then this person must be a liar so if he says YES then we know it isn't. If he says NO then we know it is and the problem is solved.

If the first person is a liar, then this person must be truthful so if he says NO then we know it isn't. If he says YES then we know it is and the problem is solved.

We can do the same to the remaining three people, each time either finding the correct door or eliminating one. So by the last person we have either found the door, or elimated 4 of them.

Problem solved?

You are very close to the solution, LibertÃ©. However, you didn't solve the problem, you know why?

Let's count how many questions you need to ask (in a worst case scenario) using your method:

Since we now know which person is truthful or a liar (by establishing which of the 2 the first person was).

This was one.

We can ask the second person (P2) if door 1 (D1) is the one we want.

That was question number two.

If the first person is truthful, then this person must be a liar so if he says YES then we know it isn't. If he says NO then we know it is and the problem is solved.

If the first person is a liar, then this person must be truthful so if he says NO then we know it isn't. If he says YES then we know it is and the problem is solved.

Since the two cases are symetrical, let's suppose p1 is truthful and therefore p2 is liar.

Remember, LibertÃ©, that you have asked 2 questions and therefore you have at most 2 other remaining questions.

We can do the same to the remaining three people, each time either finding the correct door or eliminating one. So by the last person we have either found the door, or elimated 4 of them.

You have only 2 remaining questions:

Question nÂ°3: you ask p3 (truthful, using my supposition) if d2 leads to Islam. If he says "Yes" you win, else you go to next step.

Question nÂ°4: you ask p4 (liar) if d3 leads to Islam. If he answers "No" you win. If he says "Yes", you will know for sure that either d4 or d5 lead to Islam, but there is no "next step" because you have consumed your 4 questions...

So which one, d4 or d5? You can't know...

Problem solved?

**Not yet!!**