3. In a row, 100 knights and 100 liars are standing (in some order). The first person was asked: "Are you a knight?", and the rest were asked in turn: "Is it true that the previous person answered 'Yes'?" What is the maximum number of people who could have said "Yes"? Knights always tell the truth, liars always lie.
Solution. 150, for example, if there are 100 knights followed by 100 liars. We will now prove that this is the maximum.

Consider any liar, except possibly the first one. Either they said "no," or the previous person said "no." Thus, to each of the 99 liars, we can associate at least one "no" response (either theirs or the previous person's), and each "no" response is associated with no more than two liars. Therefore, there are at least 50 "no" responses.