8. In the阶梯教室 (tiered classroom) installed with connected desks, 6 people sit in one row, and candidates can only exit the examination room from the two ends of the desk. The time when candidates finish their exams varies. If a candidate sitting inside needs to submit the paper first, they will disturb others. The number of people disturbing others to submit their papers in a row is regarded as a random variable $X$, then the mathematical expectation of $X$ equals $\qquad$ (Su Chun provided the question)

Note: "阶梯教室" is translated as "tiered classroom" to maintain the meaning in English.
8. $\frac{21}{10}$.

It is easy to know that the set of values for $X$ is $\{0,1,2,3,4\}$, because people sitting at the ends will definitely not disturb others.
There are $6!$ different possible orders for the 6 people to submit their papers.
If the people at the ends always submit first, no disturbance will occur, so
$$
P(X=0)=\frac{2^{5}}{6!}=\frac{32}{720} .
$$

If only one person sitting inside submits first, then $X=1$, but we need to distinguish which one is the $k(1 \leqslant k \leqslant 4)$-th to submit. If he is the $k$-th to submit, there are $(5-k) \cdot 2^{4}$ possible submission orders (he could be any one of the $5-k$ people sitting inside, and for the rest, each time it is always the people at the ends who submit first), so
$$
P(X=1)=\sum_{k=1}^{4} \frac{(5-k) \cdot 2^{4}}{6!}=\frac{(1+2+3+4) \cdot 2^{4}}{6!}=\frac{160}{720} .
$$

Similarly, we have
$$
\begin{array}{l}
P(X=2)=\sum_{1 \leqslant i<j \leqslant 4} \frac{(5-i)(5-j) \cdot 2^{3}}{6!}=\frac{(24+9+2) \cdot 2^{3}}{6!}=\frac{280}{720}, \\
P(X=3)=\sum_{1 \leqslant i<j<k \leqslant 4} \frac{(5-i)(5-j)(5-k) \cdot 2^{2}}{6!}=\frac{50 \cdot 2^{2}}{6!}=\frac{200}{720}, \\
P(X=4)=\frac{2 \cdot 4!}{6!}=\frac{48}{720} .
\end{array}
$$

The results can be summarized in Table 1.
Table 1
\begin{tabular}{c|c|c|c|c|c}
\hline$X$ & 0 & 1 & 2 & 3 & 4 \\
\hline$P$ & $\frac{32}{720}$ & $\frac{160}{720}$ & $\frac{280}{720}$ & $\frac{200}{720}$ & $\frac{48}{720}$ \\
\hline
\end{tabular}

Thus, the expected value of $X$ is
$$
E(X)=\sum_{k=0}^{4} k P(X=k)=\frac{1512}{720}=\frac{21}{10} .
$$