Logic problem

In The Pyramids of Mars, Sarah-Jane Smith is trapped. There are two switches, one of which will release her, one of which will kill her. There are two guardians,  one of which tells the truth, the other always lying. The Doctor can ask one guardian one question. He asks,

“If I asked the other guardian which was the life switch, which would it indicate?”

The liar will lie about the truth-teller, and so indicate the death switch. The truth-teller will tell the truth about the liar, so indicate the death switch. The Doctor presses the other switch and Sarah is released.

John Finnemore did a sketch in which the guardians are fed up because everyone now knows what to ask- so they introduce a third guardian who strictly alternates, lying in one answer then telling the truth in the next. You will not know whether the alternator will lie or tell the truth, because you do not know which it did last time, to the last intrepid explorer. It will only change from lying to telling the truth if asked a question. There are still a life switch and a death switch. The only permitted questions are those which can be answered by a guardian pointing at a switch.

If you ask the first guardian, which is the Life switch, then ask the first the same question again, and the answers are different, you know that the first is the alternator, and you can ask the second guardian the Doctor’s question about the third. If the first’s answers are the same, and you ask the second guardian the same question twice, if the second’s answers are the same the third is the alternator: ask the first the Doctor’s question about the second; but if the second’s answers differ then it is the alternator, and you ask the first the Doctor’s question about the third. So you can always identify the life switch in five questions, and sometimes with three.

However, I can always identify the life switch with three questions.

What questions do you ask so that, whatever the answers, you can always find the life switch with three questions?

Call the guardians 1, 2 and 3 and the switches X and Y. Kudos to anyone who answers this. If anyone asks, I will answer it in a week, in the comments. (Added: The answer is now below, in the comments.)

I have no idea if anyone else has worked on this puzzle. It seems likely someone has. I thought I had answered it, then found a flaw in my argument, and scheduled this post for 1 April; but now, I am clear that I have answered the puzzle.

11 thoughts on “Logic problem

  1. I do logic problems, Clare, and I normally would be able to work this out with just the two guardians – it’s a play on the old “Knights and Knaves” logic problem which has been around for centuries. However, putting in the alternator has really thrown the spanner in the works, and to answer it in 3 questions, I’m going to have to think about this and get back to you.


    • Playing on Wikipedia, I found The Hardest Logic Problem Even:

      Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.

      It is not quite the same. I have not looked at the solution, and will not before I find it- or try fairly hard. In my puzzle, you ask them to indicate gates, and they point wordlessly.


    • So clare I think this is the answer ask 1,2 and 3 a simple question like what’s 1+1,chances are one will tell the truth let’s say 1 says 3,2 says 5 and 3 says 2,if two answer truthly ask a different question,then ask which one is the death switch X or Y,keeping your eye on the truthful one and answer will be the switch that relases you.
      The impossible girl


      • Sorry, that is not it. You can ask a question to which the answer is that they indicate a switch. So you ask questions such as, “Which is the life switch?” Or “Which would Guardian 2 say is the life switch?” They cannot talk, only point.

        I thought of them only pointing to the switches, and have three questions which always get the right answer with that rule, but it might be easier if they could point at the guardians as well, so you could ask, “Which is the truth-teller?” But I have not worked out a solution with that option, and I think a solution with questions asking them to point to a switch is easier to work out.

        Added: I have amended the post to state that the only permissible questions are ones answered by a guardian pointing to a switch. That is the only puzzle where I have the answer!


  2. Hi Clare. In the spirit of the riddle, this probably-wrong answer was drafted prior to reading any comments. If each of the 3 guardians can only point to one switch (because pointing to both would not be a valid answer) and if the 3 guardians know each other well enough to know which will lie (even down to knowing which channel the alternator is on), then one question, it seems to me, could be asked of each of the 3 guardians in turn: “If I asked the other two guardians to indicate the Life switch, which one switch would they both indicate?” This question is a modification of the Doctor’s question. The only switch that any of the 3 guardians will possibly point to (when they aren’t stumped) is the Death switch.

    Liked by 1 person

    • You know, I did not think of stumping them? That works. I will need to add another rule. If there is no answer to your question they will kill you, or the others will go on strike and not answer any more questions, or something. Bugger.


      Liked by 1 person

        • I take the liberty of finding my answer more elegant:

          The Answer
          (spoiler space)

          There are three guardians. One always tells the truth, one always lies, and one strictly rotates: if it lies, it will tell the truth the next time; if it tells the truth, it will lie the next time. There are two switches, death and life. Call the guardians 1, 2 and 3 and the switches X and Y.

          Ask 1, if I asked 2 which was the life switch, which would it indicate?
          Ask 2, if I asked 3 which was the life switch, which would it indicate?
          Ask 3, if I asked 1 which was the life switch, which would it indicate?

          It is impossible for them all to give the same answer, because all cases where they give the same answer involve a contradiction.

          The other possibility is that two indicate one switch, and one indicates the other. The switch indicated by only one guardian is the life switch.

          Liked by 1 person

All comments welcome.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.