MATH10040 Chapter 4: Sets, Functions and Counting

Similar documents
distinct distinct n k n k n! n n k k n 1 if k n, identical identical p j (k) p 0 if k > n n (k)

Math 4707 Spring 2018 (Darij Grinberg): midterm 2 page 1. Math 4707 Spring 2018 (Darij Grinberg): midterm 2 with solutions [preliminary version]

42 Dependence and Bases

COMP 2804 Solutions Assignment 1

Discrete Mathematics: Lectures 8 and 9 Principle of Inclusion and Exclusion Instructor: Arijit Bishnu Date: August 11 and 13, 2009

Jacobi symbols. p 1. Note: The Jacobi symbol does not necessarily distinguish between quadratic residues and nonresidues. That is, we could have ( a

Math 155 (Lecture 3)

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

It is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function.

If a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?

6.4 Binomial Coefficients

A PROBABILITY PROBLEM

Math 61CM - Solutions to homework 3

Lecture Notes for Analysis Class

Exercises 1 Sets and functions

Infinite Sequences and Series

Axioms of Measure Theory

1.2 AXIOMATIC APPROACH TO PROBABILITY AND PROPERTIES OF PROBABILITY MEASURE 1.2 AXIOMATIC APPROACH TO PROBABILITY AND

Lecture Notes for CS 313H, Fall 2011

The Boolean Ring of Intervals

Cardinality Homework Solutions

ECE 901 Lecture 4: Estimation of Lipschitz smooth functions

Homework 1 Solutions. The exercises are from Foundations of Mathematical Analysis by Richard Johnsonbaugh and W.E. Pfaffenberger.

CIS Spring 2018 (instructor Val Tannen)

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

Bertrand s Postulate

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

1. By using truth tables prove that, for all statements P and Q, the statement

Chapter 6 Infinite Series

CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

Product measures, Tonelli s and Fubini s theorems For use in MAT3400/4400, autumn 2014 Nadia S. Larsen. Version of 13 October 2014.

Lecture 10: Bounded Linear Operators and Orthogonality in Hilbert Spaces

Automated Proofs for Some Stirling Number Identities

Lecture 10: Mathematical Preliminaries

1 Introduction. 1.1 Notation and Terminology

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

6.3 Testing Series With Positive Terms

Sequences and Series of Functions

Chapter 0. Review of set theory. 0.1 Sets

Double Derangement Permutations

Teacher s Marking. Guide/Answers

19.1 The dictionary problem

Ma 530 Introduction to Power Series

Bernoulli Polynomials Talks given at LSBU, October and November 2015 Tony Forbes

Ma/CS 6a Class 22: Power Series

Binomial transform of products

Lesson 10: Limits and Continuity

Lecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) =

Injections, Surjections, and the Pigeonhole Principle

Week 5-6: The Binomial Coefficients

Seunghee Ye Ma 8: Week 5 Oct 28

3 Gauss map and continued fractions

Section 5.1 The Basics of Counting

GROUPOID CARDINALITY AND EGYPTIAN FRACTIONS

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Math 451: Euclidean and Non-Euclidean Geometry MWF 3pm, Gasson 204 Homework 3 Solutions

Math F215: Induction April 7, 2013

Integrals of Functions of Several Variables

SOLVED EXAMPLES

Solutions to Math 347 Practice Problems for the final

Random Models. Tusheng Zhang. February 14, 2013

Summer MA Lesson 13 Section 1.6, Section 1.7 (part 1)

Measure and Measurable Functions

Bertrand s postulate Chapter 2

Square-Congruence Modulo n

1 Counting and Stirling Numbers

4 The Sperner property.

Convergence of random variables. (telegram style notes) P.J.C. Spreij

) is a square matrix with the property that for any m n matrix A, the product AI equals A. The identity matrix has a ii

Orthogonal Functions

Name Period ALGEBRA II Chapter 1B and 2A Notes Solving Inequalities and Absolute Value / Numbers and Functions

CHAPTER I: Vector Spaces

Lecture 6: Integration and the Mean Value Theorem. slope =

(ii) Two-permutations of {a, b, c}. Answer. (B) P (3, 3) = 3! (C) 3! = 6, and there are 6 items in (A). ... Answer.

Sets. Sets. Operations on Sets Laws of Algebra of Sets Cardinal Number of a Finite and Infinite Set. Representation of Sets Power Set Venn Diagram

Problem Set 2 Solutions

4.3 Growth Rates of Solutions to Recurrences

Mathematical Induction

18th Bay Area Mathematical Olympiad. Problems and Solutions. February 23, 2016

[ 11 ] z of degree 2 as both degree 2 each. The degree of a polynomial in n variables is the maximum of the degrees of its terms.

subcaptionfont+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0 subcaption ALGEBRAIC COMBINATORICS LECTURE 8 TUESDAY, 2/16/2016

MATH 324 Summer 2006 Elementary Number Theory Solutions to Assignment 2 Due: Thursday July 27, 2006

and each factor on the right is clearly greater than 1. which is a contradiction, so n must be prime.

(k) x n. n! tk = x a. (i) x p p! ti ) ( q 0. i 0. k A (i) n p

# fixed points of g. Tree to string. Repeatedly select the leaf with the smallest label, write down the label of its neighbour and remove the leaf.

Chapter IV Integration Theory

SOME FINITE SIMPLE GROUPS OF LIE TYPE C n ( q) ARE UNIQUELY DETERMINED BY THEIR ELEMENT ORDERS AND THEIR ORDER

Review Problems 1. ICME and MS&E Refresher Course September 19, 2011 B = C = AB = A = A 2 = A 3... C 2 = C 3 = =

MAS111 Convergence and Continuity

MATH 205 HOMEWORK #2 OFFICIAL SOLUTION. (f + g)(x) = f(x) + g(x) = f( x) g( x) = (f + g)( x)

Lecture Outline. 2 Separating Hyperplanes. 3 Banach Mazur Distance An Algorithmist s Toolkit October 22, 2009

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

7 Sequences of real numbers

Math 475, Problem Set #12: Answers

PUTNAM TRAINING PROBABILITY

REAL ANALYSIS II: PROBLEM SET 1 - SOLUTIONS

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics

MA131 - Analysis 1. Workbook 3 Sequences II

Tutorial F n F n 1

Mathematical Foundations -1- Sets and Sequences. Sets and Sequences

Transcription:

MATH10040 Chapter 4: Sets, Fuctios ad Coutig 1. The laguage of sets Iforally, a set is ay collectio of objects. The objects ay be atheatical objects such as ubers, fuctios ad eve sets, or letters or sybols of ay sort, or objects of thought, or objects that we observe i the real world. For the purposes of this course we are priarily iterested i sets whose objects are atheatical i ature, but we will also cosider other kids of sets for illustrative purposes. The objects of the set are called the eleets of the set. Notatio 1.1. If S is a set, ad a is a object, the we write a S to ea that a is a eleet of the set S ( we also say that a belogs to S) ad a S eas that a is ot a eleet of the set S. Exaple 1.2. Let S be the set of all people ad T the set of all livig people. The Julius Caesar S but Julius Caesar T. Notatio 1.3. We use braces ({ ad }) to describe sets i a explicit way. The set whose eleets are the letters a, b ad c ad the ubers 3, 5 ad 7 (ad which has o other eleets) is deoted {a, b, c, 3, 5, 7}. (As we will see, i describig a set the order i which eleets are listed is irrelevat). Here are soe stadard sets i atheatics: (1) The set of atural ubers N := {1, 2, 3,...}. Thus 1 N but 1 N. (2) The set of itegers Z = {..., 2, 1, 0, 1, 2,...}: 57 Z, 1 2 Z. (3) The set of ratioal ubers Q: 1 2 Q, 58 Q, 2 Q. (4) The set of all real ubers R: 2 R. 2 R Exaple 1.4. The eleets of sets ay be sets theselves. The followig set has three eleets, oe of which is a set: Thus A := {1, 2, {3, 4}}. 1 A, 2 A, {3, 4} A, but 3 A, 4 A. 1

2 1.1. Subsets. Notatio 1.5. If A ad B are sets we write A B (ad say A is cotaied i B or A is a subset of B ) if every eleet of A is also a eleet of B:i.e. A B x x A = x B. Exaple 1.6. We have N Z, Z Q, Q R. Exaple 1.7. Let A be the set {1, 2, {3, 4}}, as above. The {1, 2} A. However, {3, 4} A (sice 3 A, 4 A). Of course, {3, 4} A. Exaple 1.8. Let B be the set {1, 2, {1, 2}}. The {1, 2} B ad {1, 2} B. (It is, eedless to say, a very rare situatio whe a set is both a eleet ad a subset of aother set.) Here we prove a obvious stateet: Lea 1.9. If A, B ad C are sets ad if A B, B C the A C. Proof. Let a be ay eleet of A. Sice A B, a B. Sice B C every eleet of B is a eleet of C. I particular, a C. We ve show that every eleet of A is also a eleet of C. Thus A C. Reark 1.10. Note that, by defiitio, ay set A is a subset of itself (sice it is always true that x A = x A). Thus, it is always true that A A. Defiitio 1.11. If A is a set, the by a proper subset of A we ea a subset other tha A itself. If B is a proper subset of A we soeties deote this by B A. 1.2. The epty set. There is a uique set which has o eleets. It is called the epty set or the ullset. It is deoted. Thus the followig stateet follows: x, x. Note furtherore that the epty set is a subset of every other set (sice the stateet x = x A is vacuously true for ay object x: the hypothesis x is always false). Thus for ay set A we have A. Reark 1.12. Note that the epty set is itself a atheatical object; it is a particular exaple of a set. It is soethig rather tha othig. It ay help to visualize it as a epty bag. Exaple 1.13. Let X = { }. The X, sice X has a eleet, aely. Observe that X (true for every set) ad X (rare).

1.3. Uios of sets. If A ad B are sets the we for a ew set A B ( A uio B ) by poolig together the eleets of A ad the eleets of B ito a sigle set. Thus x A B x A or x B. Note that ay give eleet ca occur i a set oly oce. Exaple 1.14. If A = {1, 2, 3} ad B = {3, 5, 7} the A B = {1, 2, 3, 5, 7}. Siilarly {1, 2, a, b, c} {1, 3, b, d, f} = {1, 2, 3, a, b, c, d, f}. Exaple 1.15. If A is the set of all Irish people ad B is the set of all astrooers, the A B is the set of all people who are either Irish or astrooers. Reark 1.16. Note that if A ad B are ay two sets, the A A B, B A B. More geerally, if A 1, A 2, A 3... is ay list of sets, we defie A 1 A 2 A 3 = (A 1 A 2 ) A 3 to be the set cosistig of those eleets which belog to (at least) oe of the three sets ad 3 etc. A 1 A 2 A 3 A 4 = ((A 1 A 2 ) A 3 ) A 4 1.4. Itersectio of Sets. If A ad B are sets the we for a ew set A B ( A itersect B or the itersectio of A ad B) by icludig oly the eleets which belog both to A ad to B. Thus x A B x A ad x B. Exaple 1.17. If A = {1, 2, 3} ad B = {3, 5, 7} the A B = {3}. {1, 2, a, b, c} {1, 3, b, d, f} = {1, b}. Exaple 1.18. If A is the set of all Irish people ad B is the set of all astrooers, the A B is the set of all people who are both Irish ad astrooers; i.e. the set of all Irish astrooers. Reark 1.19. Note that if A ad B are ay two sets, the A B A, ad A B B. As i the case of uios, we ca take itersectios of three or ore sets: A 1 A 2 A 3 = (A 1 A 2 ) A 3 is the set cosistig of those eleets which belog to all three sets. Etc.

4 1.5. Disjoit sets. Defiitio 1.20. We say that two sets A ad B are disjoit if A B = ; i.e. if they have o eleets i coo. Exaple 1.21. The set of all cats is disjoit fro the set of all dogs. Exaple 1.22. The set N is disjoit fro the set R <0 := {x R x < 0}. Exaple 1.23. The set of all itegers divisible by 3 is ot disjoit fro the set of all itegers divisible by 4, sice the iteger 12 belogs to both sets. Defiitio 1.24. We say that a set A is the disjoit uio of two subsets B ad C if A = B C ad B C =. We ofte deote this by A = B C. Exaple 1.25. Z is the disjoit uio of the set of eve itegers ad the set of odd itegers. More geerally we say that A is the disjoit uio of the subsets A 1,..., A if (1) A = A 1 A ad (2) A i A j = whe i j (we say that the collectio A 1,..., A is pairwise disjoit) ad we deote this by A = A 1 A 2 A. Exaple 1.26. Let A 0 = { Z 0 (od 3)}, A 1 = { Z 1 (od 3)} ad A 2 = { Z 2 (od 3)}. The Z = A 0 A 1 A 2. 1.6. Equality of Sets. A set is copletely deteried by its eleets: i.e. two sets are equal if they have precisely the sae eleets. Thus if A ad B are sets the A = B A B ad B A. Thus if we wish to prove that A = B we ust prove that A B ad that B A, or equivaletly that for ay x, x A = x B ad x B = x A. Here is a siple exaple of provig a (fairly obvious) stateet usig these defiitios: Lea 1.27. Let A ad B be ay two sets. Prove that A B B = A B.

Proof. = : Suppose that A B. We ust show that B = A B. Now it is always true that B A B. It reais to prove that A B B: Let x A B. The, by defiitio, x B or x A. If x B the x B. Otherwise x A ad hece x B sice A B. So either way, x B ad we are doe. =: Coversely, suppose that B = A B. The A A B (always true) = A B. 1.7. Subsets defied by properties. Ay give set has ay subsets i geeral. I practice ost are either uiterestig or ipossible to describe or iagie. (It will ever be possible to describe or fully iagie all the ifiitely ay subsets of the set R of real ubers.) The iterestig or useful subsets are those which correspod to soe property or list of properties. Let P (x) deote a stateet about a variable x; eg, x is a astrooer, x > 0, x is prie. If a is the ae of a object the we ca substitute it i for x to get a stateet P (a) which ay be either true or false: Kepler is a astrooer, 5 > 0, 12 is prie If A is ay set, the we write {a A P (a)} to deote the subset of A cosistig of those eleets a for which the stateet P (a) is true; it is the subset of A described by the property P. Exaple 1.28. N = { Z > 0}. Exaple 1.29. The iterval [1, 2] cosistig of all real ubers betwee (or equal to) 1 ad 2 is the set {x R x 1 ad x 2} = {x R 1 x 2}. Exaple 1.30. If A ad B are ay sets the A B = {x A x B} = {x B x A}. Exaple 1.31. { Z 2 } is the set of all eve itegers. { Z 3 ad > 11} is the set of all itegers which are greater tha 11 ad divisible by 3. 1.8. Differeces ad copleets. If A ad B are ay sets the the (set-theoretic) differece A \ B is defied by A \ B := {x A x B}. Exaple 1.32. Let A = {1, 2, 3, a, b, c} ad B = {2, 4, 6, a, c, e}. The A \ B = {1, 3, b} ad B \ A = {4, 6, e}. Reark 1.33. Note that A B is always disjoit fro A \ B ad that A = (A B) (A \ B). 5

6 Exaple 1.34. Let A = { Z 2 } ad A = { Z 3 }. The while A \ B = { Z 2 ad 3 } = {..., 2, 2, 4, 8, 10, 14,...} A B = { Z 2 ad 3 } = { Z 6 } = {..., 12, 6, 0, 6, 12,...}. Reark 1.35. If A ad B are ay sets ad if x A B the oe ad oly oe of the followig three stateets about x is true: Thus (1) x belogs to A but ot B: x A \ B. (2) x belogs to B but ot A: x B \ A. (3) x belogs to both A ad B: x A B. A B = (A \ B) (A B) (B \ A). Exercise 1.36. Draw a picture illustratig this last reark. 1.9. The Power Set of a set. Defiitio 1.37. If A is ay set the the power set of A, which we will deote P(A), is the set whose eleets are precisely the subsets of A. Exaple 1.38. Let A = {a}. The A has precisely two subsets; aely, ad A. Thus P(A) = {, A} = {, {a}}. Reark 1.39. If A is ay oepty set, the A always has the two subsets ad A. So P(A) always has at least two eleets. Exaple 1.40. Let A = {1, 2}. The A has four subsets:, {1}, {2} ad A = {1, 2}. Thus P(A) = {, {1}, {2}, {1, 2}}. Reark 1.41. The set {a} whose oly eleet is the object a should ot be cofused the object a itself. Exaple 1.42. Note that P( ) = { }. This is ot the epty set. Exercise 1.43. Let A = {1, 2, 3}. The A has eight subsets i total; P(A) has eight eleets. List the. 1.10. Cartesia products. Defiitio 1.44. Let A ad B be ay oepty sets (we allow A = B). The cartesia product of A ad B, deoted A B is the set whose eleets are all ordered pairs of the for (a, b) where a A ad b B: A B := {(a, b) a A, b B}.

Reark 1.45. The key property of ordered pairs is that order of the eleets atters: If a b the (a, b) (b, a). More geerally the rule goverig ordered pairs is the followig: The ordered pair (a, b) is equal to the ordered pair (c, d) if ad oly if a = c ad b = d. Exaple 1.46. If A = {1, 2} ad B = {a, b, c} the A B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}. So A B has 2 3 = 6 eleets. Exaple 1.47. R R, also deoted R 2, is the cartesia plae cosistig of all pairs (x, y) of real ubers x ad y. It is visualized as a ifiite plae cotaiig two perpedicular lies (or axes ), oe horizotal ad the other vertical, i which the eleet (x, y) labels the poit whose (perpedicular) distace to the vertical axis is x ad whose distace to the horizotal axis y. The ubers x ad y are the coordiates of the poit. (See your calculus course for details.) Exaple 1.48. Z Z = Z 2 R 2 is the iteger lattice i R 2 ; it is the set of all poits both of whose coordiates are itegers. Defiitio 1.49. If we have three sets A, B, C we ca for the product A B C whose eleets are all ordered triples (a, b, c) with a A, b B ad c C. More geerally, if A 1,..., A is a list of sets the A 1 A is the set whose eleets are all ordered -tuples (a 1,..., a ) with a i A i for i = 1, 2,...,. Reark 1.50. Clearly we ca idetify the set (A B) C with the set A B C. The eleets of the first have the for ((a, b), c) ad those of the secod look like (a, b, c). Either way, these are just ordered triples, ad it is both coveiet ad reasoable to regard the as beig the sae. 7 2. Cardiality ad Coutig Defiitio 2.1. A set with fiitely ay eleets is called a fiite set. Otherwise it is a ifiite set. Exaple 2.2. The set {1, 2, 3} is fiite. The sets Z, Q, R are all ifiite. Exaple 2.3. The iterval [1, 2] = {x R 0 x 1} is a ifiite set, sice it has ifiitely ay eleets. (However it is a fiite iterval sice it has fiite legth.)

8 Defiitio 2.4. If A is a fiite set the the uber of eleets i A is called the cardiality of A ad is deoted A (ad i soe texts as A). Exaple 2.5. The cardiality of {1, 2, 3} is 3: Siilarly, {a, b, c} = 3. {1, 2, 3} = 3. Exaple 2.6. {a, b, c, d} = 4 but {a, b, {c, d}} = 3. Exaple 2.7. = 0. P( ) = 1 (see Exaple 1.42). We will use repeatedly below the followig iportat (ad obvious ) basic coutig priciple: If A is a fiite set ad if A = A 1 A 2 A the A = A 1 + A 2 + + A. We ll begi with soe siple applicatios: Lea 2.8. Let A 1 ad A 2 be ay two fiite sets. The A 1 A 2 = A 1 + A 2 A 1 A 2. Proof. Recall that A 1 A 2 = (A 1 \ A 2 ) (A 1 A 2 ) A 2 \ A 1. Thus (1) But A 1 A 2 = A 1 \ A 2 + A 1 A 2 + A 2 \ A 1. A 1 = (A 1 \ A 2 ) (A 1 A 2 ) = A 1 = A 1 \ A 2 + A 1 A 2 = A 1 \ A 2 = A 1 A 1 A 2. Siilarly A 2 \ A 1 = A 2 A 1 A 2. Substitutig these back ito equatio (1) gives A 1 A 2 = ( A 1 A 1 A 2 ) + A 1 A 2 + ( A 2 A 1 A 2 ). We ca exted to this to a uio of three sets: Lea 2.9. If A 1, A 2 ad A 3 are ay three fiite sets the A 1 A 2 A 3 = A 1 + A 2 + A 3 A 1 A 2 A 1 A 3 A 2 A 3 + A 1 A 2 A 3.

9 Proof. Applyig Lea 2.8 to two sets A 1 A 2 ad A 3 we obtai (2) Now A 1 A 2 A 3 = A 1 A 2 (A 1 A 2 ) A 3. (A 1 A 2 ) A 3 = (A 1 A 3 ) (A 2 A 3 ) (Prove this!) Thus applyig Lea 2.8 to A 1 A 3 ad A 2 A 3 gives (A 1 A 2 ) A 3 = A 1 A 3 + A 2 A 3 A 1 A 2 A 3. Also, by Lea 2.8, A 1 A 2 = A 1 + A 2 A 1 A 2. Substitutig these forulae back ito equatio 2 gives the result. Reark 2.10. These last two leas are exaples of the Iclusio-Exclusio priciple for coutig. Exercise 2.11. Figure out the geeral forula for coutig A 1 A. Prove it by iductio o. (This is difficult. Cogratulatios if you ca do it by your self.) Here are soe exaples of the Iclusio-Exclusio priciple i actio: Exaple 2.12. A large group of people cotais 100 Irish people ad 200 studets. Of these, 43 are Irish studets. How ay people i the group are either Irish or studets. Solutio: Let I be the set of Irish people i the group, ad S the set of studets. The I S = I + S I S = 100 + 200 43 = 257. Exaple 2.13. How ay positive itegers less tha or equal to 2000 are divisible by either 3 or 4 or 5? Solutio: We begi by recallig that the uber of positive itegers less tha or equal to N which are divisible by d is N/d. Let A 1 = { 2000 3 }, A 2 = { 2000 4 } ad A 3 = { 2000 5 }. Thus we are asked to calculate A 1 A 2 A 3. Now A 1 = 2000/3 = 666. A 2 = 2000/4 = 500 ad A 3 = 2000/5 = 400. A 1 A 2 is the set of all positive itegers less tha or equal to 2000 which are divisible by both 3 ad 4. Sice (3, 4) = 1, a iteger is divisible by 3 ad 4 if ad oly if it is divisible by 3 4 = 12. Thus A 1 A 2 = { 2000 12 } ad A 1 A 2 = 2000/12 = 166.

10 Siilarly, A 1 A 3 = { 2000 15 } ad hece A 1 A 3 = 2000/15 = 133. A 2 A 3 = { 2000 20 } ad hece A 1 A 3 = 2000/20 = 100. Fially A 1 A 2 A 3 = { 2000 60 } ad thus A 1 A 2 A 3 = 2000/60 = 33. Therefore A 1 A 2 A 3 = A 1 + A 2 + A 3 A 1 A 2 A 1 A 3 A 2 A 3 + A 1 A 2 A 3 = 666 + 500 + 400 166 133 100 + 33 = 1200. Thus exactly 1200 of the ubers fro 1 to 2000 are divisible either by 3 4 or 5 (ad therefore the reaiig 800 are divisible by oe of these three ubers). Lea 2.14. Let A ad B be fiite sets. The A B = A B. Proof. Let = B. We label the eleets of B: b 1,..., b. The A B = A {b 1 } A {b 2 } A {b }. Therefore A B = A {b 1 } + + A {b } = A + + A = A = A B. Corollary 2.15. Let A 1,..., A be fiite sets. The A 1 A = A 1 A 2 A. Proof. We will prove this by iductio o 2. The case = 2 is the Lea just proved. Suppose the result is kow for ad that A 1,..., A, A +1 are sets. The A 1 A A +1 = (A 1 A ) A +1 = ( A 1 A ) A +1 by the case = 2 = ( A 1 A ) A +1 by our id. hyp. = A 1 A A +1 as required.

11 If A is ay set we let A := A A }{{} Thus, takig A 1 = A 2 = = A = A i the last corollary we obtai: Corollary 2.16. Let A be ay fiite set. The A = A. Exaple 2.17. The eleets of the set {0, 1} are called biary strigs of legth. For exaple, {0, 1} 3 = {0, 1} {0, 1} {0, 1}. Thus, the biary strigs of legth 3 are: (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1). There are eight biary strigs of legth 3. I geeral, by the last corollary, the uber of biary strigs of legth is {0, 1} = {0, 1} = 2. 3. Fuctios Notatio 3.1. Let A ad B be ay two sets. Iforally, a fuctio ( or ap ) f fro A to B associates to each eleet of A oe ad oly oe eleet of B. The set A is called the doai of the fuctio f, ad the set B is called the codoai or target of f. (We will soeties refer to eleets of the doai as iputs of the fuctio.) If a A, the eleet of the set B which the fuctio f associates to a is called the value of f at a ad is usually deoted f(a). (We will soeties refer to this as the output of f at a, but this is ot really stadard atheatical teriology.) We ofte ecapsulate this iforatio with the otatio: f : A B, a f(a). Exaple 3.2. Let A = {1, 2, 3} ad let B = {a, b}. We ca defie or costruct aps fro A to B at will, siply by specifyig the value of the fuctio at each iput, 1, 2 ad 3: For exaple, let f : A B be the followig fuctio: f(1) = b f(2) = b f(3) = a.

12 Let g : A B be the fuctio g(1) = b g(2) = a g(3) = b. (Q: How ay fuctios are there fro A to B?) Siilarly, we ca costruct fuctios fro B to A: Let h : B A be the fuctio h(a) = 2 h(b) = 3. (Q: How ay fuctios are there fro B to A?) If the doai of a fuctio is ifiite, the, of course, we caot describe the fuctio, iput by iput, i this way. The fuctios of atheatical iterest i such cases are usually costructed via a forula or procedure of soe kid: i.e. we describe a procedure for deterig the value of the fuctio at a typical eleet of the doai x. Exaple 3.3. The squarig fuctio o R is the fuctio f : R R, x x 2. Thus for ay real uber x, the value of this fuctio is x 2 ; i.e. R, f(x) = x 2. Thus f(0) = 0 2 = 0, f(5) = 5 2 = 25, f(π) = π 2, f( 5) = ( 5) 2 = 25,... Exaple 3.4. The idetity fuctio o R is the fuctio f : R R, x x. Thus f(x) = x for all real ubers x. Exaple 3.5. I fact, we ca do the sae for ay set A. x The idetity fuctio o a set A is the fuctio whose value at ay iput a is agai a. This is oe of the ost basic ad iportat exaples of a fuctio. We will use the otatio Id A for this fuctio. Thus, the doai ad codoai of Id A are both A: Id A : A A, a a.

If we take the set A = {1, 2, 3}, for exaple, the Id A (1) = 1 Id A (2) = 2 Id A (3) = 3. Exaple 3.6. We have already et the floor x of a real uber x: it is the largest iteger which is less tha or equal to x. We ca use it to costruct a fuctio: f : R Z, x x. So f(π) = π = 3, f(78.2) = 78.2 = 78, f(28/6) = 28/6 = 4 etc. Exaple 3.7. Let A be ay set ad let B be a subset of A. The idicator fuctio of B i A is the fuctio, 1 B, which seds a to 1 if a B ad to 0 otherwise: It is the fuctio defied by 1 B : A {0, 1} a A, 1 B (a) = { 1, a B 0, a B. For exaple, if A = {a, b, c, d} ad B = {a, c} the 1 B (a) = 1 1 B (b) = 0 1 B (c) = 1 1 B (d) = 0. 13 Exaple 3.8. Let B A. The the ap f : B A, f(b) = b is called the iclusio ap of B i A. (Note that if B A it is ot equal to the idetity fuctio Id B ; it has a differet codoai.) 3.1. Copositio of Fuctios. Suppose that A, B ad C are ay sets (ot ecessarily distict fro each other) ad that f : A B ad g : B C are fuctios. Thus if a A, the value of f at a, f(a), is a eleet of B, ad therefore is a adissible iput for the fuctio g. The value of g at f(a), g(f(a)) is a eleet of C. Thus, usig f ad g, we have a ethod by doig f first, ad the g to associate to ay eleet a A a eleet g(f(a)) i C; i.e. by doig g after f, we have a ew fuctio fro A to C. Defiitio 3.9. Give two fuctios f : A B ad g : B A, g coposed with f, deoted g f is the fuctio described as follows: g f : A C, a g(f(a)).

14 Exaple 3.10. Let A = {1, 2, 3}, B = {a, b} ad C = {5, 6, 7}. f : A B be the fuctio f(1) = a f(2) = b f(3) = b ad let g : B C be the fuctio g(a) = 5 g(b) = 7. Let The g f : A C is the fuctio (g f)(1) = g(f(1)) = g(a) = 5 (g f)(2) = g(f(2)) = g(b) = 7 (g f)(3) = g(f(3)) = g(b) = 7. Exaple 3.11. Let f : R R be the fuctio defied by f(x) = x 3, ad let g : R R be the fuctio g(x) = x + 3. The the fuctio g f : R R is give by (g f)(x) = g(f(x)) = g(x 3 ) = x 3 + 3 x R. O the other had, the coposite f g : R R is also defied, ad it is give by (f g)(x) = f(g(x)) = f(x + 3) = (x + 3) 3 x R. Note that the fuctios g f ad f g are quite differet. Reark 3.12. Observe that if f ad g are ay two fuctios the the coposite fuctio g f is defied oly if the codoai of f is the sae as the doai of g. Whe this happes we say that g ca be coposed with f. 3.2. Equality of Fuctios. It will be iportat to us below to uderstad exactly what is eat by sayig that the fuctio f equals the fuctio g: Defiitio 3.13. Let f ad g be ay two fuctios. The f = g if ad oly if (1) The doai of f is equal to the doai of g, (2) The codoai of f is equal to the codoai of g ad (3) f(a) = g(a) for all eleets a of the doai. Exaple 3.14. Let f : R Z be the fuctio f(x) = x ad let g : R R be the fuctio g(x) = x. The f g sice the codoai of f is ot the sae as the codoai of g.

Exaple 3.15. Let f : R R be the fuctio f(x) = x 2 ad let g : [0, ) R be the fuctio g(x) = x 2. (Here [0, ) is a otatio for the iterval {x R x 0} of all oegative real ubers.) The f g sice they have differet doais. Exaple 3.16. Let A = {1, 2, 3}, B = {a, b, c}, C = A = {1, 2, 3}. Cosider the followig four fuctios: f 1 : A B, f 1 (1) = a, f 1 (2) = b, f 1 (3) = c f 2 : A B, f 2 (1) = b = f 2 (2), f 2 (3) = c 15 ad g 1 : B C, g 1 (a) = 1 = g 1 (b), g 1 (c) = 2 g 2 : B C, g 2 (a) = 3, g 2 (b) = 1, g 2 (c) = 2. Note that f 1 f 2 ad g 1 g 2. However, I Clai that g 1 f 1 = g 2 f 2. First ote that both of these fuctios have the sae doai (A) ad the sae codoai (C). We eed fially to check that they take the sae value at each iput: (g 1 f 1 )(1) = g 1 (f 1 (1)) = g 1 (a) = 1, (g 2 f 2 )(1) = g 2 (f 2 (1)) = g 2 (b) = 1 (g 1 f 1 )(2) = g 1 (f 1 (2)) = g 1 (b) = 1, (g 2 f 2 )(2) = g 2 (f 2 (2)) = g 2 (b) = 1 (g 1 f 1 )(3) = g 1 (f 1 (3)) = g 1 (c) = 2, (g 2 f 2 )(3) = g 2 (f 2 (3)) = g 2 (c) = 2 Lea 3.17. Let f : A B be ay fuctio. The (1) f Id A = f. (2) Id B f = f. Proof. (1) First ote that f ca be coposed with Id A sice the codoai of Id A is A, which is the doai of f. The fuctios f ad f Id A both have doai A ad codoai B. Fially, for ay a A, we have (f Id A )(a) = f(id A (a)) = f(a). So the two fuctios are equal. (2) Siilar. Do it as a exercise. Reark 3.18. Note that if f : A B is a fuctio ad if A B, the the coposites Id A f ad f Id B are ot defied.

16 3.3. Surjective aps. Defiitio 3.19. Give a fuctio f : A B, the iage (or rage) of f, deoted Iage(f) or f(a), is the subset of B cosistig of all values (or outputs) of the fuctio f; i.e. it is the set {b B b = f(a) for soe a A}. Defiitio 3.20. A ap f : A B is surjective or oto if Iage(f) = B; i.e. f is surjective if for every b B there is at least oe a A with f(a) = b. Reark 3.21. Aother iforal way to say this is that the fuctio f is surjective if every eleet of the target gets hit. Exaple 3.22. The doublig fuctio f : R R, f(x) = 2x is surjective. Proof. To prove this we ust show that ay eleet, y say, i the codoai R lies i the iage of this fuctio; i.e. we ust show that every real uber y is twice soe other real uber. We spell out the arguet: Let y R. The y = 2 y ( y ) 2 = f. 2 Exaple 3.23. The squarig fuctio f : R R, f(x) = x 2 is ot surjective. The uber 1 R does ot lie i the iage of this ap. Exaple 3.24. The fuctio f : R [0, ) is oto: Let y [0, ). The y 0. So y = ( y) 2 = f( y) lies i Iage(f). Exaple 3.25. The ap f : R R, x si(x) is ot surjective (for exaple 2 is ot i the iage). But the ap f : R [ 1, 1], x si(x) is surjective. For real fuctios fuctios f : R R surjectivity ca ofte be read off fro the graph of the fuctio. Recall that the graph of the fuctio is the set {(x, y) R 2 y = f(x)} R 2. We have the followig criterio: Lea 3.26. Let f : R R be a real fuctio. The f is surjective if ad oly if every horizotal lie cuts the graph at least oce. Proof. Suppose f is surjective. Let L be a horizotal lie. The equatio of L is y = b for soe real uber b. Sice f is surjective, b = f(a) for soe a R. Thus the poit (a, b) lies o the graph ad the lie L. Coversely suppose every horizotal lie cuts the graph. Let b R. The horizotal lie y = b cuts the graph at soe poit; i.e. the graph cotais

the poit (a, b) for soe a R. By defiitio of the graph, it follows that b = f(a). Thus b Iage(f) ad f is surjective. The followig is a iportat geeral criterio for the surjectivity of a ap: Theore 3.27. Let f : A B be a fuctio. The followig stateets are equivalet: (1) f is surjective. (2) There exists a fuctio g : B A with the property that f(g(b)) = b for all b B. Proof. (1)= (2): Suppose f is surjective. We describe how to costruct a fuctio g : B A with the required property: For each b B choose soe a A with f(a) = b ad defie g(b) = a. The, by defiitio, f(g(b)) = f(a) = b. (2)= (1): Suppose that a fuctio g exists with the stated property. Let b B. Let a = g(b). The f(a) = f(g(b)) = b. So b Iage(f) ad f is surjective. Exaple 3.28. Let f : R [0, ) be the fuctio f(x) = x 2. We have see already that f is surjective. Let g : [0, ) R be the fuctio g(x) = x. The g has the property stated i the theore: Let b [0, ). The f(g(b)) = f( b) = ( b) 2 = b. However g is ot the oly fuctio with this property. For exaple the fuctio h : [0, ) R, x x also has this property: Let b [0, ). The f(h(b)) = ( b) 2 = b. Exaple 3.29. Let f : R Z be the floor fuctio x x. f is surjective. I fact it is easy to fid a fuctio g as i the theore. For exaple, let g : Z R be the iclusio ap defied by g() =. The, for all Z, f(g()) = f() = =. However there are a ifiity of other fuctios Z R with the required property. For exaple, fix soe uber a lyig betwee 0 ad 1. We use this uber to defie a fuctio fro Z to R which we ll ae g a : The for every Z g a : Z R, + a. f(g a ()) = f( + a) = + a = sice < + a < + 1. Let us cosider the situatio described i the Theore: We have two fuctios f : A B ad g : B A satisfyig f(g(b)) = b for all b B. Note that this later stateet is etirely equivalet to the equatio of fuctios f g = Id B. 17

18 Thus we ca rephrase the Theore as sayig that f : A B is surjective if ad oly if there is a fuctio g : B A satisfyig f g = Id B. Defiitio 3.30. Suppose give two fuctios f : A B ad g : B A which satisfy f g = Id B. The g is said to be a right iverse of f ad f is said to be a left iverse of g. With this teriology, the theore says that a ap is surjective if ad oly if it has a right iverse. Note, however, that our exaples show that a surjective fuctio ca have ay eve ifiitely ay distict right iverses. 3.4. Ijective aps. Defiitio 3.31. A fuctio f : A B is said to be ijective or 1-to-1 if it has the property that uequal eleets of the doai have uequal values: For all a 1, a 2 A if a 1 a 2 the f(a 1 ) f(a 2 ). Note that a equivalet ad ofte ore useful way to state this is: f is ijective if it has the property that, for all a 1, a 2 A, f(a 1 ) = f(a 2 ) = a 1 = a 2. Exaple 3.32. The doublig fuctio f : R R, x 2x is ijective: For suppose f(a 1 ) = f(a 2 ). The 2a 1 = 2a 2. Dividig by 2, we get a 1 = a 2 as required. Exaple 3.33. Let f : R R be the ap f(x) = x 2. The f is ot ijective: 1 1 i R, but f( 1) = 1 = f(1). So two differet iputs yield the sae output. Exaple 3.34. However, the fuctio f : [0, ) R, x x 2 is ijective. For suppose that f(a 1 ) = f(a 2 ). The a 2 1 = a 2 2. It follows that a 2 1 = a 2 2. But a 1 = a 2 1 ad a 2 = a 2 2 sice a 1, a 2 0. Thus a 1 = a 2 as required. Exaple 3.35. The ap f : {1, 2, 3} {1, 2, 3} defied by f(1) = 1, f(2) = 3 ad f(3) = 1 is ot ijective sice 1 3 but f(1) = f(3). Lea 3.36. Let f : R R be a fuctio. The f is ijective if ad oly if every horizotal lie i R 2 itersects the graph at ost oce. Proof. Suppose that f is ijective ad that L is a horizotal lie. The equatio of L is y = b for soe b R. Suppose, for the sake of cotradictio that L itersects the graph at two poits. Thus there are distict poits (a 1, b) ad (a 2, b) lyig o L ad o the graph of f. By defiitio of the graph, we have f(a 1 ) = b = f(a 2 ), which cotradicts ijectivity of f. Coversely, suppose that every horizotal lie cuts the graph at ost oce. Suppose that f(a 1 ) = f(a 2 ) for soe a 1, a 2 R. We ust show that a 1 = a 2. Let b = f(a 1 ) = f(a 2 ). The poits (a 1, b) ad (a 2, b) lie o the

graph ad o the horizotal lie y = b. By our hypothesis, they ust be the sae poit ad hece a 1 = a 2. We also have the followig geeral criterio of ijectivity: Theore 3.37. A fuctio f : A B is ijective if ad oly if it has a left iverse g : B A; i.e. if ad oly if there is a fuctio g : B A satisfyig g f = Id A. Proof. Observe that the coditio g f = Id A is equivalet to g(f(a)) = a for all a A. Suppose ow that f is ijective. We costruct a right iverse g : B A as follows: Choose oce ad for all soe fixed eleet, call it p, i A. Let b B. We ust describe the eleet g(b) A. There are two possibilities: (1) If b Iage(f), the b = f(a) for soe uique a A. We set g(b) = a. (2) If b Iage(f), we siply let g(b) = p. Now let a be ay eleet of A. Let b = f(a). The b Iage(f) ad a is the uique eleet of A which is apped to b by f. So g(b) = a by defiitio. Thus g(f(a)) = g(b) = a as required. Coversely, suppose that f has a left iverse g : B A. We will show that f is ijective: Suppose that a 1, a 2 A satisfy f(a 1 ) = f(a 2 ). The a 1 = g(f(a 1 )) = g(f(a 2 )) = a 2. Exaple 3.38. Let f : Z R be the iclusio ap. This is clearly ijective. Note that the floor fuctio g : R Z, x x is a left iverse: For all Z, g(f()) = g() = =. There are, however, (ifiitely) ay other left iverses of f. For exaple, let h : R Z be the fuctio described as follows: { x, x Z h(x) = 0, x Z The h(f()) = h() = for all Z; i.e. h f = Id Z. 3.5. Bijective aps. Defiitio 3.39. A ap f : A B is said to be bijective if it is both ijective ad surjective. We ofte call such a ap a bijectio or a bijective correspodece. Thus f : A B is bijective if every eleet b of B is the value of f at oe ad oly oe eleet a ad A; i.e. the fuctio f pairs the eleets of A with the eleets of B i such a way that each eleet of A gets paired with oe ad oly oe eleet B ad vice versa. 19

20 Exaple 3.40. The ap f : {1, 2, 3} {a, b, c} give by f(1) = a f(2) = b ad f(3) = c is oe exaple of a bijectio betwee these two sets. The ap g : {1, 2, 3} {a, b, c} give by g(1) = b, g(2) = c ad g(3) = a is aother bijectio betwee these two sets. Exaple 3.41. For ay set A the idetity ap Id A is a siple exaple of a bijectio fro A to itself. Exaple 3.42. The ap f : {1, 2, 3} {1, 2, 3} give by f(1) = 2, f(2) = 1 ad f(3) = 3 is bijectio fro the set {1, 2, 3} to itself. Defiitio 3.43. A perutatio of a fiite set A is a bijectio fro A to itself. Puttig together Leas 3.26 ad 3.36 we get: Lea 3.44. A real fuctio f : R R is bijective if ad oly if every horizotal lie cuts the graph exactly oce. O the other had, by Theores 3.27 ad 3.37 a arbitrary fuctio f : A B is bijective if ad oly if f has both a right iverse g : B A ad a left iverse h : B A. Theore 3.45. Suppose that f : A B has both a right iverse ad a left iverse. The they are equal to each other ad f has oly oe right or left iverse. Proof. First Proof Let g : B A be a right iverse of f, ad let h : B A be a left iverse. h ad g have the sae doai ad codoai, so it reais to show that g(b) = h(b) for all b B. Let b B. Sice f is bijective, there is a uique a A satisfyig f(a) = b. Sice g is a right iverse, we have f(g(b)) = b also. By uiqueess of a, this iplies g(b) = a. O the other had, sice h is a left iverse, we have h(f(a)) = a. But f(a) = b. So h(b) = a = g(b). Thus g = h as required. If g is aother right iverse, the we also have g = h ad hece g = g. So there is oly oe right iverse. Siilarly there is oly oe left iverse (which is also a right iverse). Secod Proof Let g : B A be a right iverse. The f g = Id B. Let h : A B be a left iverse. The h f = Id A. We show that g = h as follows: h = h Id B = h (f g) = (h f) g = Id A g = g.

Defiitio 3.46. Give a fuctio f : A B, a fuctio g : B A is called a (2-sided) iverse if it is both a left ad a right iverse. Note that if g is a 2-sided iverse of f the f is a 2-sided iverse of g by syetry. If a 2-sided iverse exists the there is oly oe (by Theore 3.45). We deote it f 1. We coclude: Theore 3.47. A fuctio f is bijective if ad oly it has a 2-sided iverse f 1. If f : A B is a bijectio, the the iverse ap is the ap which seds every eleet of B back to where it cae fro. Exaple 3.48. Let f : {1, 2, 3} {a, b, c} be the bijectio f(1) = a, f(2) = b ad f(3) = c. The iverse ap f 1 : {a, b, c} {1, 2, 3} is the the ap f 1 (a) = 1, f 1 (b) = 2 ad f 1 (c) = 3. We ofte prove that a ap is bijective by costructig a (2-sided) iverse. 21 Exaple 3.49. I clai that the ap f : [0, ) [0, ), x x 4 bijective. is Proof. Let g : [0, ) [0, ) be the ap g(x) = 4 x. For all x [0, ) we have f(g(x)) = f( 4 x) = ( 4 x) 4 = x. So g is a right iverse of f. For all x [0, ) we have g(f(x)) = g(x 4 ) = 4 x 4 = x (sice x 0). So g is a left iverse of f. Thus f is bijective ad g = f 1. Exaple 3.50. Let f : R R be the ap f(x) = 5x ad let g : R R be the ap g(x) = x/5. The g = f 1 : f(g(x)) = f(x/5) = 5 (x/5) = x ad g(f(x)) = g(5x) = (5x)/5 = x for all x R. Lea 3.51. If f : A B is a bijectio ad g : B C is a bijectio, the g f : A C is a bijectio. Proof. We have iverses g 1 : C B ad f 1 : B A. We show that f 1 g 1 is a iverse of g f:

22 (f 1 g 1 ) (g f) = f 1 (g 1 g) f = f 1 Id B f = f 1 f = Id A. Siilarly, (g f) (f 1 g 1 ) = Id C. 4. Soe ore coutig Reark 4.1. Note that a fiite set A has cardiality if ad oly if there is a bijectio fro the set A to the set {1, 2,..., }. This leads to our secod iportat coutig priciple: Two fiite sets have the sae cardiality if ad oly if there is a bijectio betwee the. We will see ay applicatios of this priciple below. Here we use it to cout the uber of subsets (i.e. the cardiality of the power set) of a fiite set A. Lea 4.2. Let A be a fiite set. The P(A) = 2 A. Proof. We will prove this by iductio o := A. If = 1, A has a sigle eleet ad hece P(A) = {, A}. So P(A) = 2 = 2 1. Thus the result is true for = 1. Suppose that the result is kow for sets of cardiality ad that A = + 1. Fix soe eleet p A. Let B = A \ {p}. So B =. Every subset of A either cotais the eleet p or it does t. If a subset does t cotai p the it is actually cotaied i B. Thus the power set of A is the disjoit uio P(B) C where C = {X P(A) p X} (i.e. C is the collectio of subsets of A which cotai the eleet p). It follows that P(A) = P(B) + C. Now we show that there is a bijectio fro C to P(B): Let f : C P(B) be the ap sedig the set X (which cotais p) to X \ {p}. Let g : P(B) C be the ap sedig X B to X {p} C. The for all X C, g(f(x)) = g(x \ {p}) = (X \ {p}) {p} = X. Furtherore, for all Y P(B), f(g(y )) = f(y {p}) = (Y {p})\{p} = Y. Thus g is a 2-sided iverse of f ad hece f is a bijectio.

It follows that C = P(B), ad hece that P(A) = P(B) + P(B) = 2 P(B) = 2 2 = 2 +1 (sice P(B) = 2 by our iductive hypothesis). Notatio 4.3. If A ad B are ay two sets, A B deotes the set whose eleets are precisely the fuctios fro B to A. Exaple 4.4. Let A = {1, 2} ad B = {a, b}. The A B has four eleets; i.e. there are four fuctios fro B to A. We list the: f 1 : B A, f 1 (a) = 1, f 1 (b) = 1 f 2 : B A, f 2 (a) = 1, f 2 (b) = 2 f 3 : B A, f 3 (a) = 2, f 3 (b) = 1 f 4 : B A, f 4 (a) = 2, f 4 (b) = 2 23 Lea 4.5. Let A be ay set. The there is a atural bijectio A A {1,...,}. Proof. First we wish to defie a atural ap, let s call it F, fro A A {1,...,} ; i.e. give a ordered -tuple a = (a 1,..., a ) we wat to associate to if a fuctio, let s call it f a fro {1,..., } to A. There s really oly oe atural way to do this: Let f a (1) = a 1, f a (2) = a 2,... f a () = a ; i.e. we defie f a : {1,..., } A, f a (i) = a i for i = 1, 2,...,. So F : A A {1,...,} is defied by F (a) = f a. Now we will defie a ap G : A {1,...,} A ad show that it is both a left ad a right iverse of F : Give f A {1,...,}, let G(f) := (f(1),..., f()) A. Let a = (a 1,..., a ) A. We ust show that G(F (a)) = a. Now by defiitio of F ad G G(F (a)) = G(f a ) = (f a (1),..., f a (1)) = (a 1,..., a ) = a. Coversely, we ust show that F (G(f)) = f for every f A {1,...,}. Now give f A {1,...,}, G(f) = a = (a 1,..., a ) where a i = f(i). Thus F (G(f)) = F (a) = f a ad for each i, by defiitio f a (i) = a i = f(i) ad hece f a = f ad we re doe. Corollary 4.6. Let A ad B be ay two fiite sets. The A B = A B.

24 Proof. Suppose that B =. The there is a bijectio fro B to {1,..., }. Thus A B = A {1,...,} = A by Lea 4.5 = A by Corollary 2.16 = A B Exaple 4.7. The uber of fuctios fro the set {1, 2, 3, 4} to the set {1, 2, 3, 4, 5} is 5 4 = 625. The followig Lea gives a useful dictioary betwee subsets of a set A ad aps fro A to {0, 1}. Lea 4.8. Let A be ay set. The there is a atural bijectio P(A) {0, 1} A. Proof. Give ay subset X of A we ca associate to it the correspodig idicator fuctio 1 X : Let F : P(A) {0, 1} A be the ap F (X) = 1 X. Coversely, we defie G : {0, 1} A P(A) by G(f) = {x A f(x) = 1}. We leave it as a exercise to verify that G is both a right ad a left iverse of F. Reark 4.9. Note that this gives aother proof that P(A) = 2 A whe A is fiite. Corollary 4.10. Let 1 ad let S = {1,..., }. There is a atural bijectio fro the power set of S to the set B = {0, 1} of biary sequeces of legth. Proof. We have a bijectio P(S) {0, 1} S by Lea 4.8 ad a bijectio {0, 1} S {0, 1} by Lea 4.5. Exercise 4.11. Describe this bijectio explicitly. We have see how to cout the uber of fuctios fro B to A whe A ad B are fiite sets. A ore difficult task is to cout the uber of ijective fuctios fro B to A. Lea 4.12. If A ad B are fiite sets with A = ad B = ad 1, the the uber of ijective aps fro B to A is ( 1) ( + 1).

Proof. If X ad Y are sets, we will let Ij(X, Y ) deote the set of ijective aps fro X to Y. We wish to prove that Ij(B, A) = ( 1) ( + 1). We will prove this by iductio o. If = 1, B has oly oe eleet ad there are exactly aps fro B to A, all ijective. So the result holds for = 1. Suppose the result is kow for, ad B has + 1 eleets. Without loss of geerality (reaig eleets if ecessary), we ca take B = {1,...,, + 1} ad A = {1,..., } (where + 1 of course). Let C = Ij(B, A). We wish to prove that C = ( 1) ( ). For each i, let C i = {f C f( + 1) = i}. The C = C 1 C. Now I Clai that there is a bijectio C i Ij({1,..., }, A\{i}). Naely: If f C i, defie f : {1,..., } A \ {i} by f(j) = f(j) for j. (Note that this akes sese because f is ijective: sice f( + 1) = i it follows that f(j) i whe j.) Coversely, give h Ij({1,..., }, A \ {i}), let h C be the ap defied by h(j) = { h(j), j i, j = + 1. These correspodeces are iverse to each other (check this) ad hece defie a bijectio as claied. It follows fro the Clai that for each i C i = Ij({1,..., }, A \ {i}) = ( 1) ( ) by our iductive hypothesis. Thus C = C 1 + + C = ( 1) ( ) provig the result. Reark 4.13. It is easy to see that uder the bijective correspodece A {1,...,} A, ijective aps correspod to those -tuples (a 1,..., a ) which have the property that a i a j if i j. Thus the lea we have just proved ca be restated as follows: For ay fiite set A with eleets, the uber of ordered -tuples of distict eleets of A is ( 1) ( + 1). Exaple 4.14. The uber of ijective aps fro {1, 2, 3, 4} to {a, b, c, d, e, f, g, h} is 8 7 6 5 = 1680. Equivaletly, the uber of ordered 4-tuples with distict etries take fro the set {a, b, c, d, e, f, g, h} is 1680. 25

26 Let A be a fiite set with eleets. A ijective ap f : A A is ecessarily surjective, sice the iage ust cotai distict eleets. Thus a ijective ap fro A to A is autoatically a bijectio; i.e. a perutatio. Takig B = A (ad = ) i Lea 4.12, we therefore deduce: Corollary 4.15. Let A be a fiite set of cardiality. The uber of perutatios of A is ( 1) 2 1 =!. 5. Bioial Coefficiets Recall that for 1,! = 1 2 ( 1). We also defie 0! = 1. Defiitio ( 5.1. Let 0. The we defie the bioial coefficiet, ) by ( ) :=!! ( )!. Reark 5.2. O the face it the bioial coefficiets are ratioal ubers. We will see below that they are always itegers. Reark 5.3. Note, fro the defiitio, that for all, we have ( ) ( ) =. Exaple 5.4. Exaple 5.5. ( ) 6 = 4 ( ) 4 = 4! 2 2! 2! = 4 3 1 2 = 6 ( ) 6 = 6! 2 2! 4! = 6 5 1 2 = 15 Exaple 5.6. For all 1 ( ) ( )! = = 1 1 1! ( 1)! =! ( 1)! =. Exaple 5.7. For all, ( ) = 0 ( ) =! 0!! = 1. Theore 5.8. For all 1 we have ( ) ( ) ( ) + 1 + = 1

27 Proof. ( ) + 1 ( ) = = = = =! ( 1)! ( + 1)! +!! ( )! [ ]! 1 ( 1)! ( + 1)! + 1 ( )!! + ( + 1) ( 1)! ( + 1)!! ( + 1)! ( + 1)! ( ) ( + 1)! + 1! ( + 1 )! =. The stateet of this theore ca be visualized i Pascal s Triagle: We orgaize the bioial coefficiets i a triagular array i which the -th row cosists of the +1 bioial coefficiets ( ( 0), ( 1),..., ), ad i such a way that the coefficiet ( ) +1 ( i row + 1 lies half-way betwee the coefficiets ( 1) ad ) i the previous row: 1 1 1 1 1 1 2 1 3 3 1 4 6 4 1 1 5 10 10 5 1 The theore the says that i this array ay ter is calculated by addig together the two ters iediately above it (as idicated by the arrows). Corollary 5.9. For all 0, ( ) Z. Proof. If = 0, the ( ) = 1 Z. So it reais to prove the result whe 1. We ll prove this by iductio o 1.

28 Whe = 1, ecessarily = 1 ad ( ) = ( 1 1) = 1 Z. Suppose ow that the result is kow for i.e. that ( ) Z for all ad that 1 + 1. If, the by Theore 5.8 ( ) ( ) ( ) + 1 = + 1 which ( is a iteger by our iductive hypothesis. Otherwise, = + 1 ad +1 ) ( = +1) = 1 Z. The bioial coefficiets cout the uber of -eleet subsets of a set with eleets: Theore 5.10. Let S be a fiite set with S =. For 0 let P (S) := {X P(S) X = } be the set of all subsets of S of cardiality. The P (S) = ( ). Proof. We ll proceed by iductio o 0. If = 0 (ad = 0) or if = 1 (ad = 0 or 1) the result is iediate. Suppose ow that the result is kow for sets of size 1 ad that S = + 1. Let p S be soe fixed eleet of S. Let T = S \ {p}. So T =. Let R = {X P (S) p X}. The P (S) = P (T ) Rad hece However there is a atural bijectio with iverse Thus R = P 1 (T ) ad hece P (S) = P (T ) + R. F : R P 1 (T ), F (X) = X \ {p} G : P 1 (T ) R, G(Y ) = Y {p}. P (S) = P (T ) + P 1 (T ) ( ) ( ) = + by our id. hyp. 1 ( ) + 1 = by Theore 5.8.

Exaple 5.11. I a lottery, six ubers are chose fro the ubers 1, 2,..., 42. I how ay ways ca this be doe? Solutio: The uber of 6-eleet subsets of S = {1,..., 42} is ( ) 42 42 41 40 39 38 37 = = 7 41 13 38 37 = 5245786. 6 1 2 3 4 5 6 29 (Thus the chaces of wiig the lottery with a sigle choice of 6 ubers is 1/5245786.) Reark 5.12. Let B = {0, 1} be the set of biary strigs of legth. So B = 2. Let S be a set of cardiality. For siplicity, we take S = {1,..., }. The we have a bijectio P(S) B by Corollary 4.10. Uder this correspodece, it is easily see that P (S) correspods to the set, call it B,, of all biary strigs of legth with exactly 1s (ad 0s). Thus the theore also tells us that the uber of biary strigs of legth with exactly 1s is ( ) : i.e. ( ) B, =. This iterpretatio of the bioial coefficiets has ay uses, as we will see. Corollary 5.13. For ay 1 ( ) ( ) + + + 0 1 ( ) + + ( ) = 2. Proof. Let S be a set with eleets. The ad hece P(S) = P 0 (S) P 1 (S) P (S) P (S) 2 = P(S) = P 0 (S) + P 1 (S) + P (S) + + P (S) ( ) ( ) ( ) ( ) = + + + + +. 0 1

30 5.1. The Bioial Theore. Let x ad y be ubers or variables. Let s calculate (x + y) 3 : (x + y) 3 = (x + y) (x + y) (x + y) = (x 2 + 2xy + y 2 ) (x + y) = (x 2 + 2xy + y 2 ) x + (x 2 + 2xy + y 2 ) y = (x 3 + 2x 2 y + xy 2 + x 2 y + 2xy 2 + y 3 = x 3 + 3x 2 y + 3xy 2 + y 3. Siilarly (x + y) 4 = (x + y) 3 (x + y) = (x 3 + 3x 2 y + 3xy 2 + y 3 ) x + (x 3 + 3x 2 y + 3xy 2 + y 3 ) y = x 4 + 3x 3 y + 3x 2 y 2 + xy 3 + x 3 y + 3x 2 y 2 + 3xy 3 + y 4 = x 4 + 4x 3 y + 6x 2 y 2 + 4xy 3 + y 4. I both cases, the coefficiets which arise are exactly the bioial coefficiets. This is what always happes: Theore 5.14 (The Bioial Theore). If x, y are ubers, fuctios or variables, ad if 1, we have (x + y) = ( ) x + 0 ( ) x 1 y + + 1 ( ) x y + + ( ) y. Proof. We ll prove this by iductio o 1. Whe = 1 the stateet is x + y = (x + y) 1 = ( ) 1 x + 0 ( ) 1 y 1 which is true.

31 Suppose the result has bee proved for. The (x + y) +1 = (x + y) (x + y) [( ) ( ) ( ] = x + + x y + + )y (x + y) 0 by our id. hyp [( ) ( ) ( ] = x + + x y + + )y x 0 [( ) ( ) ( ] + x + + x y + + )y y 0 ( ) ( ) ( ) ( ) = x +1 + x y + + x +1 y + + xy 0 1 ( ) ( ) ( ) ( ) + x y + + x +1 y + x y +1 + + y +1 0 1 ( ) (( ) ( )) (( ) ( )) = x +1 + + x y + + + x +1 y 0 1 0 1 ( ) + + y +1 ( ) ( ) ( ) + 1 + 1 + 1 = x +1 + + x +1 y + + y +1 0 + 1 as required. Notatio 5.15 (Σ-otatio). This is a useful otatio for expressig log sus such as those occurrig i the bioial theore i a ore succict way. Suppose that F 1,..., F k is a sequece of ubers or fuctios or expressios (aythig that ca sesibly be added), the k =1 F deotes the su F 1 + F 2 + + F k. Thus 5 = 1 + 2 + 3 + 4 + 5 = 15. =1 3 ( 2 + ) = (1 2 + 1) + (2 2 + 2) + (3 2 + 3) = 2 + 6 + 12 = 20. =1 4 2x = 2x + 4x 2 + 6x 3 + 8x 4. =1

32 More geerally, we ca start our su at ay uber: 3 2 = 2 0 + 2 1 + 2 2 + 2 3 = 1 + 2 + 4 + 8 = 15. =0 5 2 x = 3 2 x 3 + 4 2 x 4 + 5 2 x 5 = 9x 3 + 16x 4 + 25x 5. =3 With this otatio, the bioial theore says: For ay 1, ( ) (x + y) = x y. =0 Exaple 5.16. Fid the coefficiet of y 4 i (1 + y) 6. Solutio: Let x = 1 ad = 6 i the Bioial Theore. So 6 ( ) 6 (1 + y) 6 = y. =0 Whe = 4 the coefficiet is ( 6 4) = 15. Exaple 5.17. Fid the coefficiet of x 4 i the expasio of (2 + 3x) 9. Solutio: (2 + 3x) 9 = = 9 ( ) 9 2 9 (3x) 9 ( ) 9 ( 2 9 3 )x. =0 =0 Takig = 4, the coefficiet of x 4 is ( ) 9 2 5 3 4 = 326592. 4 Exaple 5.18. What is the coefficiet of x 23 i the expasio of ( 4x 3 + 3 x 2 ) 11? Solutio: ( 4x 3 + 3 x 2 ) 11 = 11 =0 ( ) 11 (4x 3 ) 11 3 x = 11 2 =0 Now 33 5 = 23 whe = 2. So the coefficiet of x 23 is ( ) 11 4 9 3 2 = 3 2 4 9 5 11. 2 ( ) 11 4 11 3 x 33 5.

We ca use the bioial theore to give a alterative proof of Corollary 5.13 above: Lea 5.19. For ay 1 ( ) ( ) + + + 0 1 ( ) + + ( ) = 2. 33 Proof. Lettig x = y = 1 i the proof of the bioial theore gives ( ) ( ) ( ) ( ) 2 = (1 + 1) 2 = + + + + +. 0 1 Here is aother cosequece: Lea 5.20. For ay 1 ( ) ( ) ( ) ( ) + + ( 1) + + ( 1) = 0. 0 1 Proof. Let x = 1, y = 1 i the bioial theore. 6. Appedix: The atheatical defiitio of Fuctio I Sectio 3 above, we gave a iforal accout of what a fuctio is, good eough for our purposes. But we did ot say precisely what a fuctio is. The word associates has o precise atheatical eaig ad we did t attept to explai it. Our iforal defiitio does ot address questios such as: (1) Is a fuctio itself a kid of set or soe ew kid of atheatical object, ad if so, what kid of object? (2) How ca we deterie whether soethig is or is ot a fuctio? I oder atheatics, we defie the cocept of fuctio as follows: Defiitio 6.1. Let A ad B be sets (possibly equal). A fuctio f fro A to B is a subset of A B with the followig property: For every a A, there is oe ad oly oe b B such that (a, b) f. The set A is called the doai of the fuctio f, ad B is called the codoai or target. We deote this by f : A B. For ay a A the uique b B with the property that (a, b) f is called the value of f at a ad is deoted f(a).

34 Exaple 6.2. For exaple, cosider the subset f := {(1, a), (2, a), (3, b), (4, c)} of {1, 2, 3, 4} {a, b, c, d}. The f is a fuctio fro {1, 2, 3, 4} to {a, b, c, d} sice each of 1, 2, 3 ad 4 occur exactly oce as the first etry (or coordiate) of a eleet of f. We ca equally describe the fuctio f as follows: f : {1, 2, 3, 4} {a, b, c, d}, f(1) = a, f(2) = a, f(3) = b, f(4) = c. Exaple 6.3. The subset g := {(1, a), (1, b), (2, c), (3, d), (4, d)} of {1, 2, 3, 4} {a, b, c, d} is ot a fuctio fro {1, 2, 3, 4} to {a, b, c, d} sice both (1, a) ad (1, b) belog to it.