Skip to main content
OlympiadHQ

Browse · MathNet

Print

Baltic Way 2023 Shortlist

Baltic Way 2023 counting and probability

Problem

For positive integers , let be the number of ways to partition a set with elements into non-empty parts. For example , because there are three ways to partition the set into two parts. For another example, . Let be a prime number, and , positive integers such that . Prove that for all .
Solution
Let be the number of surjective functions from a set with elements to a set with elements. It is not hard to see that . Indeed, a surjective function from to is the same thing as a partition of into parts, together with a numbering of the blocks of the partition, from to . For every partition there exists numberings, and therefore .

When , . It follows that for , if and only if . So it is enough to prove that if then for all .

There is a formula for : This formula is based on nothing more than the inclusion-exclusion principle. The number of surjective functions is the number of all functions times the number of functions that miss one particular element times the number of functions that miss two particular elements, etc. The number of functions that miss specified elements is .

Now suppose , are positive integers satisfying . Then for all integers . When is not divisible by this follows from Fermat's little theorem. When is divisible by , both sides are zero mod . But we only need the cases when anyway.

It follows that if then for all , and we are done.

Lemma: For every and : Proof. Select an element . There are ways to partition the remaining elements into different sets. By adding to any of them, we get a partition of the original set. All the partitions obtained this way are different and the only partitions that cannot be obtained this way are the ones where ends up alone. But in that case the other elements must form sets, yielding another partitions.

Lemma: For every prime, and : Proof. As and , this is obvious for or . We proceed by induction over and . Using the induction hypothesis and the previous lemma: Otherwise applying this times gives Where the last equality holds by Fermat's little theorem as implies .

We can now proceed to proving the problem statement by induction: If the statement is obvious. If or , we have the statement of the second lemma. So assume and , and that the problem statement holds for all smaller values. Then

Techniques

Inclusion-exclusionCounting two waysRecursion, bijectionInduction / smoothingFermat / Euler / Wilson theorems