Example 3 Let $a_{1}, a_{2}, \cdots, a_{n}$ be a permutation of $1,2, \cdots, n$. For a number $a_{i}$ in the permutation, if it satisfies: either $i=n$, or for all $j(ia_{j}$, then $a_{i}$ is called a "large number" in this permutation. Let the number of large numbers in the permutation $\sigma=$ $\left(a_{1}, a_{2}, \cdots, a_{n}\right)$ be $r(\sigma)$. Find $S$ $=\sum_{\sigma} r(\sigma)$.
Let $g(i)$ denote the number of permutations where $i$ is the largest number, then
$$
\sum_{\sigma} r(\sigma)=\sum_{i=1}^{n} g(i) \text {. }
$$

Consider any permutation $\sigma$ where $i$ is the largest number, and we determine the order of $1,2, \cdots, n$ in the permutation $\sigma$.

First, arrange $i+1, i+2, \cdots, n$ in any order, which gives $(n-i)$! ways. Note that since $i$ is the largest number, it should be placed at the end of the above arrangement, giving 1 way.

Next, arrange $i-1$, which can be placed in any of the $n-i+1$ gaps formed by the already arranged $n-i+1$ numbers, giving $n-i+2$ ways.

Then arrange $i-2$, which can be placed in any of the $n-i+2$ gaps formed by the already arranged $n-i+2$ numbers, giving $n-i+3$ ways.

Continuing this process, for any $j=i-1, i-2, \cdots, 2, 1$, there are $n+1-j$ ways. Thus,
$$
\begin{array}{l}
g(i)=n(n-1) \cdots(n-i+2)(n-i)! \\
=\frac{n!}{n-i+1} . \\
\text { Hence } \sum_{\sigma} r(\sigma)=\sum_{i=1}^{n} g(i) \\
=\sum_{i=1}^{n} \frac{n!}{n-i+1}=n!\sum_{i=1}^{n} \frac{1}{i} .
\end{array}
$$