Logic & ParadoxesPuzzle solution
Hardest Logic Puzzle Ever: You Never Learn What 'Ja' Means
Source card
Texts this entry reads, by coordinate and edition.
- The Harvard Review of Philosophy 6(1), pp. 62–65George Boolos, "The Hardest Logic Puzzle Ever" (1996), bibliographic recordthe rules on this page are this site's own statement of the puzzleSource [1] · open the text
Generated illustrationThree questions are enough to name all three gods, and you finish without knowing what ja means. That is the shape of the hardest logic puzzle ever, the title of a paper by George Boolos published in 1996. The solution turns on one device: a question built so that a truthful god and a lying god both answer ja exactly when a statement is true, whatever ja means. The complete steps sit in the folded solution below, and a program verified them against all 96 possible cases.
The puzzle, restated
Boolos's paper is listed on this page from its bibliographic record, so the rules below are this site's own statement of the puzzle, not a quotation from it. Three gods, A, B and C, are True, False and Random, in an arrangement you do not know. True always answers truthfully and False always answers falsely, while in the version solved here, Random answers ja or da and you are not told how it picks.
The gods understand ordinary questions but reply only with two words of their own language, ja and da. One word means yes and the other means no, and nothing in the puzzle tells you which is which. You get three yes-or-no questions in all, each put to one god. You may ask the same god twice, a later question may depend on earlier answers, and every question must have a definite yes-or-no answer for True and False.
Puzzle card
The Hardest Logic Puzzle Ever title of Boolos 1996
- Type
- truth-value this site's classification
- Earliest known source
- George Boolos, "The Hardest Logic Puzzle Ever," The Harvard Review of Philosophy 6(1): 62–65 (1996); listed from its bibliographic record, and the rules on this page are this site's own statement of the puzzle Crossref record, read 2026-10-17
- Difficulty (1–5)
- 5 this site's rating
- Tools needed
- Pen and paper, or code this page
- How the answer is checked
- Every case enumerated by a program: 6 arrangements × 2 meanings of ja × 8 patterns of Random's answers, 96 cases in all this page's enumeration
This card as CSV: hardest-logic-puzzle-ever-puzzle-card.csv
According to their Crossref records, later papers on the puzzle appeared in the Journal of Philosophical Logic (Tim S. Roberts, 2001) and in Analysis (B. Rabern and L. Rabern, 2008; G. Uzquiano, 2010), and this page does not summarize them. This puzzle has a solution you can check. The Paradox Index covers a different kind of problem, sorting paradoxes by type and by the state of their solutions.
Why can't you just ask a god if it is Random?
Asking a god directly "Are you Random?" fails because every word you could hear fits every identity. Suppose you ask A: if A is True and ja means yes, its honest "no" comes out as da, but if ja means no, the same honest answer comes out as ja. False lies, so its words come out reversed. Random can produce either word regardless of the question.
Two unknowns flip the answer, and a third adds noise: the meaning of the word flips it once, the god's honesty flips it again, and Random's words carry no information at all. A successful plan has to cancel both flips and somehow cope with the noise.
Do you need to know what ja means?
You do not: in the embedded question "If you were asked S, would you say ja?", True and False both answer ja exactly when the statement S is true, under either meaning of ja. Here S stands for any yes-or-no statement, such as "A is Random." The table below works through all eight combinations of the god's identity, the truth of S and the meaning of ja.
Consider False, with S true and ja meaning no. Asked S directly, False would lie and say "no," which is ja, so the statement "you would say ja" is true. False lies about that too and answers "no," which is again ja. Each flip therefore happens twice, once inside the question and once in the answer, and the two cancel out.
The same fact explains the title. Because the answer tracks S and not the meaning of ja, the answers you collect come out identical whichever meaning is true. You can verify any row by hand: choose the god, the truth of S and the meaning of ja, then follow the two steps. Random is the only god this device cannot control, since it can still give either word.
Show the solutionHide the solutionTry the puzzle first: this opens the full working.
The solution, step by step
Every question below uses the embedded form, so whenever the god asked is not Random, ja means "the statement is true," and the plan runs in four steps.
- Ask B: "If you were asked 'Is A Random?', would you say ja?" Ja means C is not Random, and da means A is not Random; call that god G.
- Ask G: "If you were asked 'Are you True?', would you say ja?" Ja means G is True, and da means G is False.
- Ask G: "If you were asked 'Is B Random?', would you say ja?" Ja means B is Random, and da means the god that is neither G nor B is Random.
- Assign the remaining identity to the remaining god.
Step 1 is the only place Random can interfere, and it is built so that the interference does no harm. If B is True or False, the answer is reliable: ja means A is Random, so C is not, and da means A is not. If B is Random, then A and C are True and False, so "C is not Random" and "A is not Random" both hold whatever B said. Steps 2 and 3 go to G, who is never Random, so their answers are reliable.
The tree has eight leaves, and each one identifies all three gods; none of them says what ja means, because every path is reached both with ja meaning yes and with ja meaning no. The case table (CSV, hardest-logic-puzzle-ever-cases.csv) lists all 96 cases, with the god asked and the answer given at each step.
Every case, checked
A program enumerated every case: 6 arrangements of the gods, 2 meanings of ja, and both words Random could give at each of the three questions, 96 cases in all. It ran the solution on each one, and all 96 end with the three gods named correctly. Because Random's answer at every question was tried both ways, the result holds however Random picks its words.
The same run confirmed all eight rows of the embedded-question table, and replacing ja and da with two other symbols, in either order, changed nothing but the labels. It also found that the three answers come out word for word the same under both meanings of ja, for each arrangement and each set of Random's answers.
Check record cardHow the answer on this page is tested
- Method
- A program enumerated every case: each arrangement of the three gods, each meaning of ja, and both words Random could give at each of the three questions. It then ran the three-question solution on every case and compared the names it reached with the true arrangement. this page's enumeration
- Cases enumerated
- 96 (6 arrangements × 2 meanings of ja × 8 patterns of Random's answers) this page's enumeration
- Output summary
- 96 of 96 cases end with all three gods named correctly. The cases follow 8 answer paths, and each path is reached both with ja meaning yes and with ja meaning no. this page's enumeration
This card as CSV: hardest-logic-puzzle-ever-check-record.csv
No three-question plan could improve on that point. Three answers make at most 8 patterns of ja and da, while the arrangement and the meaning of ja make 12 possibilities together (6 × 2), so no plan can name the gods and pin down the word every time. That is a line of reasoning you can check, which is how the puzzle passes the dojo test, this site's gate for a full entry. How puzzle answers are checked here, and how often they are rerun, is set out in How Claims Are Tested.
In this site's view, a solution you have read but never run is only half learned, so run one case before moving on: pick an arrangement and a meaning of ja, and trace both through the eight-row table by hand.
Generated illustrationPractice
Off the page:
A drill for the next 24 hours, on paper:
- Before opening the folded solution, write down the first question you would ask and which god would receive it.
- Test that question against the direct-question grid and the eight-row table, and list which identities each answer would leave open.
- Open the solution, choose two rows of the case table with different arrangements of the gods, and trace each through the tree by hand, noting any step where your trace and the table disagree.
- Then try the Zebra Puzzle, another puzzle whose answer is checked case by case, or set this tree beside the decision tree in trolley problem variations, where the branches carry judgments rather than proofs.
Sources
- [1] George Boolos, "The Hardest Logic Puzzle Ever," The Harvard Review of Philosophy 6(1): 62–65 (1996), doi:10.5840/harvardreview1996615. doi.org/10.5840/harvardreview1996615 Consulted: bibliographic record only
- [2] Tim S. Roberts, "Some Thoughts about the Hardest Logic Puzzle Ever," Journal of Philosophical Logic 30(6): 609–612 (2001), doi:10.1023/a:1013344220298. doi.org/10.1023/a:1013344220298 Consulted: bibliographic record only
- [3] B. Rabern and L. Rabern, "A simple solution to the hardest logic puzzle ever," Analysis 68(2): 105–112 (2008), doi:10.1093/analys/68.2.105. doi.org/10.1093/analys/68.2.105 Consulted: bibliographic record only
- [4] G. Uzquiano, "How to solve the hardest logic puzzle ever in two questions," Analysis 70(1): 39–44 (2010; published online 2009), doi:10.1093/analys/anp140. doi.org/10.1093/analys/anp140 Consulted: bibliographic record only
Cite this page
Virtue & Paradox. “Hardest Logic Puzzle Ever: You Never Learn What 'Ja' Means.” Published 2026-10-17; last substantive revision 2026-10-17. https://virtueandparadox.com/puzzles/hardest-logic-puzzle-ever/. Accessed (the date you read it).