Maths WorkshopMaths problems with full solutions
Exercise 894Combinatorics › Counting principlesOlympiadAdded 3 Nov 2026

Subset sums

#subset sums#double counting#average

Statement

Compute the sum of ∣S∣|S| over all subsets SS of an nn-element set.

Hint

Each element is in exactly half the subsets.

Show solutionHide solution

Solution

Double count. Sum over subsets of their size = sum over elements of the number of subsets containing them.

Per element. Each element appears in 2n−12^{n-1} subsets.

Total. n⋅2n−1n\cdot2^{n-1}.

Conclusion. ∑S∣S∣=n⋅2n−1\sum_S|S|=n\cdot2^{n-1}.

Check. n=2n=2: subsets ∅,{1},{2},{1,2}\varnothing,\{1\},\{2\},\{1,2\}, sizes sum to 0+1+1+2=4=2⋅2=40+1+1+2=4=2\cdot2=4. ✓