“The Hardest Logic Puzzle Ever”

A few years ago, my friends and I were playing a game online, and somehow, the topic of logic puzzles came up. One of them challenged me to solve “the hardest logic puzzle ever,” and I accepted that challenge. To my surprise, I found that the puzzle is actually called “the hardest logic puzzle ever” once I began working on it. I can’t say if this is actually the hardest logic puzzle out there, but it is definitely a contender for the name. This is one of the things that inspired me to write my own logic puzzles book Mental Mosaics, where I’ve included this puzzle in the “Notable Puzzles” chapter of the book, along with my own unique solution to the puzzle.

In the sections below, I’ll introduce the puzzle, discuss the historical background, provide some helpful hints and strategies for solving the puzzle, then provide my own unique solution.

The Hardest Logic Puzzle Ever

The puzzle reads:

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 only answer questions in their own language. The words for yes and no are da and ja, in some order, but you do not know which word means which.

Can you determine the identities of each god, and if so, how?

Historical Background

This puzzle became famous in the 1990s when logician George Boolos published it in The Harvard Review of Philosophy in 1996, along with his own solution to the puzzle. It was originally created by logician Raymond Smullyan, and computer scientist John McCarthy is credited with adding the additional restriction of da and ja, making the puzzle even more difficult and interesting. This puzzle is essentially an amalgamation of concepts and difficulties present in various logical puzzles that already existed at the time of this puzzle’s creation, combined in such a unique way as to make this puzzle immensely challenging.

Hints for Solving this Puzzle

Before reading the rest of this article, I encourage you to try to solve this puzzle on your own. If you aren’t able to, then this section will give you some useful insights without revealing the answer.

This puzzle is too difficult to solve purely with straightforward questions, such as “are you the truth teller?” or “is today Friday?”, primarily because the existence of the random god initially prevents us from trusting whatever answer we get from whomever we ask, as the answer could be true or false because the god is a truth teller or a liar, but the answer could also be true or false by coincidence of random selection. If there were a way to narrow down who definitely is, or isn’t, the random god, you would be able to proceed accordingly.

The da and ja rule also makes the problem of identifying each god more difficult, but it doesn’t make it impossible. Note that while the meaning of each word da and ja is unknown to you, the meaning itself is invariant; it doesn’t change each time the gods speak. They themselves know what da and ja mean, and they will always use those words correctly. Since this consistency is guaranteed, we can still use the responses given to us, even if we don’t know what da and ja actually mean.

When I first worked on this puzzle, I started with a slightly simplified version by removing the da and ja rule, so each god would respond with yes or no. If you are having trouble with the puzzle, I recommend you also try this simpler version to help build your understanding of this problem.

In this section, I’ll outline my solution to this puzzle, then an explanation of why it is sound. Before I proceed, note that this isn’t the only sound solution. Any solution is sound as long as it guarantees we can identify which god is which in all scenarios.

In the section, I’ll outline my solution to this puzzle, then an explanation of why it is sound. Before I proceed, note that this isn’t the only sound solution. Any solution is sound as long as it guarantees we can identify which god is which in all scenarios.

Solution

Ask God B a question, and then ask a God A or God C the remaining two questions. Those two questions are the same in either case, but you will direct those questions to one God or the other based on the response from God B. The steps are shown below:

    1. We start by asking God B, “If I were to ask you if God A is the liar or God C is the truth teller, would you answer ‘da’?”

      1. If God B responds with “da,” we can infer that God A cannot be the random god. We then proceed to ask God A, “If I were to ask you if you are you the random god, would you respond ‘da’?”
          • If God A answers “da,” we know that A must be the liar. We then ask A, “If I ask you if B is the random god, will you reply ‘da’?”
              • If A responds “da,” we can deduce that A is the liar (since A always lies), B is the truth teller (since the liar would lie about the random god), and C is the random god.

              • If A responds “ja,” then A is the liar, B is the random god, and C is the truth teller.

          • If God A answers “ja,” we know that A must be the truth teller. We then ask A, “If I ask you if B is the random god, will you reply ‘da’?”
              • If A responds “da,” we can deduce that A is the truth teller, B is the random god, and C is the liar.

              • If A responds “ja,” then A is the truth teller, B is the liar, and C is the random god.

    1. If God B responds with “ja,” we can infer that God C cannot be the random god. We then ask God C, “If I were to ask you if you are the random god, would you respond ‘da’?”
      • If God C answers “da,” we know that C must be the liar. We then ask C, “If I ask you if B is the random god, will you reply ‘da’?”
          • If C responds “da,” we can deduce that A is the random god, B is the truth teller, and C is the liar.

          • If C responds “ja,” then A is the truth teller, B is the random god, and C is the liar.

      • If God C answers “ja,” we know that C must be the truth teller. We then ask C, “If I ask you if B is the random god, will you reply ‘da’?”
        1. If C responds “da,” we can deduce that A is the liar, B is the random god, and C is the truth teller.

      1. If C responds “ja,” then A is the random god, B is the liar, and C is the truth teller.

Explanation of Solution

The explanation for this solution is a bit long and technical, so I’ve decided not to include the full explanation in this post. The full explanation, how it works, and why it works in all cases, can be found in my puzzles book Mental Mosaics: A Unique Collection of 200 Puzzles on Logic, Lies, and the Limitless.

If you enjoy puzzles such as this, I’m sure you’ll enjoy the range of puzzles I’ve created for Mental Mosaics!


Leave a Reply

Your email address will not be published. Required fields are marked *

BRANDON QUINN
SUBSCRIBE TO MY NEWSLETTER

© 2023 Brandon Quinn. All Rights Reserved