5. A traveler arrived on an island inhabited by liars (L) and truth-tellers (P). Each L, when asked a question "How many..?", gives a number that is 2 more or 2 less than the correct answer, while each P answers correctly. The traveler met two residents of the island and asked each how many L and P live on the island. The first answered: "If you don't count me, there are 1001 L and 1002 P," and the second: "If you don't count me, there are 1000 L and 999 P." How many L and P are on the island? Who are the first and second residents of the island?
5. I - L, II - P. On the island, there are 1000 L and 1000 P. The answers of the first and second are different, so the option P and P is impossible. The option L and L is also impossible, because the numbers 1001 and 1000 differ by 1, while the answers of the liars regarding the number of L should differ by 4, or coincide. The option I - P, II - L is also impossible, because in this case, 1003 P live on the island, and thus L could not have given the answer 999 P. The only remaining option is I - L, II - P. From the answer of II, we get 1000 L and 1000 P, which corresponds to the answer of I.