In an island, there is only two kinds of inhabitants; knights who always tell the truth and knaves who always lie. You meet 3 inhabitants A, B, and C and have the following conversation with them. Uncover the nature of A, B, and C; that is, their identities.
Case I:
A: "All three of us are knaves."
B: "Exactly one of us is a knight."
Case II:
You: "How many knights are among you?"
A: "..."
You: "What did A answer?"
B: "A said that there is one knight among us."
C: "B is lying."
I am not sure if this is a correct or valid way to approach the problem but I am trying to solve this problem using the Pigeonhole Principle.
This states that if a function $f$ maps two finite set $X\to Y$, and $\vert X\vert >\vert Y \vert $ then $f$ cannot be injective.
If I consider the set $X$ to contain the three inhabitants as its elements and $Y$ to be the set containing the type of inhabitants (knight, knave), then $3\gt2$ and $f$ is not injective.
The only missing part is a valid function that maps an inhabitant to a type of inhabitant and I would be able to determine which is which. Can such a function $f$ be deduced using this information?