6. There are 30 people in the bar. The bartender knows that among them, there are 10 knights (who always tell the truth), 10 liars (who always lie), and 10 troublemakers. The bartender can ask person $X$ about person $Y$: "Is it true that $Y$ is a troublemaker?" If $X$ is not a troublemaker, they will answer the question, but if $X$ is a troublemaker, they will throw $Y$ out of the bar in response. The bartender can kick out anyone they want, but their goal is to get rid of the troublemakers and leave as many peaceful customers in the bar as possible. How should he proceed? Don't forget to prove that he cannot leave more peaceful customers.

## SOLUTION:

## TRANSLATION:

6. There are 30 people in the bar. The bartender knows that among them, there are 10 knights (who always tell the truth), 10 liars (who always lie), and 10 troublemakers. The bartender can ask person $X$ about person $Y$: "Is it true that $Y$ is a troublemaker?" If $X$ is not a troublemaker, they will answer the question, but if $X$ is a troublemaker, they will throw $Y$ out of the bar in response. The bartender can kick out anyone they want, but their goal is to get rid of the troublemakers and leave as many peaceful customers in the bar as possible. How should he proceed? Don't forget to prove that he cannot leave more peaceful customers.

## SOLUTION:
Answer: 19. Indeed, with the first question, a peaceful client may be identified, so the bartender cannot guarantee to keep all peaceful clients.

Let's show how the bartender can leave 19 peaceful clients.

Solution 1. First, he asks everyone about client $A$ until someone throws him out of the bar. Let's say $B$ threw him out (thus, $B$ is a troublemaker). Now we start asking about $B$ until $B$ is thrown out, and so on. In the end, we will have a situation where a troublemaker $X$ is not thrown out by anyone. This means there are no more troublemakers (except for $X$). The bartender then throws out $X$, and everyone becomes calm. Note that all those thrown out, except the first one, were definitely troublemakers.

Solution 2. First, we ask client $B$ about $A$, then we ask $C$ about $B$. With the first question, we get information on whether $B$ is a troublemaker, and with the second question, we learn whether $C$ is a knight, a liar, or a troublemaker. If $C$ is not a troublemaker, we will ask $C$ about all the clients and find out who the troublemakers are (if $C$ is a liar, then his answers should be interpreted in reverse). These are the ones to be thrown out.

If $C$ is a troublemaker, we ask $D$ about $C$. Either $D$ will answer, or $D$ is also a troublemaker (then we will ask about $D$, and so on). When we get any answer, we act as in the previous case.