8. Given an integer $n \geqslant 2$. On the blackboard, there are $n$ sets, and the following operation is performed: select two sets $A$ and $B$ on the blackboard that do not contain each other, erase them, and then write $A \cap B$ and $A \cup B$. This is called one operation. Continue operating until any two sets on the blackboard have one that contains the other. For all initial states and operation methods, find the maximum possible number of operations. (Provided by Zhu Huawei)
8. First, prove that the number of operations cannot exceed
$$
\mathrm{C}_{n}^{2}=\frac{n(n-1)}{2} \text {. }
$$

When there are $n$ sets on the blackboard, consider the number of pairs of sets that are in a containment relationship. After each operation, this number increases by at least 1.
Assume transforming sets $A$ and $B$ into $A \cap B$ and $A \cup B$.
First, $A$ and $B$ are not in a containment relationship, while $A \cap B$ and $A \cup B$ are in a containment relationship, so this operation increases the number of containment pairs by at least one.

For another set $C$, if $C$ is in a containment relationship with either $A$ or $B$, by symmetry, assume $A \subseteq C$, then $A \cap B \subseteq C$, meaning $C$ is in a containment relationship with at least one of $A \cap B$ or $A \cup B$; if $C$ is in a containment relationship with both $A$ and $B$, then since $A$ and $B$ are not in a containment relationship, it must be that either $A \subseteq C, B \subseteq C$ or $A \supseteq C, B \supseteq C$. If the former, then $A \cap B \subseteq C, A \cup B \subseteq C$; if the latter, then $A \cap B \supseteq C, A \cup B \supseteq C$.

Thus, after the operation, the number of other containment pairs does not decrease, so the number of containment pairs increases by at least 1 after each operation.

Since this number can be at most $\mathrm{C}_{n}^{2}=\frac{n(n-1)}{2}$ and at least 0, the number of operations is at most $\frac{n(n-1)}{2}$.
Next, provide an example where the number of operations is $\frac{n(n-1)}{2}$.
Define the sets
$A_{i}=\{i, i+1, \cdots, i+n-2\}(i=1,2, \cdots, n)$.
Next, prove that starting from $A_{1}, A_{2}, \cdots, A_{n}$, $\frac{n(n-1)}{2}$ operations can be performed.
Use mathematical induction.
When $n=2$,
$$
A_{1}=\{1\}, A_{2}=\{2\} \text {, }
$$

1 operation can be performed, which is $\frac{2(2-1)}{2}=1$.
If the conclusion holds for $n$, consider the case for $n+1$.
Perform one operation on $A_{1}=\{1,2, \cdots, n\}$ and $A_{2}=\{2,3, \cdots, n+1\}$, obtaining the intersection $\{2,3, \cdots, n\}$ and leaving it, and the union continues to operate with $A_{3}=\{3,4, \cdots, n+2\}$, obtaining the intersection $\{3,4, \cdots, n+1\}$ and leaving it, and the union continues to operate with $A_{4}$, and so on.

After $n$ operations, the union of all original sets $\{1,2, \cdots, 2 n\}$ and another $n$ sets
$$
\begin{array}{l}
\{2,3, \cdots, n\},\{3,4, \cdots, n+1\}, \cdots, \\
\{n+1, n+2, \cdots, 2 n-1\} .
\end{array}
$$

are obtained.
Finally, consider only the operations among the last $n$ sets.
Since reducing all elements by 1 does not change the relationships between sets, consider the sets
$$
\begin{array}{l}
\{1,2, \cdots, n-1\},\{2,3, \cdots, n\}, \cdots, \\
\{n, n+1, \cdots, 2 n-2\} .
\end{array}
$$

By the induction hypothesis, these sets can be operated on $\mathrm{C}_{n}^{2}=\frac{n(n-1)}{2}$ times, so the original $n+1$ sets can be operated on
$$
\frac{n(n-1)}{2}+n=\frac{n(n+1)}{2}=\mathrm{C}_{n+1}^{2},
$$

times, meaning the conclusion holds for $n+1$.
In summary, the maximum possible number of operations is
$$
\mathrm{C}_{n}^{2}=\frac{n(n-1)}{2} .
$$