6. 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$ .
1001
6. 【Analysis and Solution】Pair the non-empty subsets of $M$. For each non-empty subset $X \subset M$, let
$$
X^{\prime}=\{1001-x \mid x \in X\} \text {, }
$$

then when $X_{1}$ is also a non-empty subset of $M$, and $X^{\prime} \neq X_{1}$, we have $X^{\prime} \neq X^{\prime}{ }_{1}$. Thus, all non-empty subsets are divided into two categories:
(A) $X^{\prime} \neq X$, (B) $X^{\prime} = X$.

For $X$ in (B), it must be that $a_{x}=1001$. For a pair of $X$ and $X^{\prime}$ in (A), we have $a_{x}+a_{x^{\prime}}=1001 \times 2=2002$. Therefore, the arithmetic mean of all $a_{x}$ is 1001.