2. There are 12 students participating in a performance at a party, and the party has $n$ programs. It is known that each program is performed by 6 students, and any two programs have at most 2 common performers. Find the maximum value of $n$.


2. Using the numbers $1,2, \cdots, 12$ to represent all students, and the subsets $P_{1}, P_{2}, \cdots, P_{n}$ of $\{1,2, \cdots, 12\}$ to represent all programs (each program's corresponding set is composed of the numbers of its participants), the given conditions can be transformed into:
(i) $\left|P_{i}\right|=6(1 \leqslant i \leqslant n)$.
(ii) $\left|P_{i} \cap P_{j}\right| \leqslant 2(1 \leqslant i<j \leqslant n)$.
Define a $12 \times n$ matrix $M=\left(M_{i j}\right)$ :
$$
M_{i j}=\left\{\begin{array}{ll}
1, & i \in P_{j} ; \\
0, & i \notin P_{j} .
\end{array}\right.
$$

For each $i \in\{1,2, \cdots, 12\}$, let $r_{i}=\sum_{j=1}^{n} M_{i j}$ represent the total number of times $i$ appears in $P_{1}, P_{2}, \cdots, P_{n}$. Then, by counting twice, we have
$$
\sum_{i=1}^{12} r_{i}=6 n .
$$

Let $R$ be the set of all unordered pairs of 1s located in the same row of matrix $M$. In the $i$-th row, there are $\mathrm{C}_{r_{i}}^{2}$ such pairs, so, $|R|=\sum_{i=1}^{12} \mathrm{C}_{r_{i}}^{2}$.

By condition (ii), we know that any two columns contain at most two such pairs. Therefore,
$$
\begin{array}{l}
|R| \leqslant 2 \mathrm{C}_{n}^{2}=n(n-1) . \\
\text { Hence } \sum_{i=1}^{12} \mathrm{C}_{r_{i}}^{2} \leqslant n(n-1) \\
\quad \Rightarrow \sum_{i=1}^{12} r_{i}^{2}-\sum_{i=1}^{12} r_{i} \leqslant 2 n(n-1) \\
\quad \Rightarrow \sum_{i=1}^{12} r_{i}^{2} \leqslant 2 n^{2}+4 n .
\end{array}
$$

Using the Cauchy inequality, we get
$$
\begin{array}{l}
36 n^{2}=\left(\sum_{i=1}^{12} r_{i}\right)^{2} \leqslant 12 \sum_{i=1}^{12} r_{i}^{2} \\
\leqslant 24 n^{2}+48 n .
\end{array}
$$

Therefore, we must have $n \leqslant 4$.
An example that meets the requirements when $n=4$ can be constructed as follows:
$$
\begin{array}{l}
P_{1}=\{1,2,3,4,5,6\}, \\
P_{2}=\{1,3,7,8,11,12\}, \\
P_{3}=\{2,4,7,8,9,10\}, \\
P_{4}=\{5,6,9,10,11,12\} .
\end{array}
$$

Thus, the maximum value of $n$ is 4.