THE TWELVEFOLD WAY FOLLOWING GIAN-CARLO ROTA How ay ways ca we distribute objects to recipiets? Equivaletly, we wat to euerate equivalece classes of fuctios f : X Y where X = ad Y = The fuctios are subject to three restrictios: f is arbitrary, f is ijective, f is surjective The four differet equivalece relatios o fuctios coe about fro regardig the eleets of X ad Y as distiguishable or idistiguishable Thi of X as a set of balls ad Y as a set of boxes A fuctio f : X Y cosists of placig each ball ito soe box If we ca tell the balls apart, the the eleets of X are distiguishable, otherwise they are idistiguishable Siilarly, if we ca tell the boxes apart, the the eleets of Y are distiguishable, otherwise they are idistiguishable More forally, two fuctios f,g: X Y are equivalet with X idistiguishable if there is a bijectio u: X X such that f ux = gx for all x X Siilarly, f ad g are equivalet with Y idistiguishable if there is a bijectio v: Y Y such that v f x = gx for all x X Fially, f ad g are equivalet with X ad Y idistiguishable if there are bijectios u: X X ad v: Y Y such that v f ux = gx for all x X The twelve etries i the table give the uber of iequivalet fuctios f : X Y eleets of X eleets of Y arbitrary f ijective f surjective f } distict distict! idetical distict } } distict idetical 1 if, j 0 if > 1 if, idetical idetical p j p 0 if > j=0 : For each x X, f x ca be ay of the eleets of Y, so there are fuctios : If X = x 1,x 2,,x }, the f x 1 ca be chose i ways, f x 2 i 1 ways, Hece, there are = 1 1 choices i total! } : If Y = y1,y 2,,y }, the f 1 y j is a oepty subset of X ad these subsets partitio X There are } ways to partitio X ito blocs, ad! ways to liearly order the blocs : The balls are idistiguishable, so we are oly iterested i how ay balls go ito each box If νy j balls go ito box y j, the ν defies a ultiset of size, ad there are such ultisets : The balls are idistiguishable, so we are oly iterested i which boxes get a ball There are ways to choose which boxes get a ball MATH 402 : 2017 page 29 of 34
: Each box y j ust cotai at least oe ball If we reove oe ball fro each box, the we obtai a ultiset of size There are such ultisets j} : Sice the boxes are idistiguishable, a fuctio f : X Y is deteried by the oepty sets f 1 y for all y Y These sets for a partitio of X ad the uber of partitios of X ito at ost blocs i } j [ ]: Each bloc i the partitio correspodig to f ust have oe eleet If, there is oe such partitio If >, the there is o such partitio by the Pigeohole Priciple } : If f is surjective, the oe of the sets f 1 y is epty Hece, the correspodig partitio of X cotais exactly blocs, ad there are } such partitios j=0 p j: If both X ad Y are idistiguishable, the the fuctio is deteried by the uber of eleets i each bloc of the correspodig partitio of X; the actual eleets are irrelevat The oly restrictio o these ubers is that they be positive itegers suig to ad that there ca be o ore that The uber of such iteger partitios is j=0 p j p : If f is surjective, the the correspodig partitio of X has blocs, so their cardialities for a partitio of ito exactly parts SUMMARY Additio forula 1 1 1 = = 1 } } } [ ] [ 1 1 1 = = 1 1 p = p p 1 Suatio forula = 2 Z =0 [ ] Z Algebraic forula x 1 = Z [ ] x = Z = =! p = p Z x x 1 1 x = x N?? = p x Z Z ] 1 [ 1 1 ] } = ϖ } x = x Z MATH 402 : 2017 page 30 of 34
INCLUSION EXCLUSION PRINCIPLE Proble If a school has 100 studets with 50 studets studyig Frech, 40 studets studyig Eglish, ad 20 studets studyig both laguages, the how ay studets are ot studyig either laguage? Solutio The uber of studets ot studyig either laguage is 100 }} uber of studets 50 }} uber i Frech 40 }} uber i Eglish }} 20 = 30 overcout: uber i both 30 20 20 30 60480 20160 60480 221760 Proble Cout the perutatios of [9] with first digit greater tha 2 ad last digit less tha 8? Solutio Let F be the set of perutatios with a 1 or 2 i the first digit ad let L be the set of perutatios with a 8 or 9 i the last digits It follows that F L = 9! F L F L = 9! 28! 28! 227! = 221760 Proble If a school has 100 studets with 50 studets studyig Frech, 40 studets studyig Eglish, 30 studets studyig Chiese, 15 studets are studyig ay give pair of laguages, ad 5 studets are studyig all three, the how ay studets are ot studyig ay of these laguages? 5 10 10 5 25 15 10 20 Solutio The uber of studets ot studyig ay of these laguages is 100 50 40 30 15 15 15 5 = 20 Theore Iclusio Exclusio Priciple For fiite sets A 1,A 2,,A, we have A 1 A 2 A = τ [] = 1 j 1 τ 1 A j A j j τ 1 j< A j A 1 A 1 A 2 A Proof The bioial theore states that x y = Z x y Assuig > 0, x = 1, ad y = 1, we obtai 0 = Z 1 Now, if a eleet x lies i exactly of the sets, the A 1 A 2 A will cout this eleet exactly = 1 ties Siilarly, the eleet x appears i 2 pairs of sets, so 1 i< j Ai A j will cout it 2 ties More geerally, the eleet x appears i j j-tuples of MATH 402 : 2017 page 31 of 34
sets, so τ [] τ = j i τ A i will cout it j ties Overall, the eleet x will be couted 1 2 1 1 = 3 = 1 0 ties Hece, every eleet i A 1 A 2 A is couted exactly oce Rear If A 1 = A 2 = = A = [1], the Iclusio Exclusio gives 1 = 1 j1 Proble Derageets How ay perutatios σ : [] [] have ot fixed poits; that is σ j j for all j []? A perutatio i which o eleet appears i it origial positio is called a derageet Solutio Let D be the uber of derageets of [], so D0 = 1, D1 = 0, D2 = 1, ad D3 = 2 Let A j cosist of all perutatios of [] with σ j = j It follows that A i A j A is the set of perutatios that fix at least the set i, j,}, so Ai A j A = 3! Hece, Iclusio Exclusio iplies that D = =0 1! =! =0 1! Sice e 1 = 0 1 /!, it is clear that!/e is a good approxiatio to D ; oe ca show that D is the earest iteger to!/e Proble Surjectios How ay surjectios fro [] to [] are there? Solutio Let A j cosist of appigs fro [] to [] such that j is ot i the iage It follows that A p A q A r is the set of aps fro [] to [] that iss p,q,r}, so A p A q A r = 3 Hece, Iclusio Exclusio iplies that the uber of surjectios is j=0 1 j j j } Corollary For, N, we have! = j=0 1 j j j Coet o Proof Both sides cout the uber of surjectios fro [] to [] Proble* Euler s totiet fuctio Let ϕ be the uber of itegers i [] that are relatively prie to If p, q, ad r are distict pries, the copute ϕpqr Solutio We cout those positive itegers that are ot relatively prie to pqr Clearly, there are pq itegers i [pqr] that are divisible by r Hece, Iclusio Exclusio gives ϕpqr = pqr pq pr qr p q 1 1 = p 1q 1r 1 More geerally, if = p a 1 1 pa 2 2 pa r r, the oe has ϕp a 1 1 pa 2 2 pa r r = r p j 1 j< r = p j p r 1 1p j MATH 402 : 2017 page 32 of 34
ALTERNATING SIGN IDENTITIES Proble For > 0, we have 1 = 0 Z Solutio We give a bijective proof SET 1: Let E deote the subsets of [] with eve cardiality, so we have E = 0 od 2 SET 2: Let O deote the subsets of [] with odd cardiality, so we have O = 1 od 2 BIJECTION: For X = x 1,x 2,,x } where 1 x 1 < x 2 < < x, cosider the syetric differece of X ad } defied by x 1,x 2,,x,} if X; X } := x 1,x 2,,x 1 } if X I other words, if is ot i X, the X } puts ito X ad if is i X the X } reoves it fro X Hece, the set X } has either oe ore or oe fewer eleet tha X, so it produces aps E O ad O E Moreover, this operatio is ivolutive, that is X } } = X, so we obtai a bijectio Fro the bijectio, we deduce that E = O as required Rear* The syetric differece also ow as the disjuctive uio of two sets is the set of eleets which are i either of the sets ad ot i their itersectio I other words, give two sets X ad Y, the syetric differece is X Y := X \ Y Y \ X Proble For N ad > 0, we have Solutio We give a bijective proof =0 1 = 1 1 SET 1: Let E deote the subsets of [] with eve cardiality at ost, so E = 0 od 2 SET 2: Let O deote the subsets of [] with odd cardiality at ost, so, so O = 0 od 2 BIJECTION: The syetric differece X } is agai useful We cosider two cases: Whe is eve ad X is a eleet of E, the set X } belogs to O provided that X } does ot have ore tha eleets The oly uatched subsets occur i the 1 istaces where X = ad X, because X } cotais 1 eleets Thus, whe is eve, we deduce that E = O 1 Whe is odd ad X is a eleet of E, the set X } is always defied, but we iss those ebers of O that cotai eleets fro [ 1] because such a set ca oly be hit by a 1 eleet subset of [] that cotais Here, we have O = E 1 Cobiig the two cases, we have E O = 1 1 as desired Notatio The Kroecer delta fuctio is defied to be 1 if j =, δ j, := 0 if j I other words, it gives the etries of the idetity atrix I = [δ j, ] MATH 402 : 2017 page 33 of 34
Proble For all, N, we have Solutio We give a bijective proof =0 1 = 1 δ, SET 1: For, 0, let E deote the set of ordered pairs S,T where T S [], T =, ad S is eve For eve ubers, the set E cotais eleets where S = ad therefore cotais 0 od 2 eleets i total SET 2: For, 0, let O deote the set of ordered pairs S,T where T S [], T =, ad S is odd For odd ubers, O cotais eleets where S = ad therefore cotais 1 od 2 eleets i total BIJECTION: We cosider three cases: < : I this case, both E ad O are epty, so the idetity is trivially true = : Whe = is eve, the the set E cotais oe eleet, aely T = S = [] ad O is epty Liewise, whe = is odd, the set E is epty ad O cotais oe eleet Either way, the cardialities of E ad O differ by exactly oe eleet > : For ay pair S,T, let x be the largest eleet of [] that is ot i T; such a x ust exist because > Now if x S we reove it If x S, we put it i I other words, we ap S,T to S x},t Sice S ad S x} have opposite parity, we obtai a bijectio betwee E ad O Cobiig the three cases, we see that E O = 1 δ, Rear* We ca reiterpret this idetity as atrix ultiplicatio Up to appropriate sigs, the atrix of bioial coefficiets is its ow iverse; 0 0 0 0 1 2 0 1 00 0 1 1 1 0 1 01 0 1 1 02 0 2 1 0 0 0 1 2 1 1 I = 2 2 2 0 1 2 2 10 1 0 1 11 1 1 1 12 1 2 1 1 1 1 20 2 0 1 21 2 1 1 22 2 2 1 2 2 0 1 2 1 0 0 1 1 1 1 2 2 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 2 1 0 0 0 1 2 1 0 0 0 = 1 3 3 1 0 0 1 3 3 1 0 0 1 4 6 4 1 0 1 4 6 4 1 0 1 5 10 10 5 1 1 5 10 10 5 1 MATH 402 : 2017 page 34 of 34