9. (40 points) On an island, there live only 50 knights, who always tell the truth, and 15 commoners, who can either tell the truth or lie. A scatterbrained professor, who came to the island to give a lecture, forgot what color hat he was wearing. How many of the local residents should the professor ask about the color of his hat to be sure of what it is?
Answer: 31.

Solution: Since the professor will only ask about the color of the hat, to accurately determine the color of the hat, it is necessary to survey more knights than commoners. In the worst case, among those surveyed, there could be all the commoners on the island, i.e., 15 people; therefore, it is necessary to survey no fewer than 31 people to ensure that the opinion of the knights prevails.