Here is a puzzle that appeared in a Russian magazine named Kvantik (see Tanya Khovanova's Math Blog). [The trick lies in that we don't know exactly what the hedgehog knows at each stage. The symbology of the animals and their behaviour is great too.]
The Jackal always lies; the Lion always tells the truth. The Parrot repeats the previous answer—unless he is the first to answer, in which case he babbles randomly. The Giraffe replies truthfully, but to the previous question directed to him—his first answer he chooses randomly.
The Wise Hedgehog in the fog stumbled upon the Jackal, the Lion, the Parrot, and the Giraffe, although the fog prevented him from seeing them clearly. He decided to figure out the order in which they were standing.
After he asked everyone in order, “Are you the Jackal?” he was only able to figure out where the Giraffe was.
After that he asked everyone, “Are you the Giraffe?” in the same order, and figured out where the Jackal was.
But he still didn’t have the full picture. He started the next round of questions, asking everyone, “Are you the Parrot?” After the first one answered “Yes”, the Hedgehog understood the order.
What is the order?
Is there a neat way of solving the puzzle using symbolic logic?
Both the lion and the jackal must say "No" to the first question. If the parrot and the giraffe both say "No" then nothing is revealed. If they both say "Yes" then it will not be possible to know only where the giraffe is. Therefore, one must say "Yes" and the other "No". Again, if "Yes" is the first answer, nothing is revealed, but if it follows a sequence of "No" answers then it must be announced by the giraffe. The giraffe is thus not first. The parrot cannot follow the giraffe (unless the parrot is first and the giraffe last).
Both the lion and the giraffe must say "No" to the second question, while the jackal must say "Yes". If the parrot says "Yes", then it is not possible to know where the jackal is without also knowing where the parrot is. So, the parrot says "No". If the jackal were first, then the parrot's position would be known since it does not follow either the giraffe (known position) or the jackal. Likewise, if the jackal were second, the parrot's position would again be known. If the jackal were third, the giraffe would be last. But then the parrot's position would be known from the giraffe's first answer. So the jackal must be last.