4. For non-negative real numbers $a, b, c$ it holds that $a+b+c=1$. Find the greatest and the smallest possible value of the expression

$$
(a+b)^{2}+(b+c)^{2}+(c+a)^{2} .
$$
Solution. Notice that the expression $a+b+c$ contains only the first powers of the variables, and the expression we need to work with further contains their second powers. By expanding and rearranging the expression $V$ from the problem statement, we get

$$
\begin{aligned}
V & =(a+b)^{2}+(b+c)^{2}+(c+a)^{2}=2\left(a^{2}+b^{2}+c^{2}\right)+2(a b+b c+c a)= \\
& =a^{2}+b^{2}+c^{2}+1
\end{aligned}
$$

since

$$
a^{2}+b^{2}+c^{2}+2(a b+b c+a c)=(a+b+c)^{2}=1 \text {. }
$$

The numbers $a, b, c$ are non-negative, so the expression $a b+b c+a c$ is also non-negative, and from equation (2) we get the estimate

$$
a^{2}+b^{2}+c^{2} \leqq a^{2}+b^{2}+c^{2}+2(a b+b c+a c)=1 .
$$

Substituting this into equation (1), we find that the maximum possible value of the expression $V$ is 2, which is achieved for $a=1, b=c=0$.

From the problem in the home round, we know that the inequality

$$
a b+b c+a c \leqq a^{2}+b^{2}+c^{2},
$$

is obtained by expanding and rearranging the obvious inequality

$$
0 \leqq(a-b)^{2}+(b-c)^{2}+(c-a)^{2}
$$

Substituting twice the inequality (3) into equation (2), we get the estimate

$$
1=a^{2}+b^{2}+c^{2}+2(a b+b c+a c) \leqq 3\left(a^{2}+b^{2}+c^{2}\right) .
$$

From this, for the value of the expression $V$, we get the estimate

$$
V=a^{2}+b^{2}+c^{2}+1 \geqq \frac{1}{3}+1=\frac{4}{3},
$$

which is achieved by the given expression for $a=b=c=\frac{1}{3}$.