Exercise 2. Let $x, y$ and $z$ be three real numbers such that $0 \leqslant x \leqslant y \leqslant z$ and $x+y+z=1$. Find the maximum value that the expression

$$
(x-y z)^{2}+(y-z x)^{2}+(z-x y)^{2}
$$

can take.
Solution to Exercise 2 The quantity we wish to maximize can be rewritten as

$$
\begin{aligned}
\mathcal{S} & =\left(x^{2}+y^{2}+z^{2}\right)+\left((x y)^{2}+(y z)^{2}+(z x)^{2}\right)-6 x y z \\
& =(x+y+z)^{2}-2(x y+y z+z x)+(x y+y z+z x)^{2}-2 x y z(x+y+z)-6 x y z \\
& =1-2(x y+y z+z x)+(x y+y z+z x)^{2}-8 x y z \\
& =(x y+y z+z x-1)^{2}-8 x y z
\end{aligned}
$$

Since $0 \leqslant x y+y z+z x \leqslant(x+y+z)^{2} / 2=1 / 2$, we deduce that $\mathcal{S} \leqslant 1$. Conversely, if $x=y=0$ and $z=1$, we have $\mathcal{S}=1$, which concludes the proof.