# Am I allowed to use the XOR operation for the "Three Gods Puzzle" AKA the "Hardest Logic Puzzle"?

Basically, the question of the puzzle is: "Three gods 1, 2, and 3 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 1, 2, and 3 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."

I've been trying to solve this puzzle without the help of any hints or guides and recently I came up with a solution, but I'm not sure if this solution is allowed.

So basically, one of my questions use XOR to combine two statements. I even have a question that have 2 XORs to combine three statements (The first two are XOR'ed first, then whatever the result is XOR'ed to the third one). It's still a Yes/No question and the Gods can answer it with just X or Y (I'm using X and Y as the two possible answers of the Gods).

So yeah, am I allowed to combine two or more statements? If so, can I use the XOR logic gate to combine them? I don't think it breaks the rules since the rule just states it must be a Yes/No question, and mine IS a Yes/No question. It's Yes if exactly one of the two statements is True, and No otherwise. I still want some confirmation, however.

Thank you!

TL; DR: Yes, however, there is a way to do it without them.

Any yes or no question is allowed; so all you have to do is word your question something like this:

Is exactly one of these statements true: you lie, you answer randomly?

(Obviously, that’s a terrible question to ask; it’s just an example.)

You can make questions as convoluted as you want; this isn’t the obligatory xkcd

I won’t spoil the solution without XOR, but good luck at finding it if you try.

• Thank you! Also, are you saying that I can solve it without using XORs AND without phrasing my questions like your example? Or are you saying that I can just convert my XOR questions to something similar like your example? Commented Jan 6, 2019 at 12:20
• +1 for the xkcd :D Commented Jan 6, 2019 at 12:21
• @homosexual-advocate you can solve it without either XOR or questions formatted like my example. Commented Jan 6, 2019 at 12:23
• @ExcitedRaichu okay then, thank you! this puzzle is extremely hard lol. Commented Jan 6, 2019 at 12:25
• @homosexual-advocate If you know what XOR is, then you show know how the logic gate is defined. Use a truth table if you want to avoid using XOR. Write it in terms of the component logic gates instead. Commented Jan 6, 2019 at 17:47