5. Bijections, Injections, Surjections: Stirling
Total Page:16
File Type:pdf, Size:1020Kb
MAT2348 : Introduction to Discrete Mathematics Mike Newman, fall 2018 5. bijections, injections, surjections: Stirling functions We've talked about functions, and specifically bijections, as tools for enumerating. Now we'll look at enumerating functions. Let A and B be two sets, and f : A!B. Then f : A!B is a function if • For every a 2 A there is a unique b 2 B such that f(a) = b. There are special classes of functions (which in addition to the following must all satisfy the condition for being a function of course). A function f : A!B is . • . a bijection if for every b 2 B there is a unique a 2 A such that f(a) = b. • . an injection if for every b 2 B there is at most one a 2 A such that f(a) = b. • . a surjection if for every b 2 B there is at least one a 2 A such that f(a) = b. We saw, for instance, that f is a bijection if and only if it is an injection and a surjection. Note that injections, surjections and bijections relate naturally to size. Although we are not primarily concerned with set theory in this course, we offer the following two propositions for completeness. Proposition 5.1. Let f : A!B. • If f is a bijection then jAj = jBj. • If f is a injection then jAj ≤ jBj. • If f is a surjection then jAj ≥ jBj. Proof. The first statement is actually the definition of what it means for two sets to have the same size! For the second, assume f is an injection. Let B0 = ff(a): aAg; this is the subset of B that is the image of A. Let g : A!B0 be the map such that g(a) = f(a) for all a 2 A. Then g is injective because f is, and g is surjective by definition, so it is a bijection from A to B0. Therefore B = B0 [_ (B n B0), and so jBj = jB0j + jB n B0j = jAj + jB n B0j ≥ jAj. For the third, assume f is a surjection. For every b 2 B there is at least one and possibly several a 2 A such that f(a) = b. Let A0 be a subset of A such that there is exactly one a 2 A such that f(a) = b. Let g : A0 !B be the map such that g(a) = f(a) for all a 2 A0. Then g is surjective because f is, and g is injective by definition, so it is a bijection from A to B0. Therefore A = A0 [_ (A n A0), and so jAj = jA0j + jA n A0j = jBj + jB n B0j ≥ jBj. Proposition 5.2. Let A; B be sets. • If jAj = jBj then there exists a bijection f : A!B. • If jAj ≤ jBj then there exists an injection f : A!B. • If jAj ≥ jBj then there exists an surjection f : A!B. ∗ These notes are intended for students in mike's MAT2348. For other uses please say \hi" to [email protected]. 33 Proof. Again, the first statement is the definition of what it means for two sets to have the same size. For the second, let B0 be a subset of B with jAj = jB0j. Let g : A!B0 be a bijection (guaranteed by the definition of two sets having the same size!). Now define f : A!B by f(a) = g(a) for all a 2 A. Then f is an injection because g is. For the third, let A0 be a subset of A with jA0j = jBj. Let g : A0 !B be a bijection (guaranteed by the definition of two sets having the same size!). Now define f : A!B by f(a) = g(a) for all a 2 A0, and f(a) chosen arbitrarily from B for a 2 A n A0. Then f is an surjection because g is. In fact the Axiom of Choice is lurking in the proofs of Proposition 5.1 and Proposition 5.2.1 Since we are primarily dealing with finite sets in this course, there is no problem. You might think of what happens if the sets are not finite (specifically: uncountable), but this is beyond the scope of the this course. Problem 5.3. One should be careful with Proposition 5.2. It talks about the existence of a function. Consider two sets A and B. Assume jAj = jBj and f : A!B. Is it true that f is a bijection? Assume jAj ≤ jBj and f : A!B. Is it true that f is an injection? Assume jAj ≥ jBj and f : A!B. Is it true that f is an surjection? counting functions Let A and B be two finite sets with n = jAj and m = jBj. How many functions f : A!B are there? In order to specify a function f, then for every a 2 A we must identify a unique f(a) 2 B. There is no constraint on the values f(a), so we have m choices for each a 2 A and the Product Principle gives that there are mn functions f : A!B. This is just another point of view on Proposition 1.18, with repetition allowed. Proposition 5.4. Let n = jAj and m = jBj. The number of functions f : A!B is mn. Example 5.5. Consider a test of ten true/false questions. Each way of writing this test corresponds to a function f : f1; 2; 3; 4; 5; 6; 7; 8; 9; 10g ! fT;F g. The number of such functions is 210, so the number of ways of writing this test is 210. What is the number of bijections f : A ! B? We can identify the elements of A as A = fa1; a2; ··· ; ang and the elements of B as B = fb1; b2; ··· ; bmg. Then a bijection f is exactly de- scribed by the list of images of A, in other words as (f(a1); f(a2); ··· ; f(an)). Each of the f(ai) is a distinct element of B, and all elements of B occur, so this list is exactly an arrangement of the set B; in particular, m = n. This is Proposition 1.18, without repetition. Proposition 5.6. Let n = jAj = jBj. The number of bijections f : A!B is n!. What is the number of injections f : A ! B? Again, we can identify the elements of A as A = fa1; a2; ··· ; ang and the elements of B as B = fb1; b2; ··· ; bmg. An injection f is again a list 1 The Axiom of Choice states that given any family of sets, it is possible to choose one element from every set in the family. This may seem trivial, but if the family is uncountable, then this is (amazingly enough) not trivial, and in fact not implied by the basic axioms of set theory. 34 (f(a1); f(a2); ··· ; f(an)). Each of the fi is a distinct element of B, so this is exactly an arrangement of n elements of B; in particular n ≤ m. This is Proposition 1.18, without repetition. Proposition 5.7. Let n = jAj and m = jBj (with n ≤ m). The number of injections f : A!B is m(m − 1) ··· (m − n + 1) = m!=(m − n)!. Problem 5.8. Explain why the number of injections from A to B is zero if jBj < jAj. Do this in two ways: by applying the given formula, and directly from the definition of an injection. There is one further type of function we could enumerate: surjections. Problem 5.9. What is the number of surjections f : A ! B? Stirling numbers Let A and B be sets with n = jAj and m = jBj. We can imagine a function f : A!B as follows. We have m labelled boxes corresponding to the elements of B, and n labelled marbles corresponding to the elements of A. We must place each marble into exactly one box; if marble a goes in box b then this means f(a) = b. A function corresponds to a way of distributing the marbles, a bijection corresponds to a way of distributing the marbles with exactly one marble per box. An injection has at most one marble per box and a surjection has at least one marble per box. We will find the number of surjections by a sequence of approximations. We might first imagine that the number of surjections is approximately the number of functions. mn This is not exact, because we shouldn't count functions that aren't surjections. Consider a function f : A ! B n fbg for some particular b 2 B. This is not a surjection, but it was counted, so we should uncount it. The number of such functions is, by Proposition 5.4 equal to (m − 1)n. There are m distinct choices for b 2 B, so the product Principle gives that we have counted m(m − 1)n things we shouldn't have. Subtracting gives a better approximation. mn − m(m − 1)n This is still not quite right. Consider a function f : A ! B nfb; b0g for two distinct elements b; b0 2 B. This function has been counted once, and then uncounted twice, so we should recount it once to give a net count of zero. The number of such functions is (m − 2)n for a particular b; b0, and there are m 0 m n 2 choices for b; b , so the Product Principle gives 2 (m − 2) functions that need to be recounted.