7. There are 120 people. Any two people are either friends or not friends. A set of four people that contains exactly one pair of friends is called a "weak quartet." Find the maximum number of "weak quartets." (Provided by New Zealand)


Solution: Let the 120 people be 120 points in graph $G$. If two people know each other, then connect the points corresponding to these two people with a line segment. Let $Q(G)$ be the number of "weak quartets" in graph $G$. If $x, y$ are two points in $G$, and there is a line segment between $x, y$, let $G^{\prime}$ satisfy the following conditions:
$G^{\prime}$ is the "copy of $G$ from $y$ to $x$", for every point $z$ (different from $x, y$), if $yz$ is an edge in graph $G$, then add the edge $xz$ in graph $G^{\prime}$; if $yz$ is not an edge in graph $G$, then remove the edge $xz$ in graph $G^{\prime}$.
Similarly, define $G^{\prime \prime}$ to satisfy the following conditions:
$G^{\prime \prime}$ is the "copy of $G$ from $x$ to $y$", for every point $z$ (different from $x, y$), if $xz$ is an edge in graph $G$, then add the edge $yz$ in graph $G^{\prime \prime}$; if $xz$ is not an edge in graph $G$, then remove the edge $yz$ in graph $G^{\prime \prime}$.
Below, we prove that $Q(G) \leqslant \frac{1}{2}\left[Q\left(G^{\prime}\right)+Q\left(G^{\prime \prime}\right)\right]$.
If a "weak quartet" does not contain $x$ or $y$, then the number of "weak quartets" in $G$, $G^{\prime}$, and $G^{\prime \prime}$ is the same; the number of "weak quartets" containing $x$ and $y$ in $G^{\prime}$ and $G^{\prime \prime}$ is not less than the number of "weak quartets" containing $x$ and $y$ in $G$; the number of "weak quartets" containing $y$ but not $x$ or containing $x$ but not $y$ in $G^{\prime}$ is at least twice the number of "strong quartets" containing $y$ but not $x$ in $G$; the number of "weak quartets" containing $x$ but not $y$ or containing $y$ but not $x$ in $G^{\prime \prime}$ is at least twice the number of "weak quartets" containing $x$ but not $y$ in $G$. Therefore, we have
$$
Q(G) \leqslant \frac{1}{2}\left[Q\left(G^{\prime}\right)+Q\left(G^{\prime \prime}\right)\right].
$$

Now consider an extreme case, such that
$$
Q(G)=Q\left(G^{\prime}\right)=Q\left(G^{\prime \prime}\right)
$$

We repeatedly copy $G$ pair by pair. If there is an edge between $x$ and $y$, then perform the "copy from $y$ to $x$" and "copy from $x$ to $y$". In the "copy from $y$ to $x$", for any point $z$ adjacent to $x$, perform the "copy from $x$ to $z$". And so on. Finally, we get that $G$ is composed of several disconnected complete graphs. At this point, we have $Q(G) = Q\left(G^{\prime}\right) = Q\left(G^{\prime \prime}\right)$. Therefore, the maximum number of "weak quartets" is achieved in a graph $G$ composed of several disconnected complete graphs.
Suppose graph $G$ contains $n$ complete graphs, each with $a_{1}, a_{2}, \cdots, a_{n}$ points, and $a_{1} \geqslant 0, i=1,2, \cdots, n$, then
$$
Q(G)=\sum_{i=1}^{n} \mathrm{C}_{a_{i}}^{2} \sum_{\substack{1 \leq k \\ i, k \neq 1}} a_{k} a_{k},
$$

where $\mathrm{C}_{a}^{2}=\frac{1}{2} a(a-1)$.
For two numbers in $a_{1}$, say $a_{1}$ and $a_{2}$, when changing the values of $a_{1}$ and $a_{2}$ while keeping $a_{1}+a_{2}=s$ constant, we can write $Q(G)$ as an expression in terms of $a_{1}$ and $a_{2}$:
$$
\begin{array}{l}
Q(G)=C_{a_{1}}^{2}\left(a_{2} \sum_{j=3}^{n} a_{1}+\sum_{i, j=3}^{n} a_{1} a_{j}\right)+C_{a_{2}}^{2}\left(a_{1} \sum_{j=3}^{n} a_{j}+\sum_{i, j=3}^{n} a_{i} a_{j}\right)+ \\
\sum_{j=3}^{n}\left\{c_{j}^{2}\left(a_{1} a_{2}+a_{1} \sum_{\substack{k=3 \\
k=j}}^{n} a_{k}+a_{2} \sum_{\substack{k=3 \\
k=j}}^{n} a_{k}+\sum_{\substack{k=1 \\
k i=1 \\
k i=1}}^{n} a_{k} a_{i}\right)!\right. \\
=A\left(C_{a_{1}}^{2}+C_{a_{2}}^{2}\right)+B\left(a_{1}+a_{2}\right)+C\left(a_{1} C_{a_{2}}^{2}+a_{2} C_{a_{1}}^{2}\right)+D a_{1} a_{2}+E \text {. } \\
\end{array}
$$

where $A=\sum_{\substack{j=3 \\ i0$, then the values of any $a_{i}, a_{j}$ are either equal or differ by 1.
Assume all $a_{1}>0$, when $n$ is divisible by 120,
$$
\begin{array}{l}
Q(G)=n \mathrm{C}_{\frac{100}{2}}^{2} \mathrm{C}_{n-1}^{2}\left(\frac{120}{n}\right)^{2} \\
=\frac{120^{3}(120-n)(n-1)(n-2)}{4 n^{3}} .
\end{array}
$$

When $n \leqslant 6$, it is easy to see that $Q(G)$ achieves its maximum value when $n=5$, and the maximum value is 4769280.

Also, in (1), considering all $a_{1} \in R$, when all $a$ are equal, $Q(G)$ achieves its maximum value. Therefore, when $n \geqslant 6$,
$$
Q(G) \leqslant \frac{120^{3}(120-n)(n-1)(n-2)}{4 n^{3}}.
$$

And the function $\frac{120^{3}(120-n)(n-1)(n-2)}{4 n^{3}}$ is monotonically decreasing with respect to $n$.
In summary, the maximum value of $Q(G)$ is 4769280.