4. It is known that a total of 12 theater groups are participating in a 7-day drama festival. Each day, some of the groups perform on stage, while the groups not performing watch from the audience. It is required that each group must see the performances of all other groups. What is the minimum number of performances needed? (From the 7th Partner School Test, Question 2, provided by Li Chengzhang)
Certainly, here is the translation of the provided text into English, preserving the original formatting:

```
It is impossible for 3 troupes to perform only for 2 days and meet the conditions of the problem. By the pigeonhole principle, on one day, at least two troupes must perform, and on that day, these two troupes cannot observe each other. They must observe each other on the remaining day, which is clearly impossible.

Next, to meet the conditions of the problem, 8 troupes cannot perform only for 3 days. Using the pigeonhole principle, on one day, at least 3 troupes must perform, and on that day, these 3 troupes cannot observe each other. Therefore, they must observe each other's performances on the remaining 2 days, which is known to be impossible.

Now, we prove that 9 troupes cannot meet the conditions of the problem by performing only for 4 days. If one troupe performs only one day, then on that day, the other 8 troupes must be in the audience. With the remaining 3 days, the 8 troupes must observe each other's performances, which has already been proven impossible.

Of course, one troupe cannot perform for 4 days, otherwise, that troupe cannot observe the performances of other troupes. Therefore, each troupe performs at most 3 days. If one troupe performs for 3 days, it must be in the audience on the 4th day. On that day, the remaining 8 troupes must all perform, so in the first 3 days, the 8 troupes must observe each other's performances, which is known to be impossible. Therefore, each troupe performs at most 2 days, and in 4 days, choosing 2 days, from \( C_{\mathrm{I}}^{n=6} \), these troupes cannot observe each other's performances, as originally stated.

Now, let's solve this problem. If there are \( k \) troupes that perform only once, and the remaining \( 12 - k \) troupes each perform at least twice. Then these \( k \) troupes must be scheduled to perform on \( k \) days, and the other troupes can only be in the audience on those \( k \) days. The \( 12 - k \) troupes must observe each other's performances in the remaining \( 7 - k \) days. When \( k = 7, 6 \), it is clearly impossible. When \( k = 5, 4, 3 \), it has already been proven to be impossible. Therefore, \( k \leq 2 \).

When \( k = 1 \), at least \( 1 + 2 \times 11 = 23 \) performances are required. When \( k = 2 \), at least \( 2 + 2 \times 10 = 22 \) performances are required.

Below is an example of a total of 22 performances. Use \( A_{3} = \{3,4\} \) to indicate that the 3rd troupe performs on the 3rd and 4th days, \( A_{4} = \{3, 5\} \) to indicate that the 4th troupe performs on the 3rd and 5th days, etc.
\[
\begin{array}{l}
A_{1} = \{1\}, A_{2} = \{2\}, A_{3} = \{3,4\}, A_{4} = \{3,5\}, A_{5} = \\
\{3,6\}, A_{6} = \{3,7\}, A_{7} = \{4,5\}, A_{8} = \{4,6\}, A_{9} = \{4, \\
7\}, A_{10} = \{5,6\}, A_{11} = \{5,7\}, A_{12} = \{6,7\},
\end{array}
\]
```