Example 3-31 $X$ is a set of 9 positive integers, $E \subseteq X, S(E)$ is the sum of the elements of set $E$. $n$ is the maximum value of the elements in $X$. Find the value of $n$ such that $X$ contains at least two sets $A$ and $B$ for which $S(A)=S(B)$.
$E$ is any subset of $X$,
$$
S(E) \leqslant n+(n-1)+(n-2)+\cdots+(n-8)=9 n-36
$$

This indicates that the number of different $S(E)$ values is at most $9 n-36$.
The number of non-empty subsets of $X$ is $2^{9}-1=511$. According to the pigeonhole principle,
$$
511 \geqslant 9 n-36
$$

is a sufficient condition for the existence of at least two subsets with equal sums. Here, $2^{y}-1=511$ is considered the number of pigeons, and $9 n-36$ is the upper bound for the number of pigeonholes. $9 \leqslant n \leqslant 60$ makes the inequality $(*)$ hold.