Maths Olympiad Prep

Library / /45 of 48

, 2016

Combinatorics Difficulty 7.6 National Olympiad, round 2 Prove it Baltic Way

There are nn students at a school. It is known that, for any two students AA and BB, either AA loves BB or BB loves AA (but not both). (A student may thus be in love with several other students.) A love triangle is a configuration of three students AA, BB, CC such that AA loves BB, BB loves CC and CC loves AA. What is the maximal number of love triangles, given the number nn of students?

Solution

Answer: n(n21)24\frac{n(n^2-1)}{24} if nn is odd and n(n24)24\frac{n(n^2-4)}{24} if nn is even.

Let aia_i be the number of students that student ii loves (1in1 \le i \le n). Then the number of love triangles is
T=(n3)(a12)(an2). T = \binom{n}{3} - \binom{a_1}{2} - \dots - \binom{a_n}{2}.
This is explained as follows. In a non-love triangle ABCABC, one student, say AA, loves BB and CC, while BB loves CC. For each pair BB, CC of students that AA loves, one triangle is thus deducted above from the total number of triangles.

Simplifying the above expression, we get
T=(n3)+12(a1++an)12(a12++an2). T = \binom{n}{3} + \frac{1}{2}(a_1 + \dots + a_n) - \frac{1}{2}(a_1^2 + \dots + a_n^2).
We have (n3)=n(n1)(n2)6\binom{n}{3} = \frac{n(n-1)(n-2)}{6} and a1++an=(n2)=n(n1)2a_1 + \dots + a_n = \binom{n}{2} = \frac{n(n-1)}{2}, while the sum of squares is bounded by Chebyshev's Inequality:
a12++an2n(a1++ann)2=1n2(n2)2=(n1)24, \frac{a_1^2 + \dots + a_n^2}{n} \ge \left( \frac{a_1 + \dots + a_n}{n} \right)^2 = \frac{1}{n^2} \binom{n}{2}^2 = \frac{(n-1)^2}{4},
yielding
a12++an2n(n1)24. a_1^2 + \dots + a_n^2 \ge \frac{n(n-1)^2}{4}.

Hence an upper bound for the number of love triangles is given by
Tn(n1)(n2)6+12n(n1)212n(n1)24=n(n21)24. T \le \frac{n(n-1)(n-2)}{6} + \frac{1}{2} \cdot \frac{n(n-1)}{2} - \frac{1}{2} \frac{n(n-1)^2}{4} = \frac{n(n^2-1)}{24}.
Equality holds if and only if a1==an=n12a_1 = \dots = a_n = \frac{n-1}{2}. This can easily be arranged when nn is odd, by making student ii fall in love with students i+1,,i+n12i+1, \dots, i+\frac{n-1}{2} (counting cyclically).

When nn is even, this bound is clearly impossible to attain, and we must proceed differently. We investigate, for nn even, the minimal value of a12++an2a_1^2 + \dots + a_n^2, subject to the condition a1++an=(n2)a_1 + \dots + a_n = \binom{n}{2}.

Suppose first the sum of squares is at a minimum, but that apaq2a_p - a_q \ge 2 for some pp and qq. We may then replace apa_p and aqa_q by ap1a_p - 1 and aq+1a_q + 1, respectively, which will serve to decrease the sum of squares:
(ap1)2+(aq+1)2=ap2+aq2+2(1+aqap)<ap2+aq2. (a_p - 1)^2 + (a_q + 1)^2 = a_p^2 + a_q^2 + 2(1 + a_q - a_p) < a_p^2 + a_q^2.
Consequently, when the sum of squares is at a minimum, the maximal difference among the numbers aia_i is at most 11.

Suppose next, without loss of generality, that a1==ak=xa_1 = \dots = a_k = x and ak+1==an=x+1a_{k+1} = \dots = a_n = x + 1. Then
(n2)=a1++an=kx+(nk)(x+1)=nx+nkk=nx+n(n2), \binom{n}{2} = a_1 + \dots + a_n = kx + (n-k)(x+1) = nx + n - k \\ \Leftrightarrow k = nx + n - \binom{n}{2},
transforming the inequality 0kn0 \le k \le n into
0nx+n(n2)nn121xn12x=n22. 0 \le nx + n - \binom{n}{2} \le n \Leftrightarrow \frac{n-1}{2} - 1 \le x \le \frac{n-1}{2} \\ \Leftrightarrow x = \frac{n-2}{2}.
This corresponds to k=n2k = \frac{n}{2}, and so the minimum is attained when half of the aia_i equal n22\frac{n-2}{2} and the remaining half equal n2\frac{n}{2}. The minimal quadratic sum is
n2(n22)2+n2(n2)2=n(n22n+2)4. \frac{n}{2} \left( \frac{n-2}{2} \right)^2 + \frac{n}{2} \left( \frac{n}{2} \right)^2 = \frac{n(n^2 - 2n + 2)}{4}.

We thus find
Tn(n1)(n2)6+12n(n1)212n(n22n+2)4=n(n24)24 T \le \frac{n(n-1)(n-2)}{6} + \frac{1}{2} \cdot \frac{n(n-1)}{2} - \frac{1}{2} \cdot \frac{n(n^2 - 2n + 2)}{4} = \frac{n(n^2 - 4)}{24}

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.