4. Let $S=\left|x_{1}, x_{2}, \cdots, x_{n}\right|$, and $x_{1}<x_{2}<\cdots<x_{n}$, then $\frac{x_{1}+x_{2}}{2}<\frac{x_{1}+x_{3}}{2}<\cdots<\frac{x_{1}+x_{n}}{2}<$ $\frac{x_{2}+x_{n}}{2}<\frac{x_{3}+x_{n}}{2}<\cdots<\frac{x_{n-1}+x_{n}}{2}$, therefore, $A_{5}$ contains at least $2 n-3$ elements.

 On the other hand, if we take $S=\{2,4,6, \cdots, 2 n\}$, then $A_{s}=\{3,4,5, \cdots, 2 n-1\}$, which has only $2 n-3$ elements. Thus, the minimum number of elements in $A_{S}$ is $2 n-3$.
4. Let $S$ be a set of $n$ distinct real numbers, and $A_{s}$ be the set of all distinct averages of pairs of elements from $S$. For a given $n \geqslant 2$, what is the minimum number of elements that $A_{s}$ can have?
(1993 Putnam Competition)