All this assumes that the inhabitants of the island are not including the questioner when they make their statements. Otherwise a similar analysis applies, except that it is also possible that the governor is one of 500 truth tellers, and there are also 500 liars including yourself.

]]>Pick 17 people and ask another person, Alice, if they are all trustworthy. If she says yes then also ask Bob if all 17 are trustworthy. If he also says yes then they must in fact all be trustworthy, because either at least one of Alice and Bob are trustworthy, in which case we believe them that the 17 are trustworthy, or neither of them are in which case there are no remaining untrustworthy people to be among the 17. We can then ask our 11 remaining questions to one of the 17 to find the 2 untrustworthy people among the 48 others (proof below).

If Alice says yes and Bob says no, then we know at least one of Alice and Bob is untrustworthy. Now ask Charlie whether Dan is trustworthy. If he says yes then Dan must be trustworthy, by similar logic to the above. Then ask Dan if Alice is trustworthy, either answer will determine at least one untrustworthy person among Alice and Bob. Use 6 questions to binary search all the other people to find the other untrustworthy person. If Charlie says no, then one of he or Dan must be untrustworthy, and we can use 2 questions to any of the remaining people to find who is untrustworthy out of Alice and Bob, and Charlie and Dan.

If Alice says no then either her or one of the 17 is untrustworthy. Now pick 17 new people and ask Charlie if they are trustworthy. If he says yes then they must be trustworthy, and we can use our 11 remaining questions to find the two remaining untrustworthy people among the 48 others. If Charlie says no then one of he or the 17 is untrustworthy. Then any of the remaining people is trustworthy, and we can ask the 5 question to binary search each of the sets of 18.

It remains to show that we can find 2 untrustworthy people among 48 by asking 11 questions to someone who is known trustworthy. Do this by splitting them into 3 sets of 16 and asking the person about each of these sets. If the untrustworthy people are in different sets then we can use 4 questions on each set to binary search them. If they’re in the same set then we can use binary search to find one of them, and then binary search the remaining 15 people to find the other.

]]>And if the 500-999th people must be lying, this must mean that there are at least 500 liars (since we include the 500th person in our tally), meaning that the 1-499th people are telling the truth about the number of liars. Therefore, there are 499 truth tellers and 500 liars.

]]>