Let $x_{1}, x_{2}, \ldots, x_{n}$ be non-negative numbers whose sum is 1.

How large can

$$
x_{1} x_{2}+x_{2} x_{3}+\ldots+x_{n-2} x_{n-1}+x_{n-1} x_{n}
$$

be?
I. solution. Let the sum of the even-indexed numbers be $P$, and the sum of the odd-indexed numbers be $Q$. If we perform the $P \cdot Q$ multiplication, we will get every term of the sum we are examining. We will of course get additional terms as well - the products of $x_{i}$'s with non-adjacent indices - however, according to the condition, none of these can be negative.

Thus

$$
x_{1} x_{2}+x_{2} x_{3}+\ldots+x_{n-1} x_{n} \leqq P Q
$$

on the other hand, since $P+Q=1$ and $P, Q \geqq 0$, using the inequality between the arithmetic and geometric means, we have $P Q \leqq 1 / 4$.

We have found that the value of the sum we are examining cannot be greater than $1/4$. This estimate cannot be improved, for if $x_{1}=x_{2}=\frac{1}{2}, x_{3}=x_{4}=\ldots=x_{n}=0$, then the value of (1) is exactly $1 / 4$.

II. solution. Let $x_{k}$ be the maximum of the given numbers. Since there are no negative numbers among them, the value of the expression (1) does not decrease if we replace one of the factors in each term with $x_{k}$. Let's do this by replacing the higher-indexed factor to the left of the terms containing $x_{k}$, and the lower-indexed factor to the right of them with $x_{k}$.

Denoting the value of the given expression by $A$, we have

$$
\begin{aligned}
& A \leqq x_{1} x_{k}+x_{2} x_{k}+\ldots+x_{k-1} x_{k}+x_{k} x_{k+1}+x_{k} x_{k+2}+\ldots+x_{k} x_{n}= \\
&=x_{k}\left(x_{1}+x_{2}+\ldots+x_{k-1}+x_{k+1}+\ldots+x_{n}\right)=x_{k}\left(1-x_{k}\right)
\end{aligned}
$$

since the sum of the given numbers is 1.

Since $x_{k}\left(1-x_{k}\right) \leqq 1 / 4$, it follows that $A \leqq 1 / 4$. In the first solution, we saw that equality is possible.