Can you solve what an MIT professor once called 'the hardest logic puzzle ever'?

Logic puzzles can teach reasoning in a fun way that doesn't feel like work.

neurons firing in brain
Credit: Shutterstock
  • Logician Raymond Smullyan devised tons of logic puzzles, but one was declared by another philosopher to be the hardest of all time.
  • The problem, also known as the Three Gods Problem, is solvable, even if it doesn't seem to be.
  • It depends on using complex questions to assure that any answer given is useful.

Despite the general dislike of mathematics that most profess to have, many people enjoy logic puzzles. This is strange, as many logic puzzles are just variations of math problems. Gleefully ignorant of this fact, many mathaphobes will try to solve riddles and puzzles of tremendous difficulty using reasoning tools they fear to employ when the subject is an equation.

Today, we'll look at a puzzle, the polymath who devised it, and why you should consider picking up a book of logical puzzles next time you are at the library.

This puzzle was written by the brilliant logician Raymond Smullyan. Born in New York 101 years ago, Smullyan earned his undergraduate degree at the University of Chicago and his doctorate in mathematics at Princeton, where he also taught for a few years.

An extremely prolific writer, he published several books on logic puzzles for popular consumption and an endless stream of textbooks and essays for an academic audience on logic. His puzzle books are well regarded for introducing people to complex philosophical ideas, such as Gödel's incompleteness theorems, in a fun and non-technical way.

Skilled in close-up magic, Smullyan once worked as a professional magician. He was also an accomplished pianist and an amateur astronomer who built his own telescope. Besides his interest in logic, he also admired Taoist philosophy and published a book on it for a general audience.

He also found the time to appear on Johnny Carson, where, as in many of his books, he argued that people who like his puzzles claim to dislike math only because they don't realize that they are one and the same.

The Three Gods Problem

One of the more popular wordings of the problem, which MIT logic professor George Boolos said was the hardest ever, is:

"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."

Boolos adds that you are allowed to ask a particular god more than one question and that Random switches between answering as if they are a truth-teller or a liar, not merely between answering "da" and "ja."

Give yourself a minute to ponder this; we'll look at a few answers below. Ready? Okay.

George Boolos' solution focuses on finding either True or False through complex questions.

In logic, there is a commonly used function often written as "iff," which means "if, and only if." It would be used to say something like "The sky is blue if and only if Des Moines is in Iowa." It is a powerful tool, as it gives a true statement only when both of its components are true or both are false. If one is true and the other is false, you have a false statement.

So, if you make a statement such as "the moon is made of Gorgonzola if, and only if, Rome is in Russia," then you have made a true statement, as both parts of it are false. The statement "The moon has no air if, and only if, Rome is in Italy," is also true, as both parts of it are true. However, "The moon is made of Gorgonzola if, and only if, Albany is the capitol of New York," is false, because one of the parts of that statement is true, and the other part is not (The fact that these items don't rely on each other is immaterial for now).

In this puzzle, iff can be used here to control for the unknown value of "da" and "ja." As the answers we get can be compared with what we know they would be if the parts of our question are all true, all false, or if they differ.

Boolos would have us begin by asking god A, "Does "da" mean yes if and only if you are True if and only if B is Random?" No matter what A says, the answer you get is extremely useful. As he explains:

"If A is True or False and you get the answer da, then as we have seen, B is Random, and therefore C is either True or False; but if A is True or False and you get the answer ja, then B is not Random, therefore B is either True or False… if A is Random and you get the answer da, C is not Random (neither is B, but that's irrelevant), and therefore C is either True or False; and if A is Random...and you get the answer ja, B is not random (neither is C, irrelevantly), and therefore B is either True or False."

No matter which god A is, an answer of "da" assures that C isn't Random, and a response of "ja" means the same for B.

From here, it is a simple matter of asking whichever one you know isn't Random questions to determine if they are telling the truth, and then one on who the last god is. Boolos suggests starting with "Does da mean yes if, and only if, Rome is in Italy?" Since one part of this is accurate, we know that True will say "da," and False will say "ja," if faced with this question.

After that, you can ask the same god something like, "Does da mean yes if, and only if, A is Random?" and know exactly who is who by how they answer and the process of elimination.

If you're confused about how this works, try going over it again slowly. Remember that the essential parts are knowing what the answer will be if two positives or two negatives always come out as a positive and that two of the gods can be relied on to act consistently.

Smullyan wrote several books with other logic puzzles in them. If you liked this one and would like to learn more about the philosophical issues they investigate, or perhaps if you'd like to try a few that are a little easier to solve, you should consider reading them. A few of his puzzles can be found with explanations in this interactive.

How New York's largest hospital system is predicting COVID-19 spikes

Northwell Health is using insights from website traffic to forecast COVID-19 hospitalizations two weeks in the future.

Credit: Getty Images
Sponsored by Northwell Health
  • The machine-learning algorithm works by analyzing the online behavior of visitors to the Northwell Health website and comparing that data to future COVID-19 hospitalizations.
  • The tool, which uses anonymized data, has so far predicted hospitalizations with an accuracy rate of 80 percent.
  • Machine-learning tools are helping health-care professionals worldwide better constrain and treat COVID-19.
Keep reading Show less

Listen: Scientists re-create voice of 3,000-year-old Egyptian mummy

Scientists used CT scanning and 3D-printing technology to re-create the voice of Nesyamun, an ancient Egyptian priest.

Surprising Science
  • Scientists printed a 3D replica of the vocal tract of Nesyamun, an Egyptian priest whose mummified corpse has been on display in the UK for two centuries.
  • With the help of an electronic device, the reproduced voice is able to "speak" a vowel noise.
  • The team behind the "Voices of the Past" project suggest reproducing ancient voices could make museum experiences more dynamic.
Keep reading Show less

Dark matter axions possibly found near Magnificent 7 neutron stars

A new study proposes mysterious axions may be found in X-rays coming from a cluster of neutron stars.

A rendering of the XMM-Newton (X-ray multi-mirror mission) space telescope.

Credit: D. Ducros; ESA/XMM-Newton, CC BY-SA 3.0 IGO
Surprising Science
  • A study led by Berkeley Lab suggests axions may be present near neutron stars known as the Magnificent Seven.
  • The axions, theorized fundamental particles, could be found in the high-energy X-rays emitted from the stars.
  • Axions have yet to be observed directly and may be responsible for the elusive dark matter.
  • Keep reading Show less

    Put on a happy face? “Deep acting” associated with improved work life

    New research suggests you can't fake your emotional state to improve your work life — you have to feel it.

    Credit: Columbia Pictures
    Personal Growth
  • Deep acting is the work strategy of regulating your emotions to match a desired state.
  • New research suggests that deep acting reduces fatigue, improves trust, and advances goal progress over other regulation strategies.
  • Further research suggests learning to attune our emotions for deep acting is a beneficial work-life strategy.
  • Keep reading Show less
    Surprising Science

    World's oldest work of art found in a hidden Indonesian valley

    Archaeologists discover a cave painting of a wild pig that is now the world's oldest dated work of representational art.

    Scroll down to load more…