There is another version of this puzzle with a third goblin who flips a coin and depending on the outcome he will lie or tell the truth. The player is allowed 3 yes/no questions and the objective is to assign the three identities unambiguously.
* Do all goblins know all their roles, or is each one not sure about the other two? (Unlike the two-goblin version, they can't figure it out by the process of elimination.)
* Is the coin-flip outcome hidden, or can the player learn a correlation between heads/tails and different reactions? Is the coin flip itself hidden, or are the other two flipping simultaneous decoy coins?
* Are the truth/falsehood goblins aware of the outcome of the coin flip? If they are unaware, what rule governs their behavior towards that ambiguity? Can the liar tell the truth by accident?
* Are the three questions posed to the group simultaneously, or do you have to target your question to a specific goblin for a single boolean result?
1. usually in these riddles the entities are oracles, so for simplicity let's say they are all-knowing goblins.
2. the coin flip is hidden from the player and it only influences the goblin being honest or a liar. the coin flipper goblin flips the coin each time he's asked a question.
3. see #1
4. each question is to be asked to a specific goblin chosen by the player, not to the group.
"If I asked the other two goblins if you are the truthteller and they both gave the same answer, what would that answer be?" If you are talking to the truthteller, the answer is no. If you are talking to the liar, the answer is yes. If you are talking to the coin flipper, he cannot answer because it is not possible for the other two to give the same answer.
This or similar was the solution, but I don't believe the solution works. A false proposition implies any proposition--"if (impossible scenario) then what would someone say" can be truthfully answered with either yes or no.
The two questions to ask are "Are you the lying coin flipper?" and "Are you the honest coin flipper?". These are answered as (NO, YES, NO) and (NO, YES, YES), respectively, by the (honest, lying, coin flipper) goblins.
In the best case we identify a non-flipper goblin on the first try (depending on which question we choose to ask) and then we can assign all three identities with just another question. In the worst case, we need to ask the same question to a second goblin in order to identify a non-flipper goblin, and then the other question to one of the two unidentified ones.
> There is another version of this puzzle with a third goblin who flips a coin and depending on the outcome he will lie or tell the truth. The player is allowed 3 yes/no questions
But this won't work in the context of the puzzle as stated. The puzzle here requires you to ask about what a goblin will say; your puzzle can't allow that because such a question cannot in the general case be answered yes/no.
We can think of the goblins as functions that return either the truth, the inverse of the truth, or a random answer.
// Knight, tells the truth
K(a) { return a }
// Knave, lies
k(a) { return !a }
// Joker, flips a coin
J(a) { return random(true, false) }
We can craft a question that will make the Knights and Knaves always return the truth. This could be "What would you answer if you were asked if $goblin is the $role?". This question will be noted Q(recipient,goblin,role), and here's what it returns depending if the recipient is a Knight, Knave or Joker.
$goblin is $role | K | K(K) | k | k(k) | J | J(J) |
T | T | T | F | T |T/F| T/F |
F | F | F | T | F |T/F| T/F |
If we didn't have the Joker and wanted to determine the two goblins roles, it would be as easy as asking this question to one of the two goblins.
Now we add the Joker, but we also can ask two more questions. We need to use those two questions to determine who is the joker, so we can discard him and use our last question to discriminate the two remaining goblins.
The 3 goblins will be noted G1, G2, and G3.
Let's ask Q(G1,G2,J).
Two possibilities:
1. The answer is "Yes" (true), either G1 is the Joker or G2 is the Joker. -> G3 is not the Joker.
2. The answer is "No" (false), either G1 is the Joker or G2 is not the Joker. -> G2 is not the Joker.
Now that we know at least one goblin who is not the Joker (whether they are G2 or G3, I'll call them ¬J), we can ask them the question, this time about the first goblin.
Q(¬J,G1,J)
1. The answer is "Yes", G1 is the Joker, the other two are not.
2. The answer is "No", the remaining goblin is the Joker.
I now know who is the Joker, meaning the other two goblins are either a Knight or a Knave.
Ask Q(¬J1,¬J2,K) and you'll know who is the Knight and who is the Knave.
In summary, the scenarios are as follows:
Q1 | Q2 | Q3 | G1 | G2 | G3 |
Q(G1,G2,J) | Q(G3,G1,J) | Q(G3,G2,K) | J | K | k |
Q(G1,G2,J) | Q(G3,G1,J) | ¬Q(G3,G2,K) | J | k | K |
Q(G1,G2,J) | ¬Q(G3,G1,J) | Q(G3,G1,K) | K | J | k |
Q(G1,G2,J) | ¬Q(G3,G1,J) | ¬Q(G3,G1,K) | k | J | K |
¬Q(G1,G2,J) | Q(G2,G1,J) | Q(G2,G3,K) | J | k | K |
¬Q(G1,G2,J) | Q(G2,G1,J) | ¬Q(G2,G3,K) | J | K | k |
¬Q(G1,G2,J) | ¬Q(G2,G1,J) | Q(G2,G1,K) | K | k | J |
¬Q(G1,G2,J) | ¬Q(G2,G1,J) | ¬Q(G2,G1,K) | k | K | J |
PS: If we assume that "What would you answer if you were asked if $goblin is the $role?" is forbidden because the Joker cannot know in advance what he would answer if they were asked if any goblin is any role, since it depends on their coin-flip, meaning that they wouldn't know what is the truth and what is the lie, and thus they cannot lie or tell the truth reliably, we can switch the question for "If you were asked if you were the truth-teller, or if you were asked if $goblin was the $role, would your answer to both questions be the same and always the same?".
I can post the solution in 24h. Have fun! ^^