Quick description
If you can partition a set into pieces, of sizes , then has size . In particular, if all the pieces have the same size , then has size . These obvious facts can be surprisingly useful in calculating the size of various sets.
An equivalent statement is that, if a set is mapped into a set of size , and each has a preimage of size , then has elements. In particular, if all preimages have the same size , then has size .
The "functional" statement has a sort of dual: if you know that a set has size and can find a function such that every element of has exactly preimages in , then has size . Sometimes the best way to calculate the size of is to find a set that is bigger but simpler in structure, map it into and exploit this principle.
Prerequisites
Basic mathematical notation.
General discussion
If is a finite set and is a partition of with , then

The size of is

The number of partitions is given by .

If a set can be mapped bijectively to the collection then This is a special case of counting using a bijection.
One common way to partition a set is by defining an equivalence relation on it. Two examples below demonstrate this.
Example 1
The binomial coefficients are obtained as an application of partitioning. Let be a finite set. Let be all permutations of of length . We know that (see Example 1 on this page)
Let us call two elements of equivalent if they are permutations of each other. This is an equivalence relation on with each of its equivalence classes containing elements. It follows that the total number of equivalence classes is
Each equivalence class represents a subset of with elements. It follows that the number of subsets of of size is
Example 2
Let and let be the set of ordered strings of length from the alphabet where the repetition of the same letter is allowed. We would like to compute .
Let be the set of all possible configurations of distinct flags on poles, where on each pole multiple flags are allowed and the order of the flags is important. From Example 2 on this page we know that
Let us call two elements of equivalent if they can be obtained from one another by permuting the labels of the flags. There are flags, and therefore permutations of flag labels. Then each equivalence class of this relation contains factorial elements. Now note that each class can be represented uniquely by an element of . For example, for and , represents the equivalence class of elements of such that there are three flags in the first pole, two flags in the second pole and one each on the third and the fourth poles. It follows that the number of ordered strings from the alphabet of length is
Example 3
An important identity in elementary number theory is that . Here, is Euler's totient function: is defined to be the number of integers in that are prime to . To prove this identity, we will partition a (conveniently chosen) set of size into pieces, argue that there is one piece for each dividing , and show that the piece corresponding to has size .
Consider the set of positive integer multiples of lying in ; it is clear that has elements. We classify these fractions according to the denominator that appears when we reduce them to lowest terms. For example, the case would yield the following partition:
It's clear that each such denominator is a divisor of , and that a nonempty piece of the partition is associated with each divisor of , since belongs to the piece associated with .
Now, how many elements are in the piece of the partition? To answer that, we just look at the numerators of the reduced fractions: all the numerators appearing in the piece must be prime to (by definition of "lowest terms") and distinct. Further, any that is prime to must appear as some numerator, since is in lowest terms, lies in , and equals , so it belongs to . The identity follows.