Problem 7.6. In a class, there are 25 students, each of whom is either an excellent student or a troublemaker. Excellent students always tell the truth, while troublemakers always lie.

One day, 5 students of this class said: "If I transfer to another class, then among the remaining students, more than half will be troublemakers."

Each of the remaining 20 said: "If I transfer to another class, then among the remaining students, there will be three times as many troublemakers as excellent students."

How many excellent students are there in the class? List all possible options.
Answer: 5 or 7.

Solution. Let's call the first group all the people who said the first phrase, and the second group all the people who said the second phrase. Consider two cases.

- Suppose there is at least one excellent student in the second group, choose any of them. Among the remaining 24 people, the number of troublemakers is three times the number of excellent students, so there are exactly 18 troublemakers and 6+1=7 excellent students.

Notice that such a situation is possible: in the first group, there were 5 excellent students who told the truth (since $18>\frac{24}{2}$), and in the second group, there were 2 excellent students who told the truth (since $18=3 \cdot 6$), as well as 18 troublemakers who lied (since $17 \neq 3 \cdot 7$).

- Suppose there are no excellent students in the second group, then the total number of troublemakers is at least 20. Then any person from the first group told the truth (since both 19 and 20 are more than half of 24), so all 5 people in the first group are excellent students, and the total number of excellent students in the class is exactly 5.

Notice that such a situation is possible: in the first group, there were 5 excellent students who told the truth (since $20>\frac{24}{2}$), and in the second group, there were 20 troublemakers who lied (since $19 \neq 3 \cdot 5$).