Example 7 Let the set $M=\{1,2, \cdots, 1000\}$, and for any non-empty subset $X$ of $M$, let $a_{x}$ denote the sum of the largest and smallest numbers in $X$. Then, the arithmetic mean of all such $a_{x}$ is $\qquad$
(1991, National High School Mathematics Competition)
Analysis: For any subset $X=\left\{b_{1}, b_{2}, \cdots, b_{k}\right\}$ of set $M$, assume $b_{1}<b_{2}<\cdots<b_{k}$, then there must exist another subset $X^{\prime}=\left\{1001-b_{1}, 1001-\right.$ $\left.b_{2}, \cdots, 1001-b_{k}\right\}$, at this time
$$
\begin{array}{l}
a_{x}=b_{1}+b_{k}, \\
a_{x^{\prime}}=\left(1001-b_{1}\right)+\left(1001-b_{n}\right) \\
=2002-b_{1}-b_{k},
\end{array}
$$
The arithmetic mean of $a_{x}$ and $a_{x^{\prime}}$ is 1001.
Solution: Pair the non-empty subsets of $M$. For each non-empty subset $X \subset M, X^{\prime}=\{1001-x \mid x \in X\}$, then $X^{\prime} \subset M$.
If $X \neq X^{\prime}$, then $a_{x}+a_{x^{\prime}}=2002$.
If $X=X^{\prime}$, then $a_{x}=1001$.
In summary, the arithmetic mean of all such $a_{x}$ is 1001.