Sampling with replacement
Let us consider two examples. Benjawan found a nice chocolate shop that sells kinds of chocolates. In the first example, Benjawan wants to buy a chocolate for each of the four best performing students in this class. How many possibilities does she have? The answer is clearly : a chocolate for each student can be picked in ways. In another scenario, Amelia forgot her PIN code for entering the CS building. The PIN is four digits long. How many possibilities does she need to go through before she tries all possibilities? Again, the answer is (each digit is between and , so ten possibilities). This type of counting arises in many scenarios in real life, and many of us end up doing it and believing immediately that our calculation is correct.
But is there any formal proof that such a calculation is correct? Let us try to make a general theorem out of it.
Let be an -element set and be an -element set. The number of possible mappings is .
Prove Theorem 22 by induction on .
Notice that our previous counting problems can be reduced to the theorem. Amelia's PIN is just a mapping where is the value of the -th digit. Benjawan's chocolate selection is the same: It is just the number of functions where is the -th ranked student and is the chocolate of type . The mapping means that the second-ranked student gets the third type of chocolate. Therefore, one may view Theorem 22 as a formal proof in support of counting methods that we have been using all along (e.g., another famous example is that tossing a dice times results in possibilities).
The next claim is well known to almost everyone, but how many of us actually prove it at least once in our life?
Any -element set has exactly subsets.
Notice that every subset can be represented by a function where if and otherwise. Therefore, counting the number of subsets of is the same as counting the number of functions . From the theorem, we have such functions.
One should remark a small gap in the above argument: We take it for granted that the number of functions is the same as the number of subsets of . In this case, it is relatively straightforward to see. In particular, showing that two sets and have exactly the same cardinality can be done by defining a bijection .
A function is called
- one-to-one if implies ,
- onto if for all , there exists such that , and
- bijection if it is one-to-one and onto.
Bijection often comes in handy as a tool for counting.
Prove that the function mapping from to is a bijection.
Prove Theorem 23 by induction on .
Let . Each -element set has exactly subsets of odd size.
Let and be the family1 of subsets of of odd and even sizes respectively. Define a bijection as follows. Fix element . Define if and otherwise. Function is one-to-one since implies that and onto since every set is mapped from either (when ) or from (when ). (do you see how this concludes the proof?).
Present an alternate proof of the above example by defining a bijection between and (the latter set has elements from Theorem 23).
Footnotes
-
This is just a fancy name to say that we are referring to a "set of sets". ↩