Tom & Jerry and True/False Answers Logic Puzzle Jerry the mouse is hungry and according to some confidential information, there is a tempting piece of cheese at the end of one of the three paths after the junction he just found himself!
Fortunately, Tom is standing right there and Jerry hopes he can get some useful information as to which path he must get; most importantly because Spike and Tyke, the dogs, are at the end of the other two paths!
The only problem is that Tom gives true and false replies in alternating order. Furthermore, he has no way of knowing which will be first, the truth or the lie!
He is only allowed to ask Tom 2 questions that can be answered by a “yes” and a “no”.
What must be the two questions he must ask?

No matter how hard I tried, I can't figure out anything...
I have seen several variations for the 2 doors problem but this one is different!
 A: Think about a question of the following form:

If I were to ask you whether door X is the right door in the next question, what would you respond?

Tom will always lie when responding to this. Can you solve from here?
A: Let's say the doors are numbered $1,2,3$.
First question: "Is door 1 the correct door XOR are you telling the truth?"

If the answer is "No", Jerry will just go to Door $1$.
If the answer is "Yes" Jerry will ask similarly to decide whether to go to door $2$ or $3$
This solution works even if we have no idea about the pattern in which Tom lies or tells the truth. It also has the advantage that could work even for 4 doors.
However one could say it is "cheating" because each question contains(kind of) two smaller questions.
A: Here's another way to do it :) Ask the following question twice:

Are you telling the truth and the cheese is in the first path, OR are you lying and the cheese is in the second path?



*

*If both answers are True, then we know that in at least one of the two rounds, Tom was telling the truth. In that round, the only way this question could be true is if Tom is telling the truth and the cheese is in the first path.

*If both answers are False, then we know that in at least one of the two rounds, Tom was lying. In that round, by saying False, Tom indicates that the question is true. The only way that can be is if Tom is lying and the cheese is in the second path.

*If the answer switches from True to False or from False to True, then we know that the question was either true in both rounds, or false in both rounds. It can't be true in both rounds, because the cheese can only be in one path, and Tom can't tell the truth in both rounds or lie in both rounds. Therefore, the question was false in both rounds, and that means that the cheese is in the third path.

We can also explicitly map out the 6 possibilities:
1TF: Cheese in 1st path, telling the truth in 1st round, lying in 2nd round
2TF: Cheese in 2nd path, """
3TF: Cheese in 3rd path, """
1FT: Cheese in 1st path, lying in 1st round, telling truth in 2nd round
2FT: Cheese in 2nd path, """
3FT: Cheese in 3rd path, """

In each of these cases, here are the answers to our two questions:
$$
\begin{matrix}
\text{Case} & \text{Q1} & \text{Q2} \\
\hline
1TF & T & T \\
1FT & T & T \\
\hline
2TF & F & F \\
2FT & F & F \\
\hline
3TF & F & T \\
3FT & T & F
\end{matrix}
$$
As we can see, True in both rounds means first path, False in both rounds means second path, and switching means third path.
A: The problem with these knights (always truthful) / knaves (always lying) puzzles is that many of them can be solved the same way.  Simply ask:

"If I were to ask you is door X correct, what would you say?"  

A knave would have to lie twice, and therefore tell the truth.  No need to go into the mud about the next question, use an XOR etc.  All those solutions work too, but with the template above, you don't even need to think.  Which is sad.  :(
In fact, my answer is the plain-English way to say "Is door X correct IFF you are a knight?" (or equiv: "Is door X correct XOR you are a knave?")
Credit: IIRC I read this in one of the logic puzzle books by Raymond Smullyan
A: Firstly go through this question, famously coined the Hardest logic puzzle : https://youtu.be/LKvjIsyYng8  . This YouTube link is an excellent video explaining the question and then the answer. After seeing the video, try solving your question again. If you are still not able to solve your question, then read below.
Notice in the YouTube video, that

*

*If a statement is true and you ask anybody ( truth teller
or liar),
"If I ask you if this statement is true
then would you say yes then they
will reply, "yes" "
   "If I ask you if this statement is true
    then would you say "no" then reply 
    will be, "no".



*If a statement is false and you ask anybody ( truth teller
or liar),
"If I ask you if this statement is true
then would you say yes then they
will reply, "no" "
    "If I ask you if this statement is true
     then would you say "no" then reply 
     will be, "yes"

The basic logic needed to solve the "hardest logic puzzle" is is that if it is a true statement then using the method explained in the video,  both, a liar and a truthteller, will tell us that it is a true statement and if it is a false statement then both would tell us that it is a false statement. This is because, if a statement is true then "yes" gets a "yes" as a reply and "no" gets a "no" as a reply. If a statement is false then "yes" gets a "no" as a reply and "no" gets a "yes" as a reply.)
Now, that we know all this, it is easy to solve your question:
First question : if I were to ask you if you the first path leads to cheese then would you have said, "yes" ? If he says, "yes", then the cheese is at the end of the first path. If he says,  "no", then ask him the second question.
Second question: if I were to ask you if the second path leads to cheese then would you have said, "yes" ? If he says yes then the cheese is at the  end of the second path else it is at the end of the third path.
