Solution to: Animals in Action
We number the cages one until four in the order in which the hedgehog asked the animals a question.
To the question "are you the jackal?", the lion and jackal will have answered "no". Because the hedgehog knew in which cage the giraffe sits, the giraffe must have said "yes", after another animal had said "no". Therefore, the giraffe was not in the first cage. We do not know what the parrot has said.
To the question "are you the giraffe?", the lion will have answered "no", the jackal "yes", and the giraffe "no" (because he answers the previous question). We do not know what the parrot has said.
To the question "are you the parrot?", the lion will have answered "no", the jackal "yes", and the giraffe "yes" (because he answers the previous question).
We know that the first animal answered "yes" but also that the answer gave the hedgehog extra information. The animal in the first cage was therefore neither the giraffe nor the jackal, because the hedgehog already knew in which cage they were, and not the lion, because he would have answered with "no". The animal in the first cage therefore was the parrot who repeated the "yes" of the jackal on the previous question. The jackal therefore was in the fourth cage.
Now the only thing we do not know yet is in which cages the lion and the giraffe are. If the giraffe was in the second cage and the lion in the third, then the hedgehog already could have concluded after the second question that the parrot was not in the third cage, because the third animal (the lion that each time answered "no") would not have repeated the answers of the second animal (the giraffe that first answered "yes" and then "no"). Then the hedgehog would not have had to ask the third question.
Conclusion: in the first cage is the parrot, in the second cage the lion, in the third cage the giraffe, and in the fourth cage the jackal.