Maths Olympiad Prep

Library / Brazilian Mathematical Olympiad /91 of 120

Brazilian Mathematical Olympiad

Combinatorics Difficulty 6.0 AIME, harder Prove it Brazil

For any non-empty subset AA of {1,2,…,n}\{1, 2, \dots, n\} define f(A)f(A) as the largest element of AA minus the smallest element of AA. Find ∑f(A)\sum f(A) where the sum is taken over all non-empty subsets of {1,2,…,n}\{1, 2, \dots, n\}.

Solution

Let mm and MM be the sum of the minima and maxima of all subsets. Since the diameter of a set is the difference between its maximum and its minimum, the desired sum is M−mM - m. We may include unitary subsets, since their minima and maxima coincide.

The number kk, 1≤k≤n1 \le k \le n, is the minimum of all subsets of the form {k}∪A\{k\} \cup A, where A⊂{k+1,k+2,…,n}A \subset \{k+1, k+2, \dots, n\}. So kk is the minimum of 2n−k2^{n-k} subsets. Hence
m=∑k=1nk⋅2n−k=∑k=0n−1(n−k)⋅2k. m = \sum_{k=1}^{n} k \cdot 2^{n-k} = \sum_{k=0}^{n-1} (n-k) \cdot 2^k.
Now we count the number of subsets with diameter kk. Let aa be the minimum of a subset. The maximum is a+ka+k. Since a+k≤na+k \le n, one may choose aa in n−kn-k ways. Since there are k−1k-1 numbers between aa and a+ka+k, there are (n−k)⋅2k−1(n-k) \cdot 2^{k-1} subsets with diameters kk. Since there are 2n−n−12^n-n-1 non-empty and non-unitary subsets,
∑k=1n−1(n−k)⋅2k−1=2n−n−1  ⟺  ∑k=1n−1(n−k)⋅2k=2n+1−2n−2  ⟺  ∑k=0n−1(n−k)⋅2k=2n+1−2n−2+n=2n+1−n−2 \begin{align*} \sum_{k=1}^{n-1} (n-k) \cdot 2^{k-1} &= 2^n - n - 1 \\ \iff \sum_{k=1}^{n-1} (n-k) \cdot 2^k &= 2^{n+1} - 2n - 2 \\ \iff \sum_{k=0}^{n-1} (n-k) \cdot 2^k &= 2^{n+1} - 2n - 2 + n = 2^{n+1} - n - 2 \end{align*}
and m=2n+1−n−2m = 2^{n+1} - n - 2.

In order to compute MM, notice that the association A={a1,a2,…,am}→f(A)={n+1−a1,n+1−a2,…,n+1−am}A = \{a_1, a_2, \dots, a_m\} \to f(A) = \{n+1-a_1, n+1-a_2, \dots, n+1-a_m\} is clearly a bijection that transform minima ℓ\ell in maxima n+1−ℓn+1-\ell. Since there are 2n−12^n-1 non-empty subsets, M+m=(n+1)(2n−1)  ⟺  M−m=(n+1)(2n−1)−2(2n+1−n−2)=(n−3)⋅2n+n+3M+m = (n+1)(2^n-1) \iff M-m = (n+1)(2^n-1)-2(2^{n+1}-n-2) = (n-3) \cdot 2^n + n + 3.

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

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