2. (2 points) In a class, 12 people gathered, each of whom is either a knight, who always tells the truth, or a liar, who always lies. Each of them was asked to first name the number of knights in the room, and then the number of liars. It turned out that each number from 1 to 12 was named exactly twice. How many knights could there have been in the class? Find all possible options and prove that there are no others.
Answer: from 0 to 2.

Solution: Since knights give the same answer to all questions, there cannot be more of them than the maximum number of identical answers, i.e., 2. It is easy to construct examples of all cases. If there are two knights, they tell the truth, and each liar chooses a number other than 2 and 10, and mentions the chosen number both times. If there is one knight, eight liars each call out a different number, except 1 and 11, while the ninth liar calls out 11 and 1 in the wrong order. If there are no knights, everyone calls out even numbers in response to the question about the number of knights, and odd numbers in response to the question about the number of liars.