2. A new math teacher came to the class. He conducted a survey among the students of this class, asking if they love math. It turned out that $50 \%$ love math, and $50 \%$ do not. The teacher conducted the same survey at the end of the school year. This time, $70 \%$ of the students answered "yes," and $30 \%$ answered "no." Let $x \%$ of the students gave a different answer in the second survey compared to the first. Find the smallest and largest value of $x$.
Answer: $20 ; 80$.

Solution. Without loss of generality, we can assume that there are 100 students in the class. Let

- $a$ students answered "yes" both times,
- $b$ students answered "no" both times,
- $c$ students changed their answer from "no" to "yes",
- $d$ students changed their answer from "yes" to "no".

We need to find the minimum and maximum value of $x=c+d$ under the condition that $c+b=a+d=50, a+c=70, b+d=30$. We have

$$
c=50-b ; \quad d=30-b ; \quad x=c+d=80-2 b .
$$

From this, $0 \leqslant b \leqslant 30$, and $20 \leqslant x \leqslant 80$.

If $b=0$, then $c=50, d=30, a=20$.

If $b=30$, then $c=20, d=0, a=50$.

Thus, the minimum and maximum values of $x$ are 20 and 80.

Evaluation. 12 points for a correct solution. If only one of the two values is found correctly, 3 points.