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.

No, the Yellowstone supervolcano is not ‘overdue’

Why mega-eruptions like the ones that covered North America in ash are the least of your worries.

Ash deposits of some of North America's largest volcanic eruptions.

Image: USGS - public domain
Strange Maps
  • The supervolcano under Yellowstone produced three massive eruptions over the past few million years.
  • Each eruption covered much of what is now the western United States in an ash layer several feet deep.
  • The last eruption was 640,000 years ago, but that doesn't mean the next eruption is overdue.
Keep reading Show less

CRISPR: Can we control it?

The potential of CRISPR technology is incredible, but the threats are too serious to ignore.

  • CRISPR (Clustered Regularly Interspaced Short Palindromic Repeats) is a revolutionary technology that gives scientists the ability to alter DNA. On the one hand, this tool could mean the elimination of certain diseases. On the other, there are concerns (both ethical and practical) about its misuse and the yet-unknown consequences of such experimentation.
  • "The technique could be misused in horrible ways," says counter-terrorism expert Richard A. Clarke. Clarke lists biological weapons as one of the potential threats, "Threats for which we don't have any known antidote." CRISPR co-inventor, biochemist Jennifer Doudna, echos the concern, recounting a nightmare involving the technology, eugenics, and a meeting with Adolf Hitler.
  • Should this kind of tool even exist? Do the positives outweigh the potential dangers? How could something like this ever be regulated, and should it be? These questions and more are considered by Doudna, Clarke, evolutionary biologist Richard Dawkins, psychologist Steven Pinker, and physician Siddhartha Mukherjee.

Smartly dressed: Researchers develop clothes that sense movement via touch

Measuring a person's movements and poses, smart clothes could be used for athletic training, rehabilitation, or health-monitoring.

Technology & Innovation

In recent years there have been exciting breakthroughs in wearable technologies, like smartwatches that can monitor your breathing and blood oxygen levels.

Keep reading Show less
Personal Growth

Do you worry too much? Stoicism can help

How imagining the worst case scenario can help calm anxiety.