Sampling without replacement
Let us revisit Benjawan's example. Let us say that she wants to buy different types of chocolates for the four best performing students in this class. Now the number of possibilities should be instead of . In the second scenario, if Amelia knows that she would never repeat the digits in her PIN, then she would only need to try possibilities. Such calculations follow from the following general theorem.
There are one-to-one mappings where and provided that (otherwise there are no such mappings by pigeonhole's principle).
We do induction on . When (the base case), there are one-to-one mappings from to . Now, consider any . Recall that , fix and choose the value in one of possibilities. By the induction hypothesis, there are possible mappings from to . Note that we can use the induction hypothesis since . Altogether, this implies the formula.
Let be an -element set. The number of ordered pairs is .
The intuition is that there are three possibilities for each : (i) , (ii) , and (iii) . So when we go over all such possibilities, we get . To turn this intuition into a formal proof, we want to define a bijection between and (as the latter has elements). Define where indicates which one of the three cases above corresponds to the -th element of (for some fixed arbitrary order of ). It is easy to verify that this is one-to-one and onto.