Maths WorkshopMaths problems with full solutions
Exercise 2156Combinatorics › Inclusion-exclusionOlympiadAdded 3 Nov 2026

Exactly $k$ properties

#IE#exactly k#sieve

Statement

State the formula for the number of elements having exactly kk of nn properties.

Hint

Use higher-order IE with binomial weights.

Show solutionHide solution

Solution

Formula. Let Nj=∑∣I∣=j∣AI∣N_j=\sum_{|I|=j}|A_I|. Then the number of elements with exactly kk properties is
Ek=∑j=kn(−1)j−k(jk)Nj.E_k=\sum_{j=k}^n(-1)^{j-k}\binom{j}{k}N_j.

Special cases. E0=∑j(−1)jNjE_0=\sum_j(-1)^jN_j (no property); E1=N1−2N2+3N3−⋯E_1=N_1-2N_2+3N_3-\cdots.

Conclusion. The exact-count sieve formula.