You are on page 1of 15
jo. Introduction Inmany discrete problems, thatbranch of discrete mathematics concerned with countin; inportant in Mathematics and Computer Science especiall ofagorthms. In this chapter, we will discuss basics of counting and their applications, we are confronted with problem of counting. Combinatorics is ig problems. Techniques for counting are ly in probability theory and in the analysis 10.2, The Fundamental Principles Sum Rule Ifan event can occur in m ways and another event can occur inn ways, and if these two events camot occur simultaneously, then one of the two events can occur in m +n ways. In general, if E.(i= 1, 2, 3 ...k) are k events such that no two of them can occur at the same time, and if E, can «scur in n, ways, then one of the k events can occur in My tnt ny + wnat my Ways. Example 1. If there are 14 boys and 12 girls in a class, find the number of ways of selecting one student as class representative. Solution. Using sum rule, there are 14 + 12 = 26 ways of selecting one student (either a boy agirl) as class representative. Example 2. fa student is getting adniission in 4 different Engineering Colleges and 5 Medical Colleges, find the number of ways of choosing one of the above colleges. Solution. Using sum rule, there are 4 + 5 = 9 ways of choosing one of the colleges. Product Rule fan event can occur in m ways and a sec: nd event in ways, and if the number of ways the “vent occurs, does not depend upon the occurrence of the first event, then the two events can an simultaneously in mn ways, In general if E,(i= 1, 2, «uk are k events and if E, can occur toy'p 8°: Ep can occur n, ways (no matter how E, occurs), E, can occur in ny ways (no matter ‘and E, occurs),....,E, OCCUTS in n, Ways (ilo matter how k-1 events occur), then the & events Simultaneously MX My K My % srsesssnes® My WAYS. he yp thar 2 Three persons enter into car, where there are 5 seats. In how many ways can they (s? fig tion, ate 5m The first person has a choice of 5 seats and can sit in any one of those 5 seats. So Pe tind pene) °F Occupying the first seat. The second person has a choice of 4 seats. Similarly, Pson has a choice of 3 seats. Hence, the required number of ways in which all the three Statis 5x 4x3 = 60, (pil 4 There are four roads from city X to Y and five roads from city ¥to 2, find (ig, MAX? Ways is it possible to travel from city X to ety Z via city ¥. °" different round trip routes are there from eity X to Y to Z to Y and back to X. 373 bh NS 374 ATEXTBOOK OF DISCRETE MATHE May _ ‘ i) In goi ity f the 4 roads may be taken. In go; ion, (i) In going from city X to Y, any o} nig Yo ne i 5 roads may be taken. So by the product rule, there are 5.4 = 2 Tom 0 ways to ton from city X to Z via city Y. (ii) A round trip journey can be performed in the following four ways: 1. From city X toY 2. From city Y to Z 3. From city Z to Y 4, From city Y to X 1. Can be performed in 4 ways, 5 ways to perform 2, 5 ways to perform 3 and 4 ways ip Perform 4. By product rule, there are 4.5.5.4 = 400 round trip routes. Example §. For a set of six true or false questions, find the number of ways Of answering ot questions. Solution, The number of ways of answering the first question is 2. The also be answered in 2 ways and similarly for other 4 questions. Hence the to answering all the questions is 2° = 64, Many counting problems can be solved usin, However, many counting problems can be solved using both of these rules. Example 6. In how many ways can one select two books from different subjects from among 3& distinct computer science books, three distinct mathematics books, and twe distinct chemisty books? second question cay tal number of ways of ig just the sum rule or just the Product rule, Solution, Using product rule one can select (H one from computer science and one CG) one from computer science and one from chemistry in 622 = 12 ways. ( one from mathematics and one from chemistry in 3.2 = 6 ways. Since these sets of selections are pairwi Se disjoint, one can use the sum rule to get the requir number of ways which is 18 + 12+6=36, t two books from different subjects as follows: from mathematics in 6.3 = 18 ways. 10.3, Factorial Notation The product of n consecutive positive integer beginning with 1 is denoted by n! ot |n andis read as factorial n, Thus nt=1.2.3 For example, + (1= In = n(n In 29 p24. 51°1.2.3.4.5= 5.4.3.2. 1=120 41=1.2.3.4=4.3.2 1224 Clearly, MAN. ou (n= 2K0— Dn F238, ae (= 2) 1D) FM-Din=n (ne yi. Thus, m= nln It = nn — yin 2, 5m ~ lin ~ 2)(n ~ 3) ete, It and n are positive integer and r n(n-1)=72 or P-n-72=0 = —9n+8n-~72=0 or (n-9) (n+8) = 0 2 n=9,-8 But n # —8 (n cannot be negative). So n = 9, 1" 1P, = 3: 5, find the value of n. Solution: Here "+ 1p, — @n+)! Example 9. 1f2"+! p_, and2x-1p - n=)! (n+2)! " (=2)! mip tip = nt)! (n=yt 3 ad (421° Qn-pl 5 or N+) 2nx(2n—1)1 23 Qntx2n 3 (n+2)x(n+1)xnXxQn—H1> 5 (n+2)x(n4+Dxn 5 o 4ns2_ 3 . W43ned 5 = 20n + 10 = 39? + 9n+6 or 3? -1In-4 = 0 or (1-4) Gn+1) = 0 anea, tb 1.3 But, ne-b , 3 oonea a Example 10. How many different numbers lying between 100 and 1000 can be form! ated. * Solution: The numbers lying between 100 me ng and 1000 are of 3 digits. They will be fortis taking 3 digits from the given 5 digits. So the requi a 5 of 5 different things taken 3 at a time i.e, P(S, 3) = 5 ired number is equal to the number of peT™ @ i jgINATORICS 377 example 11. Three prizes are to be awarded amo i solution: Since no eee get more than one prize, the required gente of permutations of 10 different things taken 3 ata time ce azired namber is equal to the 10! P(10,3) = Fy = 10x9x8= 720. pestricted Permutations 1, The numbers of Premutations of n different objects ime i ; Tae ag nt occur i Pn, jects taken r at a time in which & particular 2. The number of permutations of n different object taken r at a time in whi 5 The maa presen is POE Fk) PU nr at a time in which particular Example 12. In how many of the permutations of 10 things taken 4 at a time will (a) wo stings always occur (B) never occur ? Solution. (a) Keeping aside the two particular things which will always oceur, the number of Soljons of 10-2 = 8 things taken 2 at a time *P,, Now 2 particular things can take up any _ ero the four places and so can be arranged in “P, ways. Hence the total numbers of permutation is *P, x 4P, = 8 x 7x 4x 3 = 672 (6) Leaving aside the two particular things which will never occur, the number of permutations of 8 things taken 4 at a time = *P,=8 x 7x6 x 5 = 1680. 3, When certain things not occurring together Example 13. Prove that the number of ways in which n books can be arranged on a shelf so that wo particular books are never together is (n— 2) * (n= I}t Solution. Treating the two particular books as one book, there are ("= 1) books which can be | ranged in" 'P,_, = (1'~ 1)! ways. Now, these two books can be arranged amongst themselves in.2! ways, Hence the total number of permutations in which there two books are placed together ist (n-1)!. The number of permutations of n books without any restriction is m!. Therefore, the number of arrangements in which these two books never occur =n! —21. (n—Dl=n.(n—V!-2. (n-D! = (1-2). DE __ Example 14. In how many ways can 7 boys and 5 girls be seated in a row so that no two girls may sit together. _ Solution. Since there is no restriction on boys, first Positions are indicated as - x B, x By x Bs x By * Bs * Bg * By * mae 7 boys can be arranged in 7! ways. Now if 5 girls sit at places int, oe x, then no two of the 5 girls will sit together. Clearly, 5 girls can 2 Pe the required number of ways of seating 7 boys and 5 girls under the given condition Example 15. In ho iy EMPL BS, how many ways 4 boys and 4 girls can be seated in row Solution. Case I. When @ boy sits at the 5 first place: Possible arrangements will be of the ’ aoe Now there are four places BGBGBGBG for fe there are four places for four gj four boys, therefore four bo} .d in 4! ways. Agt Ld together ofall we fix the positions of 7 boys. Their (including the two ends) be seated in 8 places so that boys and ain, 378 Case Il. When a girl sits at the first place: Possible arrangements will be of the form GBGBGBGB Therefore, the number of arrangements in their case is 4! x 4! Hence the required number of ways = 4! x 4! + 4! x 4) = 1152, Example 16. Given 10 people P,, Py Py sun, Py (0 In how many ways can the people be lined up in a row? Gi) How many lineups are there if P Py Py want to stand together? (iii) How many lineups are there if Py P, Py do not want to Stand together? Solution. (i) Without any restriction 10 People can be lined up in a row in 10! (i) Treating P., P,, Pas one, 8 people can be arranged in a row in 8! ways, Again ty Persons Ps, Py, Py can be arranged among themselves in 3!. So, the number of lined up wie Particular 3 persons are together is 8! x 31. (iii) The total number of ways in which P,, P, ‘or Py do not want to si of arrangements without any restriction ~ Toral number of arrangem ways, tand together = Tota] Number lents in Which P. 4. Formation of numbers with digits Example 17. How many number of four digi repetition of digits is not allowed. Solution. The required number of 4-digit numi digits taken 4 at a time = 5, = 5 *4x3x2= 120. Example 18. How many numbers f ‘ing between 100 and 1000 can be formed with the des 1.2.3, 4,5 ifthe repetition of digits is mot allowed. Solution, Every num| ber lying between 100 ‘o find the number of permutations of $ digits 1, its can be formed with the digits 1,2,3,4 ands bers = the number of arrangement ofS diss: and 1000 is a 3~digit number. Therefore, we bat 2, 3,4, 5 taken three at a time, the required number of 3- = 60 Example 23. Find the number of possible ways in which the letters of the word COTTON cat be arranged so that the two Ts don't come together. Solution. There are two T’s, two O’s and the rest two letters are different in the word COTTON. 6! Hence the number of arrangements of the letters without any restriction = ta =180 Considering the two T’s as one letter, the number of letters to be arranged is 5. \ So, the number of arrangements in which both T come together = o=60 Hence, the number of ways in which two T’s do not come together = 180-60 120. Example 24. A coin is tossed 6 times. In how many ways ean we obtain 4 heads ard 2s Solution, Whether we toss a coin 6 times or toss 6 coins at a time, the number of arrange will be the same. 6! ++ The number of arrangements of 4 heads and 2 tails out of 6 is 475)=!5+ ysl Example 25. There are 3 copies each of 4 different books. Find the number of arranging them on a shelf. Solution, Total number of books is 3 x 4 = 12 Each of the 4 different titles has 3 copies each, .. The required number of ways of arranging them on a shelf is 121 12 121121 569600, 31313131 Git Permutation with repetition allowed The number of permutation of n different things taken r at a time, when thit any number of times is n”. et ings moy Pe and when it has been filled up in any one of these ways, the second place can also be filled up in nways for the thing occupying the first place may occupy the second place also. Thus the first two places can be filled inn x n= m ways. When the two places are filled in any of the n? ways, the thd place can also be filled up in n ways, and so the three places together can be filled up in x nai way: Proceeding in this way, we conclude that the r places can be filled in «1 © 11 % sess F times ie. nf Ways. Example 26. How many numbers of 3 digits can be formed with the digits 2, 4, 6 and 8 when adigit may be repeated any number of times? Solution. Since repetition is allowed, each of the 3 places in a 3-digit numbers can be filled upin4 ways by the given 4 digits. hundreds place tens place units place 4 ways 4 ways 4 ways 7) Example 31. Jn how many way’s can seven persons sit around a table so that all shall not have the same neighbours in any two arrangements? Solution. Seven persons can sit at a round table in (7 ~ 1)! = 6! ways. But, in clockwise and sniclockwise arrangements, each person will have the same neighbour. 1 So, the required number of ways = 2 (6!) =360. 405. Combination ‘The different groups or selections that can be made out of a given set of things by taking some crall of them at a time irrespective of the order are called their combinations. The number of combinations of n different things taken r(s n) at a time is denoted by Cin, 7) or "C,. The selection of two letters from three letters a, b, ¢ are ab be ca and thus, the number of combinations of 3 letters taken 2 at a time is C (3, 2)=3 ‘The number of combinations of 4 letters a, 5, c, d taken two at a time is C (4, 2)=6 and they are ab, ac, ad, be, bd, cd. Difference between a Permutation and Combination 1. In a combination only selection is made where in a permutation not only a selection is made but also an arrangement in a definite order is considered. 2. Ina combination, the ordering of the selected objects is immaterial, In a permutation, this ordering is essential. For example, a, b and b, a are same in combination but they are different in permutation. Generally we use the word arrangements for permutations and the word s Combinations. The value of C (1t, r) To find the number of combination of n distinct objects taken r (<7) of a time. vein htt? b the required number of combinations ie, x= C(n7). Now each combination contains tive — things which can be arranged among themselves in r ! ways. Hence x such ‘combinations tise 10x *r ! arrangements giving the number of permutations of 7 different things taken r at lime ie., P (n, r) elections for xx wD) or Ciun = Cort. € (n,n) = Cn, 0) =1 Potting r= nin (0) C (a, n) = « Lf» n(n—n)! oS ATEXTBOOK OF DISCRETE Mati, nt tty Putting r=Oin (1) Cin, = FyGq—O)! 0 Properties of "C, or C(n, r) " nC. = "C,_,(0SrSn) Prop 1. C, = "Carl Pa nt, We have "ror = Goninantyt (Nir! Prop 2. nC +7C,., = IC, OSPSM- ” mot We have "4° 1 = Goin fr DOD! 1 1 = Gani! Gare DIG! 1 1 = a'|————_ +——__. G@=nire-D! Gore aIETA -—— ft, | @=Nie-DiLr nar] _ nt n+l © (= A)ir=D! Lr (n= r +0) _ (ntat rr +)@-n! _ +p! ri(n—r+I)! = "16, oe "C,+°C,_, = "tIC, Prop 3. = "C=>x=y orxty=n We have =, => =", [eG ete > xyor x= n-y x=yor x+y =n, Relation between "C, and "IC, nl se = GED (CES) mn ct) "C, a r\(n=ry ml Gare! my tl n=r4l Example 32. Evaluate the following @C; Gi) "C, Solution. () 6c, = 8X5x4x31 ~ 120 316-3 4 =20 rr OO — RICS sun ' wi WC, = "0, = lor 10x9xg } (0-212) Six2 feG= "Ga gxample 33. 1f SC, = SC, » find the value of 'C, gotation ASAP +2S0r+(r+2)=18 =reg . "Cs = "C= !C,= TATE 256, aample 4. If "C, = 56 and "P, = 336, find m and x solution. Here "P, = 336 ie, —t!_=336 (n-x)! Pr "C, = 36ie, —!_ = xi(n—a)! 5 nt __ =a)! 56 = x@-nl onl 336 = aoe = x! 6 3! 3. . : nt Again "P, = 336 ie, —— = 336 (@a=3)! =1)(1-2)(n-3)! n(n=D(n=2) (2-3)! _ 556 (n-3)! n(n-1) (1-2) = 336=8%7*6 n(n=1) (1-2) = 8x (8-1) * (8-2) x n=8 Example 35. If! Cyq = Cy, + *Cyoyi find x. Solution. Here 10005 = Cuz + *Cooy a 1000.5, = Cyan + *Coo1 C29G="C,) o P+ 1C 9 = PPC oo: + *Co02-1 As ntiC, = °C, 4°C, 1 we get x = 999. Example 36, Jn how many ways can 4 questions be selected from 7 questions? Saint ae 1c, 2 LX8XS 235, lution. The required number of ways = "Cy=7C)= S57" cig’ !*™Ple 37. there are 12 persons in a party and if each two of them shake hands with each ‘how many handshakes happen in the party? - fe galtion. When two persons shake hands, it is counted as one handshake, not two. Therefore, TS number of handsfakes is the same as number of ways of selecting 2 persons from among sons. This can be done 20, = 12x11 _ 65 ways. 2xt Sgt !8™pe 38, how many ways can a committe of $ teachers and 4 students be chosen from \ “8 and 15 students? i oN A TEXTBOOK OF DISCRETE My He 906 7 4 ¢ cho of 15 students in Cg Solutlon. The four students ean he chosen aut of 15 students in "Cand the fine be selected in °C, ways, Now each way of selecting students can be associated with te can be selected in °C, hy Example 39. Out of men and 2 women, a cammitee of 31s ta be Sormed. In hor my 7 can this be done so as to include (i) exactly one woman (il) at least one woman an, Solution () We have o select one woman ut of 2 and 2:men out of 5 ‘The number of ways of selecting 1 woman = 2C, = 2 7 om The number of ways of selecting 2 men = *C, + The committee can be formed in 2 * 10 = 20 ways. (i) The committee can be formed in the following ways (a) 2 men and 1 woman, (6) 1 man and 2 women, For (a) 2 men out of 5 men and 1 woman out of 2 women can be selected in °C 10, amy For (b) 1 man out of 5 men and 2 women out of 2 women can be selected in 1,70, aay, ©. Total number of ways of forming the committee = $C, *?C, +8C, « °C, = 204 Example 40. n how many ways can a student choose a course of 5 subjects available and 2 subjects are compulsory for all the students, Solution, Since two subjects are compulsory, the students are Tequired to choose 3 ost of? Subjects and this can be done in 7C, = 1 = 35 ways, If 9 subjects on Example 41, Treis offive questions each, In how many ways can an examinee ansuver ete questions taking least two questions from each group, Solution. The examinee can answer questions from two Groups in the following ways. (2 fom frst group and 4 from the second group. (ii) 3 from first group and 3 from the second group. (Wii) 4 ftom first group and 2 from the second group, For (i), the number of ways of selecting the questions = $C, x 5Cy=10x5=50 For (if), the number of ways Of selecting the questions = 8C, « 5C, = 10 x 10 = 100 For (ii), he number of ways of Selecting the questions = $C, x SC, = 5 x 10 = $0 Hence the examinee can answer the questions in either of the three ways. Therefore, the Fequired number of ways = 50 + 100 + 50 = 200. Example 42, There are 50 students in each of a the senior or junior classes. Each class 25 male and 25 female students. In how many ways that there are four females ay ed? can an eight student committee be form ind three Junior in the committee? Solution. A committe of & students can be for Senior (50) Junior (50) Male (25) | Female (25) | Mate 25) Female (25) @ 1 4 3 = (ii) 2 3 2 (ili) 3 2 1 2 (”) 4 1 - a . yr ORICS owas gor (Ds the number of ways of selecting 8 students = 3C, « 5C, x 23¢. for(i, the number of ways of setecting 8 students = Bee ed 2 port, the number of ways of selecting 8 students = 8G, «8G, 0 BC, x Be for(i), the eight students ean be selected in 8C, * 28C, 23. 2 1 Fs gince the committee of 8 students is formed in each case, the toil numberof ways of forming mittee go wpe BC. «2 2 BC, x BC, x Cy + ¢, ASC) x BC, x BC, + BC, x BC, x BC, BC. 4B. x BC, x B te 43, Find the number of di Cy + Cy BC, * Cy. Example *+ rer of diagonals that can be drawn by joining the angular points of hexagon. Solution. A hexagon has six angular points and six sides. The join of two angular points is citer side of « diagonal. re number of lines joining the angular points = °C, = & S15 But the number of sides is 6, hence the number of diagonals = 15 — 6=9. combinations taken any number at a time Total number of combinations of m different things taken any number at a time is 2" 1. Each thing may be disposed of in two ways. It may be either accepted or rejected. Corresponding to each {ibe two ways of disposing the first, the second can be disposed of inthe similar two ways So, the tral number of ways of disposing of all the things = 2 2 * .... times = 2". But in this 2* cases, thee is one case in which all the things are rejected. Hence the total number of ways in which one cr more things are taken = 2" — 1. Example 44. You have 4 friends; in how many ways can you invite one or more them for dinner? Solution, You may invite 1, 2, 3 or 4 of your frien -1=63. Example 45. There are 5 questions in a question pap ‘one or more questions. ; Solution, The boy may either solve a questi oe in two ways. Thus the number of ways o! cludes the case in which he has left all the question: ways of solving the paper = 25-1 = 31. ds to dinner. Hence the required number of way ver, In how many was can a boy solve ‘ons of leave it. Thus the boy disposes of each f disposing of all the questions = 28. But this 's unsolved. Hence the required number of Combinations of things not all different ane taking some or all of (p + q + 7 + swe) things, where p are alike of one kind, q are a second kind, r alike of thied kind and so on, the fotal number of possible selection is era HO + DG + DG Dow date poner things we may take 0,1, 2,3, nw» oF p» Hence they can be disposed of in (p + 1) and oom 4 alike things may be disposed of in (q + 1) ways; alike things in (r + 1) ways Any other ‘ee each way of disposing p like things can be associated with each way of disposing G4 yore ie the total number of ways in which all the things can be disposed of is (P * i) required mag, But this includes the ease in Which all the things are left out, Rejecting this, + of combinations is [{(p + 1) (q+ 1) @ + Dw} = \.

You might also like