Unit -2 Combinatorics Introduction Combinatorics is the mathematics of counting, selecting and arranging objects. Combinatorics includes the theory of permutations and combinations. These topics have an enormous range of applications in pure and applied mathematics and computer science. These are processes by which we organize sets so that we can interpret and apply the data they contain. Generally speaking, combinatorial questions ask whether a subset of a given set can be chosen and arranged in a way that conforms to certain constraints and, if so, in how many ways it can be done. Application of combinatorics plays a major role in the analysis of algorithms. For example, it is often necessary in such analysis to count the average number of times that a particular portion of an algorithm is executed over all possible data sets. This topic also includes solution of difference equations. Differences are required for analysis of algorithmic complexity, and since computers are frequently used in the numerical solution of differential equations via their discretized versions, which are difference equations. It also deals with questions about configurations of sets: families of finite set that overlap according to some prescribed numerical or geometrical conditions. Skill in using combinatorial techniques is needed in almost every discipline where mathematics is applied. Combinatorics is an important part of discrete mathematics. It is vastly applied in the fields of gambling games, computer simulations, and wherever the counting is needed. The Basics of counting Counting problems arise through mathematics and computer science. For example: A password in a computer system consists of five, six or seven characters each of these characters must be a digit or a letter from the English alphabet. Each password must contain at least two digits. How many such passwords are there? To answer this question we need the “study of counting’s”. Principles of counting The sum rule If task 1 (a task) can be done in n1 ways and task 2 (another task) in n2 ways, and if both cannot be done at the same time, then there are n1 + n2 ways to do either task. We can extend this rule to m tasks. If the tasks T1, T2, T3, ......., Tm can be done in n1, n2, n3, ......., nm ways, respectively, and no two of these tasks can be done at the same time. Then the number of ways to do one of these tasks is n1 + n2 + n3 + ....... + nm Example 1: There are 18 mathematics major and 143 computer science major students in a college. How many ways are there to pick one of the students who are either mathematics major or computer science major?

Solution: Using sum rule, it follows that there are 18 + 143 = 161 ways to pick one of the student who is either mathematics major or computer science major. Example 2: There are three list of computer projects containing 21, 5, and 27 possible projects, respectively. The final year student can choose a computer project from one of these three lists. How many possible ways are there to select a project? Solution: The student can choose a project in 21 ways from the first list, 5 ways from the second list, and 27 ways from the third list. Hence, there are 21+5+27 = 53 ways to select a project from one of these three lists. The Product Rule Suppose that a procedure can be broken down into two tasks. If there are n1 ways to do the first task and n2 ways to do the second task after the first task has been done, then there is n1. n2 ways to do the procedure. The product rule can be extended, that is, if a procedure is carried out by performing the tasks T1, T2, ......., Tm. If task Ti can be done in ni ways after tasks T1, T2, ......., Ti-1 have been done, then there are n1 . n2 . ....... nmways to carry out the procedure. Example 1: The first year students of a college are to be given a roll number with a letter and a positive integer not exceeding 60. How many roll numbers are there? Solution: The procedure of making roll number consist of two tasks, namely, assigning one of the 26 English alphabet letters and then assigning one of the integer from 1 to 60. The product rule shows that there are 26 × 60 = 1560 different roll numbers. Example 2: How many different bit strings are there of length nine? Solution: Each of the nine bits can be chosen in two ways, since each bit is either 0 or 1. Therefore, the product rule shows there are a total of 29 = 512 different bit strings of length nine. Example3: A questionnaire contains 4 questions with 2 possible answers and 3 questions with 5 possible answers. How many different ways to answer the questionnaire? Solution: There are 24 × 53 = 2000 different ways to answer the questionnaire Example 4: How many different license plates is available if each plate contains a sequence of three letters followed by four digits (and no sequences of letters are prohibited even if they are absent)? Solution: There are 26 (a,b,c, ......., z) choices for each of the three letters and 10 (0,1,2 ......., 9) choices for the four digits. Hence, they are 26 × 26 × 26 × 10 × 10 × 10 × 10 = 17,576,0000 possible license plates. Example5: How many different license plates is available if each plate contains a sequence of three letters followed by three digits. The first digit is never zero?

Solution: There are 26 choices for each of the three letters and 10 choices for each of the three digits except the first digit of the sequence. Since the first digit of the sequence cannot be zero, so it has only 9 choices Hence, there are 26 × 26 × 26 × 9 × 10 × 10 = 15818400 license plates. Example 6: A bank password consists of two letters of the English alphabet followed by two digits. How many passwords are there? Solution: Total number of passwords is 26 × 26 × 10 × 10 = 6,76,000 Counting Functions One may wonder of counting, after knowing how many functions are there from X into Y?. Since there are |X| elements in the domain and |Y| elements in the co domain. Now, each element in the domain X has |Y| choices. Therefore, by the product rule there are |Y|.|Y|....|Y| = |Y||X| functions from X into Y. Counting one - to - one functions How many one - to - one functions are there from a set with m elements to a set with n elements. First note that if m > n. It is impossible to find a one - to - one function from a set with m elements to a set with n elements. So, let m ≤ n. Suppose that the elements in the domain are a1, a2, a3...... am There are n ways to choose the value of the function at a1. Since the function is oneto-one, the value of a2 can be picked in n – 1 ways. In general, the value of ak of the function can be chosen in n – k+1 ways. By the product rule, there are n(n – 1) (n – 2) ...... (n – m+1) one-to-one functions from a set with m elements to a set with n elements. Example 7: Use the product rule to show that the total number of different subsets of a finite set S is 2|S|. Solution: Let S be a finite set. Now list all the elements of S in arbitrary order. Consider the one - to - one function from subset of S to the string of length |S|. Namely, a subset of S is associated with a bit string, with 1 in the ith position if the ith element in the list is in the subset, and a 0 in this position otherwise. By the product rule, there are 2|S| bit strings of length |S|. Hence, | ρ (S) | = 2|S| Example 8: Each user in a computer system has a password, which is five to eight characters long, where each character is an upper case or a digit. Each password must contain at least one digit. How many possible passwords are there? Solution: Let P be the total number of passwords to the users in the computers, and let P5, P6, P7, and P8 denotes the total number of possible passwords of length 5, 6, 7, and 8 respectively. By the sum rule of counting,

P =

P5 + P6 + P7 +P8

To find P5 Now

P5 =

= = = = Similarly

P6 = = = P7 = = =

Therefore

P8 = = = P =

(the number of strings with all possible combinations of uppercase letters and digits that are five characters long) – (The number of strings with no digits in the five characters) (26 + 10)5 – (26)5 365 – 265 60466176 – 11881376 48584800 366 – 266 2,176,782,336 – 308,915,776 1,867,866,560 367 – 267 78,364,164,096 – 8,031,810,176 70,332,353,920 368 – 268 2,821,109,907,456 – 208,827,064,576 2,621,282,842,880 P5 + P6 + P7 + P8 Permutations and Combinations

Introduction Suppose we have a set of n objects {x1, x2, x3, ..... xn} from which we have to take a sample of r (1 ≤ r ≤ n) objects. In how many ways can this be done? Then we have the following questions: (i) Whether the order of picking the objects is important? and (ii) Whether the same object can be chosen repeatedly? Hence, we use the word “distinct objects” whenever the objects are different, and we use the word “replacement (or) repetition” whenever the objects are chosen repeatedly. We now introduce some terminology. If the order is important, then we say that our sample consists of arrangements. If the order is not important, then we say that our sample consist of selections. Then we get the following notations Permutation - (ordered, no repetition of objects) Sequence - (ordered, repetition of objects) Combination - (Unordered, no repetition of objects) Multiset - (Unordered, repetition of objects)

Permutation Permutation without repetition A “Permutation” on a set of distinct objects is an “ordered arrangement” of these objects. An ordered arrangement of r-distinct elements of a set is called an r-permutation. The number of ways to select an r-permutation from a set of n-distinct element is denoted by P(n, r) or nPr. By using product rule we get the value of P(n, r). Theorem 1: The number of r-permutations of a set with n-distinct elements is n (n – 1) (n – 2) ..... (n – r + 1). i.e., P (n, r) = n (n – 1) (n – 2) .... (n – r + 1) = n!/(n-r) ! Proof: The first element of the permutation can be chosen in n ways, since there are n elements in the set. There are n – 1 ways to choose the second element of the permutation, since there are n – 1 elements left in the set after the element picked for the first position. Similarly, there are n – 2 ways to choose the third element, and so on, until there are exactly n – r + 1 ways to choose the rth element. Therefore by product rule P (n, r) = n (n – 1) (n – 2) ..... (n – r + 1) = n!/(n-r) ! Results: (i) P(n, n) = n! i.e., The number of ways to arrange all n distinct objects in n!. (ii) P(n, r) = 0 if r >n. Permutation with Repetition We may allow repetition in the n objects. An arrangement of repeated objects is said to be a “sequence”. We assume that each of n elements has at least r copies. The number of r - sequence of n objects (repeated) is nr. Theorem 2: The number of “r-sequence” of n objects (with repetition) is nr. Proof: Since each object in a set with n elements have at least r copies, and each element in the “r - sequence” has n choices. Hence the number of “r - sequence” on a set with n objects (with repetition) is n n ..... n (r times) = nr ways. Theorem 3: Let P1 of the objects are alike and of one kind, P2 of them are alike and of the second kind, ....., Pr of them are alike and of the rth kind, where P1 + P2 + ..... Pr = n. Then the total number of permutations of n-objects (repeated) taken all at a time n!/ P1 ! P2 ! ..... Pr! . / Consider the example, a set with {x1, x2, x3, x4} four objects. We take 2 objects from the set, in which the order is important.

No Repetition

with Repetition

x1 x2

x2 x1

x1 x1

x2 x1

x1 x3

x2 x3

x1 x2

x2 x2

x1 x4

x2 x4

x1 x3

x2 x3

x1 x4

x2 x4

x3 x1

x4 x1

x3x2

x4 x2

x3x3

x4 x3

x3x4

x4 x4

x3 x1

x4 x1

x3 x2

x4 x2

x3 x4

x4 x3

2-permutations

2-sequences

The above table illustrates that, the number of 2-sequences in 4 objects is 42 = 16, and the number of 2-permutations in 4 distinct objects is P(4, 2) = 4 × 3 = 12 Permutations in a cycle The number of ways of arranging n distinct objects around a cycle is (n – 1)!. Note: If no distinction is to be made between clockwise and counter clockwise arrangement, then the number of arrangements is equals to (n – 1)!/2. For example: Let A = {a, b, c, d, e, f}. Now the total number of ways to arrange the elements of A in a line is 6!. But consider the six cycle’s bedcaf, edcafb, dcafbe, cafbed, afbedc, fbedca represents the same cycle. ∴ The number of ways to arrange in a cycle = = 6!/6=(6 – 1)!

If the direction of the arrangement is not important. Then the number of arrangements are (n – 1)!/2. . That is acdebf and fbedca are considered as the same cycle, whenever the direction is not important (see figure 3.1). Remark: The counting of functions is a sequence and counting of one-to-one functions is a permutation. WORKED EXAMPLES 2.1 Example 1: How many “words” of three distinct letters can be formed from the letters of the word “MASTER”? Solution: Here n = 6 ∴ Total number of three letter words from 6 letters (no repetition) = The number of 3 permutations in 6 objects P(6, 3) = 6 × 5 × 4 = 120 words Example 2: How many three-letter “words” can be formed from letters in the set {a, b, y, z}. (i) if repetition of letters are allowed? (ii) if repetition not allowed?. Solution: (i) Here n = 4 and r = 3 ∴ The total number of words of length three from the 4 letters with repetition = 43 = 64 words. (ii) The total number of words of length 3 from 4 distinct letters = P (4, 3) = 4×3×2 = 24 Example 3: How many permutations are there on the set A = {1, 2, 3, 4, 5}?. Solution: We have P(n, n) = n! ∴ Here n = 5 ∴ Total number of permutations on A = 5! = 5×4×3× 2×1 = 120 Example 4: How many permutations are there in the set? A = {a, b, c, d, e, f, g} taken 2 at a time. Solution: Here n = 7, and r = 2 ∴ P (7, 2) = 7 × 6 = 42 (Remark: if repetition allowed then the number of 2-sequences = 72 = 49) Example 5: A coin is tossed four times and the result of each toss is recorded. How many different sequences of heads and tails are possible? Solution: If a coin is tossed, then there are 2 possible outcomes.

∴ Total number of sequences of heads and tails when a coin is tossed 4 times = 2×2×2×2 = 24 = 16

Example 6: How many different permutations of the letters in the word BANANA are there? Solution: Here A repeated 3 times, N repeated 2 times and B has occurred once. Here n = 6, P1 = 3, P2 = 2, P3 = 1. ∴ P(n, r)

= n!/ P1! P2 !P3! = =

6! 3! × 2! 1! =6 ×5 ×4 ×3 ×2× 13 ×2 ×1 ×2 ×1× 1 5 × 4 × 3 = 60

Example 7: In how many ways can 9 people be seated in a circle? Solution: Total number ways = (n – 1)! = 8! = 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320 Example 8: Suppose repetitions are not allowed (i) How many 3 digit numbers can be formed from the six-digits 2, 3, 5, 6, 7, and 9. (ii) How many of those three digit numbers are less than 400? (iii) How many are even? Solution: (i) Here n = 6 ∴ Total number of 3-permutation on six digits (no repetition) is = P (6, 3) = 6 × 5 × 4 = 120 (ii) The first digit of the number can have 2 possible (2 or 3) (since 5, 6, 7, 9 are not possible) The second digit can have 5 possibilities and the third digit can have 4 possibilities. ∴ Total numbers, which is less than 400 = 2 × 5 × 4 = 40 (iii) Last digit of that is even number in 2, 3, 5, 6, 7, and 9 can have 2 possibilities (i.e, 2 or 6). ∴ Total number of even numbers = 5 × 4 × 2 = 40 Remark: Since the last letter was fixed, therefore the first digit can have only 5 possibilities and second digit can have only 4 possibilities. Example 9: Find the number of ways that in a party of 7 persons can arrange themselves (a) in a row of seven chairs, (b) around a circle. Solution: (a) Here n = 7, Now P(n, n) = n! = 7! = 5,040 (b) Number of ways in a circle = (7 – 1)! = 6! = 720 Example 10: In how many ways can 4 mathematics books, 3 history books, 3 chemistry books, and 2 sociology books be arranged on a shelf so that all books of the same subjects are together.

Solution: Since there are 4 categories of books implies there are 4! ways to arrange the books on the self according to the subjects. For each subjects they have their own arrangement. For example: 4 different mathematics books can be arranged in 4! ways. ∴ The total number of ways= 4! × 4! × 3! × 3! × 2! = 41,472

Example 11: How many different rearrangements are there of the word REARRANGEMENT? Solution: Here n = 13 Let P1 = number of R = 3 P5 = number of G = 1 P2 = number of E = 3 P6 = number of M= 1 P3 = number of A = 2 P7 = number of T = 1 P4 = number of N = 2 ∴ Total number of rearrangements =

13!/ 2 !2 !2 !1 !1! 1!= 43, 243, 200

Example 12: How many different words are there in the word MATHEMATICS? Solution: Number of different words = 11! /2! 2! 2 1 = 49, 89, 600 Example 13: How many different eight-letter words can be made with five A’s, two B’s, and one C? Solution: Total number of letters = 8 Total number of eight-letter words= 8! 5! 2! 1! = 168 Combinations In combinations, the order of selecting an object is not important, so we have two cases that the objects may be distinct or repeated. Combination without repetition Definition: A ‘combination’ is an unordered collection of distinct objects. An unordered collection of r-objects from a set with n distinct objects is called “rcombinations (or) r-subsets”. The number of r-combinations of n distinct objects is denoted by nCr (or) C (n, r) ⎛n⎞ or ⎜⎜ ⎟⎟ . ⎝r ⎠ Theorem 4: Let A =

{a1, a2, ......, an}

be a set with n-distinct objects. Then the number of r-combinations of A is C (n, r) =n!/ r! (n-r)!= n(n-1)(n-2)….(n-r+1) /1× 2× 3× 4 ×... × r Proof: The r-permutations of the set can be obtained by forming the C(n, r) - rcombinations of the set A and then ordering the elements in each r-combination, which can be done in P (r, r) ways, consequently

P(n, r) = C (n, r) . P (r, r) C (n, r) = P(n,r)/P(r,r) =n! /(n-r)! × (r-r)! /r! = n! /(n-r)! = n(n-1)....(n-r+1) /1 ×2 × 3 × …×r Remark: Note that C (n, 0) = 1 and C (n, n) = 1 Theorem 5: For integers n, r such that 0 ≤ r ≤ n C (n, r) = C (n, n – r)∴ Proof: Consider the set of n objects from which the combinations are to be chosen as a universal set. Then for each combination of r elements there corresponds exactly one complement combination of n – r elements. There is a one-one correspondence between the r combinations and their complements. i.e.,r - combinations: C (n, 0), C (n, 1), C (n, 2), ..... , C (n, n) n – r - combinations: C (n, n – 0), C (n, n – 1), C (n, n – 2), ..... , C (n, n – n) Now, C (n, r) counts all the r-combinations and C (n, n – r) counts all the (n – r) combinations. Theorem 6: For all integers, n ≥ 0, C (n, 0) + C (n, 1) + ...... + C (n, n) = 2n n

i.e.,

∑ C(n, k ) =2n k =0

Proof: Let A = {a1, a2, ......, an} The number of k-combinations of A is C (n, k). Now count the number of 0combinations, 1-combinations, 2-combinations, and so on up to n - combinations, which is the total number of all possible combination of all possible sizes. We count the combinations in A with n - digit binary strings, by the correspondence that ‘xk is the combination if the kth digit of the binary string is 1, and xk is not a combination if the kth digit of the binary string is 0. There are two (0 or 1) choices for each binary digit, it gives 2n binary strings and thus we get 2n combinations. Therefore

n

∑ C(n, k ) =2n . k =0

Theorem 7: (Pascal’s Identity) For all integers n, r such that 0 ≤ r ≤ n C (n, r) = C (n – 1, r) + C (n – 1, r – 1) Proof: Let U = {a1, a2, a3, ......, an} be a set in which ‘as’ is a special element. The number of all r-combinations is C (n, r). Now, all the r-combinations may be partitioned into two classes A and B. Where A be the set of all r-combinations that contains as and B be the set of all rcombinations that do not contain as. The number of ways to select an r-combination from A is the number of ways to select r – 1 element from U – {aS}, that is C (n – 1, r – 1).

The number of ways to select an r-combinations from B is the number of ways to select r elements from U – {as}, that is C (n – 1, r). C (n, r) =

C (n – 1, r) + C (n – 1, r – 1).

Theorem 8: (Vandermonde’s Identity) Let m, n and r be non-negative integers with r not exceeding either m or n. ( 0 ≤ r ≤ m, n) Then

r



C (m + n, r) =

C (m, r − k ) C (n, k)

k =0

Proof: Let there are m items in one set and n items in another set. Then the total number of ways to select r-elements from the union of these sets is C (m + n, r). Another way to select r elements from the union is to select k elements from the first set and then r – k elements from the second set, where k is an integer with 0 ≤ k ≤ r. Therefore there are C (m, k) ways to select k elements from the first set, and C (n, r – k) ways to select r – k elements from the second set. By product rule, this can be done in C (m, k) C (n, r – k) ways. By taking all possible k and by sum rule, the total number of ways to select r elements from the union of sets with m + n elements =

r

∑ C(m, k ) C (n, r – k). k =0

r

i.e.,

C (m + n, r)

=

∑ C(m, k ) C (n, k). k =0

Combinations with repetition Suppose that r objects to be selected from n items with repetitions. Assume that at least r copies of each of the n items are there in the set. A selection of r objects from a set of n items with repetition is said to be ‘r - multiset’. Consider the example: Let {a, b, c} be any set, we collect 2-multisets from it. The possible 2-multisets are {a, a}, {a, b}, {a, c}, {b, b}, {b, c}, {c, c} Let us solve this problem as follows: Consider the three boxes labeled a, b, c. We have to choose two letters, but we can choose two letters from the same box (or) from the different boxes. Model the choice by placing two balls in the boxes. For example, two balls in the box c would generate {c, c}. A ball in a and ball in b would generate {a, b}. Now, let X represents a ball in the boxes, and W denotes a wall between the boxes. The selection {a, a} may be read as a ‘word’ XXWW, and the selection of {b, c} read as a ‘word’ WXWX. Now finding the number of selection of multisets is equivalent to finding the number of ‘words’ formed by X’s and W’s. Theorem 9: The number of r-multisets from a set of n objects (each object is repeated

at least r times) is C (n – 1 + r, r). Proof: Let {a1, a2, ........, an} be any set with n objects, and each ai - have at least r copies. Introduce n boxes labeled as a1, a2, ......, an Let X represents an object in a box, and W represents a wall between the boxes. (So that we have n – 1 wall) The choice of an r-multisets is equivalent to placing r X’s into n boxes, which is equivalent to arranging r X’s and (n – 1) W’s as a ‘word’. The word is determined precisely by the choice of the positions for the r X’s, and that choice can be made in C (n – 1 + r, r) ways. Consider the example, Let A = {a, b, c, d} be any set, we take 2-objects from A. No repetition

With repetition

{a, b} {a, c} {a, d}

{a, a} {a, b} {a, c} {a, d}

{b, c} {b, d}

{b, b} {b, c} {b, d}

{c, d}

{c, c} {c, d} {d, d} 2-multisets

2- Combinations

WORKED EXAMPLES 2.2 Example 1: In how many ways can a committee consisting of three men and two women be formed from seven men and five women? Solution: The three men can be selected from the seven men in C (7, 3) ways, and the two women can be selected from the five women in C (5, 2) ways. Therefore the committee consisting of three men and two women can be chosen in C (7, 3) × C (5, 2) = 7 ×6 ×5/1×2×3 × 5×4/1×2 =

350 ways

Example 2: Compute the number of distinct 13-card hands that can be dealt from a deck of 52 cards. Solution: The number of 13-card hands = C(52, 13) = 52!/13!39! Example 3: A box contains six white balls and five red balls. Find the number of ways

four balls can be drawn from the box if (a) they can be any color; (b) two must be white and two red. (c) they must all be of the same color. Solution: (a) The four balls (of any color) can be chosen from the eleven balls in C (11, 4) = 11×10×9×8/1×2×3×4 = 330 ways (b) The two white balls can be chosen in C (6, 2) ways and the two red balls can be chosen in C (5, 2) ways. ∴ The total number of ways to select 2 white balls and 2 red balls is = C (6, 2) × C (5, 2) = 6 ×5/1×2 × 5×4/1×2 = 150 ways (c) There are C (6, 4) = 15 ways to select 4 white balls from 6 white balls, and C (5, 4) = 5 ways to select 4 red balls from 5 red balls. ∴ The total number of ways to select 4 balls which are same color = 15 + 5 = 20 ways Example 4: How many teams of six with a captain can be selected from 12 persons? Solution: The team captain can be selected in 12 ways, and the remaining five team members can be selected from 11 persons. ∴ The number of ways of selecting 5 team members in 11 persons is = C (11, 5) =11 ×10× 9× 8× 7 / 1× 2× 3 ×4× 5 = 462 ways ∴ The total number of ways to select a team of six members with a captain is = 12 × 462 = 5,544 teams Example 5: Find the number of solutions of the equation a + b + c = 10, where a, b, c are non-negative integers Solution: We solve this problem by generating three boxes labeled a, b and c.

Now we place all 10 balls into the 3 boxes. Let us represent all the 10 balls by the letter B and the two partitions (walls) by the letter W. Then each word is made from the 12 symbols represents a solution of the equation. The number of solutions = The number of words from 12 symbols = C (3 + 10 – 1, 10) = C (12, 10) = C (12, 2) = 12!/10!2! = 12×11/1×2 = 11 × 6 = 66 Remark: BBBBBWBBBBWB represents the solution x = 5, y = 4, z = 1. Example 6: How many solutions are there for the equation?

x + y + z = 15, where x, y, z ≥ 0 and integers. Solution: The solution of the equation is same as to select 15 balls from the three boxes labeled x, y, z with repetition (unlimited). The number of ways of selection = C (3 + 15 – 1, 15) = C (17, 15) = C (17, 2) =17×16/1×2 = 136 136 non negative integer solutions are there for x + y + z = 15. Example 7: How many integer solution are there x + y + z = 20, subjects to the constraints x ≥ – 1, y ≥ 0, z ≥ 4. Solution: Let u = x + 1, v = y, w = z – 4 Then we get the equation as (u – 1) + v + (w + 4) = 20 i.e., u + v + w = 17, with constrains u ≥ 0, v ≥ 0, w ≥ 0. ∴ The number of solutions is C (17 + number of unknowns – 1, 17) = C (17 + 3 – 1, 17) = C (19, 17) = C (19, 2) = 19 ×18/1×2= 171. Remark: The number of r-combinations of n distinct objects with unlimited repetitions = the number of non negative integral solutions to (x1 + x2 + ...... + xn = r) =

the number of ways of distributing r balls into n numbered boxes with n – 1 walls = C (n – 1 + r, r) = C (n – 1 + r, n – 1) (Since C (n, r) = C (n, n – r) = (n+r-1)!/r!(n-1)! Example 8: How many numbers from 1 to 10,000 have digit sum of 7? Solution: This problem is equivalent to placing seven balls into four boxes.

Let balls are represented by B and the walls between boxes are represented by the letter S. Each “word” from the ten symbols represents a solution to the problem. (here, word length = digit sum + no. of walls = 7 + 3 = 10) ∴ The total number of words =10!/7!3! = 120 words ∴ There are 120 numbers from 1 to 10,000 has a digit sum of 7.

Pascal’s Triangle The Pascal’s triangle is defined as follows: ⎛ 0⎞ ⎜⎜ ⎟⎟ ⎝ 0⎠ ⎛ 1 ⎞ ⎛1⎞ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎝ 0 ⎠ ⎝1⎠ ⎛ 2⎞ ⎜⎜ ⎟⎟ ⎝0⎠ ⎛ 3⎞ ⎜⎜ ⎟⎟ ⎝ 0⎠ ⎛ 4⎞ ⎜⎜ ⎟⎟ ⎝0⎠ ⎛ 5⎞ ⎛ 5⎞ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎝ 0⎠ ⎝1⎠ ⎛ 6⎞ ⎜⎜ ⎟⎟ ⎝ 0⎠ . . . .

⎛ 6⎞ ⎜⎜ ⎟⎟ ⎝1⎠ . .

⎛ 2⎞ ⎛ 2⎞ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎝1⎠ ⎝ 2⎠ ⎛ 3⎞ ⎛ 3 ⎞ ⎛ 3⎞ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎝ 1⎠ ⎝ 2 ⎠ ⎝ 3⎠

⎛ 4⎞ ⎜⎜ ⎟⎟ ⎝1⎠ ⎛5⎞ ⎜⎜ ⎟⎟ ⎝ 2⎠

⎛6⎞ ⎜⎜ ⎟⎟ ⎝ 2⎠ . . . .

⎛ 4⎞ ⎜⎜ ⎟⎟ ⎝ 2⎠ ⎛ 5⎞ ⎜⎜ ⎟⎟ ⎝ 3⎠

⎛ 6⎞ ⎜⎜ ⎟⎟ ⎝ 3⎠ . . . .

⎛ 4⎞ ⎜⎜ ⎟⎟ ⎝ 3⎠ ⎛5⎞ ⎜⎜ ⎟⎟ ⎝ 4⎠

⎛6⎞ ⎜⎜ ⎟⎟ ⎝ 4⎠ . . . .

⎛ 4⎞ ⎜⎜ ⎟⎟ ⎝ 4⎠ ⎛ 5⎞ ⎜⎜ ⎟⎟ ⎝ 5⎠

⎛ 6⎞ ⎜⎜ ⎟⎟ ⎝ 5⎠ . . . .

⎛ 6⎞ ⎜⎜ ⎟⎟ ⎝ 6⎠ . . . .

1 1 1 1 1 1

2 3

4 5

1 1 3 6

10

1 4

10

1 5

1

1 6 15 20 15 6 1 . . . . . . . . . . . . . . . . . . . . . . . . . .

0th Row 1st Row .... .... .... .... 6th Row

Pascal Triangle The coefficients of the expansion of (a + b)r, are the elements from the rth row, in the Pascal triangle. The expansion of (a + b)r is said to be Binomial expansion, which we will study in the following section. Binomial and Multinomial Theorems In the expansion of (a + b)n, the coefficients of the power of a and b are called

binomial coefficients. The binomial coefficients are the r-combinations from the set of n elements. i.e., (a + b)n = C (n, 0) an b0 + C (n, 1) an–1 b + ........ + C (n, r) an–r br + ..... + C (n, n) a0 bn i.e.,

n

∑ C (n, r ) an–r br

(a + b)n =

r =0

The above expansion is called “the Binomial theorem”. Result: Let b = – b in the above theorem. n



We get (a – b)n =

(–1)r C (n, r) an–r br

r =0

n

Theorem 10: Let n be a positive integer. Then ∑ (–1)rC (n, r) = 0 r=o

Proof: From the Binomial theorem, n

∑ C (n, r) 1n–r (–1)r

0 = (1 + (–1))n =

r=o

n

0 =

∑ (–1)r C (n, r) r=o

The multinomial theorem Theorem 11: For any positive integer n: (x1 + x2 + ....... + xm)n is the sum of all terms of the form n!/r1!r2!…rm! x1r1 x2r2 ..... xmrm for all non-negative integer solutions of r1 + r2 + ........ + rm = n. WORKED EXAMPLES 2.3 Example 1: Find the expansion of (x + y)5. Solution: By the Binomial theorem (x + y)5 = C (5, 0) x5 + C (5, 1) x4 y + C (5, 2) x3y2 + =

C (5, 3) x2y3 + C (5, 4) xy4 + C (5, 5) y5 x5 + 5x4y + 10 x3y2 + 10x2y3 + 5xy4 + y5

Example 2: What is the coefficient of x10y15 in the expansion of (x + y)25? Solution: From the Binomial theorem, (x + y)25 =

25



C (25, r) x25–r yr

r =o

The coefficient of x10 y15 is C (25, 15) = 25!/15!10!

Example 3: Expand (x + y + z)3 by using the multinomial theorem. Solution:(x + y + z)3 = 3!/3!0!0!x3 +3!/0!3!0! y3 + 3!/0!0!3! z3 + + 3!/2!1!0!x2y +3!/2!0!1!x2z +3!/0!2!1! y2z + 3/0!1!2! yz2 +3!/1!0!2!xz2 +3!/1!2!0! xy2 =

+ 3!/1!1!1!xyz x3 + y3 + z3 + 3x2y + 3x2z + 3y2z + 3yz2 + 3xz2 + 3xy2 + 6xyz

Example 4: What is the coefficient of x10y15 in the expansion of (3x – 2y)25? Solution: From the Binomial theorem, (3x – 2y)25 =

25



C (25, r) (3x)25–r (–2y)r

r =o

The coefficient of x10y15 is C (25, 15) (3)10 (–2)15 = – 25!/15!10! 310215 Example 5: What is the coefficient of x5y4z3 in (x – 2y + 3z + w)12? Solution: By multinomial theorem, the coefficient of x5 y4 z3 in (x – 2y + 3z + w)12 is 12!/5!4!3!0!(1)5 (–2)4 (3)3 (1)0 = 12!/5!4!3!× 24 ×33 = 1×2×3×4×5×6×7×8×9×10×11×12/1×2×3×4×5×1×2×3×4×1×2×3× 16 × 27 = 7 × 4 × 9 × 10 × 11 × 16 × 27 = 1,19,75,040 EXERCISE 2.1 Part - A 1. Define permutation. 2. Define combination. 3. The number of r-permutations of a set of (i) n distinct elements is .......... (ii) n repeated elements (each of atleast r copies) is .......... 4. What is P (n, n)? 5. If P (n, r) = 0, then the value of r is……….. 6. What is the number of ways of arranging n distinct objects in a cycle? 7. How many ‘words’ of three different letters can be formed from the letters of the word “COMPUTER”. 8. How many distinct words can be formed from letters of the word “MATHEMATICS”. 9. How many permutations are there of A = {a, e, i, o, u} taken 2 at a time?.

10. A coin is tossed six times and the result of each toss is recorded. How many different sequences of heads and tails are possible? 11. If 10Cx = 10C4 and x ≠ 4, then x is ......... n

12. Find ∑ C (n, r) . r=o

13. Compute the number of distinct 13-card hands that can dealt from a deck of 52 cards? 14. How many different classes of 25 students with a class leader can be selected from 55 new students in a school? n

15. What is the value of . ∑ (–1)rC (n, r)? r=o

16. Show that P(n, n) = 2P (n, n – 2) 17. State Binomial theorem. 18. State Multinomial theorem. 19. Expand (x + y)4. 20. Expand (2x – 3y)4. 21. Find the coefficient of x10y15 in the expansion of (2x – 3y)25. 22. Expand (x + y + z)2. 23. Find the coefficient of x3y2z in the expansion of (2x – 3y + 4z)6. 24. Find the coefficient of x10 in the expansion of (1 + x5 + x10 + ......)3. 25. Find the coefficient of x7 in the expansion of (1 + x + x2 + x3 + .....)2. 26. A school requires one student representative from Tenth or Twelth. If there are 60 tenth students and 45 twelth students, then how many different representatives are there? Part - B 27. Each user in a computer system has a password; each character is an upper case or a digit. Each password must contain at least two digits. How many different passwords are there? 28. In how many ways can the letters of the word ‘MONDAY’ be arranged? How many of them begin with ‘A’ and end with ‘O’? How many of them do not begin with ‘A’ but end with ‘O’? 29. In how many ways can the letters of the word “WEDNESDAY” be rearranged? 30. How many rearrangements can be made of the following words? (i) REARRANGEMENT (ii) PROGRAMMING (iii) GREAT (iv) ENGINEERING (v) COLLEGE

31. How many different numbers of six digits (without repetition) can be formed from the digits 0, 1, 3, 5, 7, 9?. (i) How many of them will have 1 in the unit place? (ii) How many of them is divisible by 3? (iii) How many of them is divisible by 2? (iv) How many of them is not divisible by 2? 32. There are 12 students in an athlete. The only results that matter are the first three finishers. How many possibilities are there? 33. How many positive integer less than 1000 are (i) divisible by 2? (ii) not divisible by 2? (iii) divisible by both 3 and 7? (iv) divisible by either 3 or 7? (v) divisible by neither 7 nor 11. 34. How many license plates can be made using either three digits followed by three letters or three letter followed by the three digits?. 35. There are 8 boys and 6 girls sit in a round table for group discussion. In how many ways they can seat themselves so that no two girls are together?. 36. In how many ways can a photographer at a photo section in a college to arrange 12 students and 2 staffs in a row (i) the two staffs must be together (ii) one of the staff is not next to the other staff 37. How many functions are there from {1, 2, ......, n}, where n is a positive integer, to the set {0, 1}. How many of them are one-to-one? 38. How many strings of six English letters are there? (i) If letters are not repeated? (ii) If letters are repeated? (iii) start and end with P? 39. How many solutions does the equation x + y + z + u = 29 have, where x, y, z, and u are non negative integers?. 40. How many solutions does the equation x1 + x2 + x3 + x4 = 20 have, when x1 ≥ – 2, x2 ≥ 0, x3 ≥ 4, x4 ≥ 2?. 41. Find the coefficient of x12 in the expansion of (x + x2 + x3 + x4 + .....) (1 + x + x2 + .....)3. 42. Find the coefficient of x3y2z4 in the expansion of (2x – 3y + z – w)9. The Pigeon Hole Principle Theorem 12: If n pigeons are assigned to m pigeonholes, and m P n, then at least one pigeonhole contains two or more pigeons.

Proof: Let us label the m pigeonholes with the numbers 1, 2, ..... m, and the n pigeons with the numbers 1, 2, ....., n. Now assign each pigeon to the pigeonhole with the same number, starting from pigeon 1. Since m < n, there are n – m pigeons that have not yet been assigned to a pigeonhole. Therefore, at least one pigeonhole will have two or more pigeons. The Extended Pigeonhole principle Theorem 13: If n pigeons are assigned to m pigeonholes, then one of the pigeonhole ⎢ ( n − 1) ⎥ must contain at least ⎢ + 1 pigeons. ⎣ m ⎥⎦ ⎢ ( n − 1) ⎥ Proof: If each pigeonhole contains no more than ⎢ pigeons, then there are at ⎣ m ⎥⎦ ⎢ ( n − 1) ⎥ most m . ⎢ ≤ m . (n-1)/m = n – 1. ⎣ m ⎥⎦ Pigeons are in all the holes. This contradicts our assumptions, so one of the ⎢ ( n − 1) ⎥ pigeonholes must contain at least ⎢ + 1 pigeons. ⎣ m ⎥⎦

Note that. ⎣5.3⎦ = 5, ⎣3.9⎦ = 3 and ⎣− 2.7⎦ = –3 WORKED EXAMPLES 2.4 Example 1: Show that if any eleven numbers from 1 to 20 are chosen, then two of them will add up to 21. Solution: Construct the following sets with two numbers that add up to 21. A1 = {1, 20}, A2 = {2, 19}, A3 = {3, 18}, A4 = {4, 17}, A5 = {5, 19}, A6 = {6, 15}, A7 = {7, 14}, A8 = {8, 13}, A9 = {9, 12}, A10 = {10, 11}. By pigeon hole principle, now for selecting 11 numbers from the above 10 sets, we must have to select all two elements from at least one set, which will give the sum as 21. Example 2: If 13 people are assembled in a room, show that at least 2 of them must have their birthday in the same month. Solution: Since we have 12 months and if 13 people are there in a room, then at least 2 of them must have their birthday in the same month by pigeonhole principle, Since if 12 people are born in different 12 months of the year, then the 13th person must born on any one of the 12 months. Example 3: Assume there are three men and five women at a party. Show that if these people are lined up in a row, at least two women will be next to each other. Solution: Consider the case where the men are placed so that no two men are next to each other and not at either end of the line. In this case, the three men generate four potential locations (pigenholes) (similar to that of boxes and walls) in which to place women (at either end of the line or two locations between men with in the line).

Since there are five women (pigeons) and 4 places (pigeonholes), therefore by the pigeonhole principle, at least one place will receive 2 women. At least two women will have to be placed next to each other. Example 4: Find the minimum number of students needs to guarantee that five of them belong to the same subject, having the majors as physics, chemistry, mathematics, and history. Solution: Here n = 4 subjects are (pigeon holes) there, and let k be the number of students (pigeons) in each subject (hole). Now k + 1 = 5 so k = 4. ∴ The total number of students = kn + 1 =4 × 4 + 1 = 17 Example 5: Show that if 30 dictionaries in a library contain a total of 61,327 pages, then one of the dictionaries must have at least 2045 pages. Solution: Let the pages be the pigeons and the dictionaries are the pigeonholes. Assign each page to the dictionary in which it appears. Then by extended pigeonhole principle one dictionary must contain at least ⎢ 61, 236 ⎥ ⎢⎣ 30 ⎥⎦ + 1 = 2045 pages

Example 6: Show that if seven colors are used to paint 50 bicycles, at least 8 bicycles will be the same color. Solution: Here n = 50, and m = 7. ⎢ 50 − 1 ⎥ By extended pigeonhole principle, ⎢ + 1 = 8, therefore at least 8 bicycles will ⎣ 7 ⎥⎦ have the same color. Example 7: Among 100 people, show that at least 9 of them were born in the same month? Solution: Here n = 100, and m = 12 months. ⎢ 100 − 1 ⎥ + 1 = 9 were born in the same month. Then ⎢ ⎣ 12 ⎥⎦

Inclusion and Exclusion Introduction In a college, if there are 100 NCC students and 75 NSS students. How many students in the college are either NSS or NCC? This question cannot be answered unless more information is provided. Adding 100 NCC students and 75 NSS students is not a correct answer. Since, some of the students may participate in both NCC and NSS activities. So that, when we add 100 NCC and 75 NSS students, some of the students who participated in both may be counted twice. The number of students in either NCC or NSS is equal to sum of the number of students in NCC and the number of students in NSS minus the number of students in both NCC and NSS. This observation adopted to the principle of inclusion and exclusion, and we extend this for more sets. Principle of Inclusion and Exclusion Let A1, A2, ....., An be finite sets. Then |A1 N A2 N ...... N An|

=



Ai



1≤ i ≤ n



Ai ∩ Aj +

1≤ i ≤ j ≤ n



Ai ∩ Aj ∩ Ak

1≤ i ≤ j ≤ k ≤ n

+ ...... + (–1)n +1 |A1OA2 .....OAn| Remark: For n = 2 |A ∪ B| = For n = 3 |A ∪ B ∪ C| =

|A| + |B| – |A ∩ B| |A| + |B| +|C| – |A ∩ B| – |A ∩ C| – |B ∩ C| + |A ∩ B ∩ C|

For n = 4 |A ∪ B ∪ C ∪ D| =

|A| + |B| +|C| + |D| – |A ∩ B| – |A ∩ C| – |A ∩ D| – |B ∩ C| – |B ∩ D| – |C ∩ D| + |A ∩ B ∩ C| + |A ∩ B ∩ D| + |B ∩ C ∩ D| + |A ∩ C ∩ D| – |A ∩ B ∩ C ∩ D| Remark: If A1, A2, ....., An are disjoint sets, then |A1 ∪ A2 ∪ ..... ∪ An| = |A1| + |A2| + ..... +|An| WORKED EXAMPLES 2.5 Example 1: There are 345 students at a college who have taken a course in physics, 220 who have taken mathematics, and 175 who have taken courses in both physics and

mathematics. How many students have taken a course in either physics or mathematics? Solution: Let A be the set of students who have taken physics course and B be the set of students who have taken mathematics course. |A| = 345, |B| = 220 and |A ∩ B| = 175 By the principle of inclusion - exclusion |A ∪ B| = |A| + |B| – |A ∩ B| = 345 + 220 – 175 = 390 The number of students who had taken a course in either physics or mathematics is 390. Remark: The number of positive integers between 1 and x, that are divisible by both a ⎢ ⎥ x and b = ⎢ ⎥ ⎣ LCM (a, b) ⎦ Example 2: How many positive integers not exceeding 1000 are divisible by 7 or 11? Solution: By the result, ⎢n⎥ There are ⎢ ⎥ positive integers not exceeding n that are divisible by d. ⎣d ⎦ Let A be the set of positive integers not exceeding 1000 that are divisible by 7, and let B be the set of positive integers not exceeding 1000 that are divisible by 11, then A ∩ B is the set of integers not exceeding 1000 that are divisible by both 7 and 11. |A| = = 142 |B| = = 90 |A ∩ B| = = 12 We have |A ∪ B| = |A| + |B| – |A ∩ B| = 142 + 90 – 12 = 220 There are 220 positive integers not exceeding 1000 that are divisible by either 7 or 11. Example 3: Find the number of integers between 1 and 250 that are not divisible by any of the integers 2, 3, 5 and 7. Solution: Let A, B, C D are the set of integers between 1 and 250 that are divisible by 2, 3, 5, 7 respectively. ⎢ 250 ⎥ ⎢ 250 ⎥ = 125, |B| = ⎢ |A| = ⎢ ⎥ ⎥ = 83 ⎣ 2 ⎦ ⎣ 3 ⎦ |C| =

⎢ 250 ⎥ ⎢ 250 ⎥ ⎢ 5 ⎥ = 50, |D| ⎢ 7 ⎥ 35 ⎦ ⎦ ⎣ ⎣

⎢ 250 ⎥ |A ∩ B| = ⎢ ⎥ ⎣ LCM (2,3) ⎦

⎢ 250 ⎥ ⎢ 250 ⎥ = ⎢ ⎥= ⎢ ⎥ = 41 ⎣ 2 x3 ⎦ ⎣ 6 ⎦

⎢ 250 ⎥ |A ∩ C| = ⎢ ⎥ ⎣ LCM (2,5) ⎦

⎢ 250 ⎥ =⎢ ⎥ = 25 ⎣ 10 ⎦

⎢ 250 ⎥ ⎢ 250 ⎥ |A ∩ D| = ⎢ ⎥ = ⎢ ⎥ = 17 ⎣ LCM (2,7) ⎦ ⎣ 14 ⎦ |B ∩ C| =

⎢ 250 ⎥ ⎢ 250 ⎥ ⎢ LCM (3,5) ⎥ = ⎢ 15 ⎥ =16 ⎣ ⎦ ⎣ ⎦

|B ∩ D| =

⎢ 250 ⎥ ⎢ 250 ⎥ ⎢ LCM (3,7) ⎥ = ⎢ 21 ⎥ = 11 ⎦ ⎣ ⎦ ⎣

|C ∩ D| =

⎢ 250 ⎥ ⎢ 250 ⎥ ⎢ LCM (5,7) ⎥ = ⎢ 35 ⎥ = 7 ⎦ ⎣ ⎦ ⎣

⎢ ⎥ ⎢ 250 ⎥ 250 |A ∩ B ∩ C| = ⎢ ⎥ = ⎢ ⎥ =8 ⎣ LCM (2,3,5) ⎦ ⎣ 2 x3 x5 ⎦ |A ∩ B ∩ D| =

⎢ ⎥ ⎢ 250 ⎥ 250 ⎢ LCM (2,3,7) ⎥ = ⎢ 2 x3 x7 ⎥ = 5 ⎦ ⎣ ⎦ ⎣

⎢ ⎥ 250 |A ∩ C ∩ D| = ⎢ ⎥ ⎣ LCM (2,5,7) ⎦

⎢ 250 ⎥ = ⎢ ⎥=3 ⎣ 2 x5 x 7 ⎦

⎢ ⎥ 250 |B ∩ C ∩ D| = ⎢ ⎥ ⎣ LCM (3,5,7) ⎦

⎢ 250 ⎥ = ⎢ ⎥ =2 ⎣ 3 x5 x 7 ⎦

⎢ ⎥ 250 ⎢ 250 ⎥ =⎢ |A ∩ B ∩ C ∩ D| = ⎢ ⎥ ⎥ =1 ⎣ 2 x3 x5 x 7 ⎦ ⎣ LCM (2,3,5,7) ⎦ Then we have |A ∪ B ∪ C ∪ D| = |A| + |B| + |C| + |D| – |A ∩ B| – |A ∩ C| – |A ∩ D| – |B ∩ C| – |B ∩ D| – |C ∩ D| + |A ∩ B ∩ C| + |A ∩ B ∩ D| + |A ∩ C ∩ D| + |B ∩ C ∩ D| – |A ∩ B ∩ C ∩ D| = 125 + 83 + 50 + 35 – 41 – 25 – 17 – 16 – 11 – 7 + 8 + 5 + 3 + 2 – 1 = 193 The number of integers between 1 and 250 that is divisible by any of the integers 2, 3, 5 and 7 = 193. The number of integers between 1 and 250 that is not divisible by any of the integers 2, 3, 5 and 7 = 250 – 193 = 57. Example 4: Find the number of integers between 1 and 500 that are divisible by any of the integers 2, 3, 5 and 6.

Solution: Let A, B, C, D are the set of positive integers between 1 and 500 that are divisible by 2, 3, 5, 6 respectively. ⎢ 500 ⎥ |A| = ⎢ = 250 ⎥ ⎣ 2 ⎦ |B| =

⎢ 500 ⎥ ⎢ 3 ⎥ = 166 ⎣ ⎦

|C| =

⎢ 500 ⎥ ⎢ 5 ⎥ = 100 ⎣ ⎦

|D| =

⎢ 500 ⎥ ⎢ 6 ⎥ = 83 ⎣ ⎦

|A ∩ B| =

⎢ 500 ⎥ ⎢ 500 ⎥ ⎢ LCM (2,3) ⎥ = ⎢ 2 x3 ⎥ =83 ⎣ ⎦ ⎣ ⎦

|A ∩ C| =

⎢ 500 ⎥ ⎢ 500 ⎥ ⎢ LCM (2,5) ⎥ = ⎢ 2 x5 ⎥ = 50 ⎦ ⎣ ⎦ ⎣

|A ∩ D| =

⎢ 500 ⎥ ⎢ 500 ⎥ ⎢ LCM (2,6) ⎥ = ⎢ 6 ⎥ = 83 ⎦ ⎣ ⎦ ⎣

|B ∩ C| =

⎢ 500 ⎥ ⎢ 500 ⎥ ⎢ LCM (3,5) ⎥ = ⎢ 3x5 ⎥ = 33 ⎦ ⎣ ⎦ ⎣

|B ∩ D| =

⎢ 500 ⎥ ⎢ 500 ⎥ ⎢ LCM (3,6) ⎥ = ⎢ 6 ⎥ = 83 ⎣ ⎦ ⎣ ⎦

|C ∩ D| =

⎢ 500 ⎥ ⎢ 500 ⎥ ⎢ LCM (5,6) ⎥ = ⎢ 5 x6 ⎥ = 16 ⎦ ⎣ ⎦ ⎣

|A ∩ B ∩ C| =

⎢ ⎥ 500 ⎢ LCM (2,3,5) ⎥ = ⎣ ⎦

⎢ 500 ⎥ ⎢ 2 x3 x5 ⎥ = 16 ⎣ ⎦

|A ∩ B ∩ D| =

⎢ ⎥ ⎢ 500 ⎥ 500 ⎢ LCM (2,3,6) ⎥ = ⎢ 2 x3 ⎥ = 83 ⎦ ⎣ ⎦ ⎣

|A ∩ C ∩ D| =

⎢ ⎥ ⎢ 500 ⎥ 500 ⎢ LCM (2,5,6) ⎥ = ⎢ 5 x6 ⎥ = 16 ⎦ ⎣ ⎦ ⎣

⎢ ⎥ 500 |B ∩ C ∩ D| = ⎢ ⎥ ⎣ LCM (3,5,6) ⎦ |A ∩ B ∩ C ∩ D| = \ We have

⎢ 500 ⎥ =⎢ ⎥ = 16 ⎣ 5 x6 ⎦

⎢ ⎥ ⎢ 500 ⎥ 500 ⎢ LCM (2,3,5,6) ⎥ = ⎢ 5 x6 ⎥ = 16 ⎦ ⎣ ⎦ ⎣

|A ∪ B ∪ C ∪ D| =

|A| + |B| + |C| + |D| – |A ∩ B| – |A ∩ C| – |A ∩ D| – |B ∩ C| – |B ∩ D| – |C ∩ D| + |A ∩ B ∩ C| + |A ∩ B ∩ D| + |A ∩ C ∩ D| + + |B ∩ C ∩ D| – |A ∩ B ∩ C ∩ D| = 250 + 166 + 100 + 83 – 83 – 50 – 83 – 33 – 83 – 16 + 16 + 83 + 16 + 16 – 16 = 366 There are 366 positive integers between 1 and 500 that are divisible by any of the integers 2, 3, 5 and 6. Note that, there are 500 – 366 = 134 positive integers between 1 and 500 that are not divisible by any of integers 2, 3, 5 and 6. Example 3: There are 2500 students in a school, of these, 1700 have taken a course in C, 1000 have taken a course in Pascal, and 550 have taken a course in networking. Further, 750 have taken courses in both C and Pascal, 400 have taken course in both C and networking, and 275 have taken course in both Pascal and networking. If 200 of these students have taken course in C, Pascal, and networking. (i) How many of these 2500 students have taken a course in any of these three courses C, Pascal, and networking? (ii) How many of these 2500 students have not taken a course in any of these three course C, Pascal, and networking? Solution: Let E be the set of students in the school. Let A be the set of students who have taken a course in C B be the set of students who have taken a course in Pascal. C be the set of students who have taken a course in networking. A ∩ B be the set of students who have taken courses in both C and Pascal. Similarly, A ∩ C, B ∩ ,C and A ∩ B ∩ C |E| = 2500 |A| = 1700, |B| = 1000, |C| = 550 |A ∩ B| = 750 |A ∩ C| = 400 |B ∩ C| = 275 |A ∩ B ∩ C| = 200 By inclusion - exclusion principle we get, |A ∪ B ∪ C| = |A| + |B| + |C| – |A ∩ B| – |A ∩ C| – |B ∩ C| + |A ∩ B ∩ C| = 1700 + 1000 + 550 – 750 – 400 – 275 + 200 = 2025 2025 of 2500 students have taken a course in any of these three courses. C, Pascal, and networking.

(ii) The number of students who have not taken any course = Total number of students – The number of students who have taken one of these courses. = |E| – |A ∪ B ∪ C| = 2500 – 2025 = 475 Therefore 475 of 2500 students have not taken a course in any of these three courses C, Pascal, and networking. EXECISES 2.3 Part - A 1. State Pigeon hole principle. 2. Show that if any six numbers from 1 to 10 are chosen, then two of them will add up to 11. 3. Among 200 people, how many of them were born in the same month? 4. State principle of inclusion and exclusion? 5. How many positive integers not exceeding 100 that is divisible by 5? 6. Show that, in any group of 27 English words, there must be at least two that begin with the same letter. 7. What is the minimum number of students required in discrete mathematics class to be sure that at least six will receive the same grade, if there are five possible grades? 8. A box contains 10 red balls and 10 blue balls. Selection of balls from the box is random. How many balls must be selected to be sure of having 4 balls of the same color? 9. There are 51 houses on a street. Each house has an address between 1000 and 1099 inclusive. Show that at least two houses have address that is consecutive integers? 10. A class of 40 students are to share 10 computers each student is assigned exactly 1 computer and no computer is to assign more than 6 students. Show that at least 4 computers are used by 3 or more students? 11. Show that there exists 2 integers x and y whose sum of difference is divisible by 10, from any 7 positive integers. Part - B 12. In a survey, there are 345 students in a college who have taken a course in calculus, 212 who have taken a course in discrete mathematics, and 188 who have taken course in both calculus and discrete mathematics. How many students have taken a course in either calculus or discrete mathematics? 13. Find the number of positive integers not exceeding 100 that are divisible by 5 or by 7. 14. Find the number of positive integers not exceeding 100 that are not divisible by 5 or by 7.

15. Prove the principle of inclusion - exclusion using mathematical induction. 16. How many students are enrolled in a course either in calculus, discrete mathematics, data structures, or programming languages in a school if there are 507, 292, 312, and 344 students in these courses respectively, 14 in both calculus and data structures, 213 in both calculus and programming languages, 211 in both discrete mathematics and programming languages and no student may take calculus and discrete maths or data structures and programming languages, coherently?

Recurrence Relations Introduction Some of the counting problems cannot be solved by using the techniques which are discussed earlier in this chapter. Consider a counting problem, suppose that there are 10 bacteria’s initially and each bacteria doubles in every hour, how many bacteria’s are there in the nth hour? Let us consider the relationship an = 2an–1, ∀ n ≥ 1, with the initial condition a0 = 10. This relationship is called recurrence relation of the counting problem. So that, we find a relationship between the terms in the sequence {an}, which will give each term of the sequence, is called recurrence relation of the sequence. Definition: A recurrence relation for the sequence {an} is an equation that expresses “an” in terms of the previous terms of the sequence, namely a0, a1, a2 ....., an–1, for all integers n with n ≥ n0, where n0 is a non negative integer. Modeling of recurrence relation Problem: A young pair of rabbits (one of each sex) is placed in an island. A pair of rabbits does not bread until they are 2 months old. After they are 2 months old, each pair of rabbits produces another pair each month. Find the recurrence relation for the number of rabbits on the island after n months, assuming that no rabbits ever die. Formulation: We can model the above problem as recurrence relation as follows: Month 1 2 3 4 5 6 7

Reproducing pair Young pair 0 0 1 1 2 3 5

1 1 1 2 3 5 8

Total 1 1 2 3 5 8 13

Let fn denotes the number of pairs of rabbits after n months. At the end of the first month, the number of pairs of rabbits in the island is f1 = 1.

Since the pair does not breed during the second month, f2 = 1. To find the number of pairs after n months, add the number of pairs available in the previous month, fn–1, and the number of New born pairs, which equals fn–2, since each new born pair comes from a pair at least 2 months old. Thus fn = fn–1 + fn–2 for n ≥ 3, with the initial conditions f1 = 1 and f2 = 1. Remark: The relation fn = fn–1 + fn–2 will gives the Fibonacci sequence {1, 1, 2, 3, 5, 8, 13, 21, ......} WORKED EXAMPLES 2.6 Example 1: Find the recurrence relation and basis for the sequence of {50, 51, 52, ......}. Solution: Let {0, 1, 2, ..........} as the basis of {50, 51, 52, 53, ...... 5k, ....} Then S0 = 1, S1 = 5, S2 = 52, ..... and Sk = 5k 5k k k–1 Sk = 5 and Sk–1 = 5 = 5 Sk = 5 Sk–1, ∀ k ≥ 1 with S0 = 1 is the recurrence relation of the given sequence. Example 2: The sequence is given by S(n) = 3.2n, n ≥ 0. Find the recurrence relation? Solution: For n ≥ 1, S (n) = 3.2n and S (n –1) = 3.2n–1 =3.2n /2 Sn=2.S(n –1), for n ≥ 1, with S(0) = 3 Example 3: Find the recurrence relation for the sequence S(k) = 2k + 9? Solution: For k ≥ 1, S(k) = 2k + 9 and S (k –1) = 2 (k – 1) + 9 S (k) = S (k – 1) + 2 with S (0) = 9 Example 4: Find the recurrence relation for the sequence B(k) = 2k2 + 1? Solution: For k ≥ 2 B(k) = 2k2 + 1 B (k –1) =

2 (k2 – 2k + 1) + 1 2 (k2 – 4k + 4) + 1

B (k –2) = Now B (k) – 2B(k –1) + B (k – 2) = 4 with B (0) = 1, B (1) = 3 is the required recurrence relation. Example 5: Find the recurrence relation satisfying Sn = A(3)n + B(–4)n. Solution: We haveSn =

A(3)n + B(–4)n

..... (1)

Sn–1 =A(3)n–1 + B(–4)n–1 3Sn–1 =A(3)n + 3B (–4)n–1 ..... (2) (1) – (2) ⇒ Sn – 3Sn–1=B(–4)n – B.3 (–4)n–1 = (–4)B (–4)n–1 – 3.B (–4)n–1 =(–7).B(–4)n–1 (3) givesSn–1 – 3Sn–2=(–7) B(–4)n–2 (3) & (4) Þ Sn – 3Sn–1 = –4 (Sn–1 – 3Sn–2)

..... (3) ..... (4)

Sn + Sn–1 – 12Sn–2 = 0, for n ≥ 2 which is the required recurrence relation. Example 6: Find the recurrence relation satisfying yn = (A + Bn) 5n. Solution: We have, yn yn–1 = 5yn–1 = yn – 5yn–1 = = (3) ⇒ yn–1 – 5yn–2 =

=

A5n + Bn.5n

..... (1)

A.5n–1 + B(n – 1)5n–1 A5n + B(n – 1)5n

..... (2)

Bn.5n – B(n – 1)5n B.5n B.5n–1

..... (3) ..... (4)

(3) & (4) ⇒ yn – 5yn–1 =5B.5n–1 = 5 (yn–1 – 5yn–2) yn – 10yn–1 + 25yn–2 = 0, for n ≥ 2 which is the required recurrence relation. Example 7: Find the recurrence relation of f (n) = 2. (4)n – 5(–3)n, for n ≥ 0. Solution: Given that f (n) = 2 (4)n – 5 (–3)n f (n – 1) = 2 (4)n–1 – 5 (–3)n–1 f (n – 2) = 2 (4)n–2 – 5 (–3)n–2 f (n) – 4f (n – 1) = –5 (–3)n + 20 (–3)n–1 f (n – 1) – 4f (n – 2) = –5 (–3)n–1 + 20 (–3)n–2

and [f (n) – 4 f (n –1)] – (–3) [f (n – 1) – 4 f (n – 2)] = 0 \ f (n) – f (n –1) – 12 f (n – 2) = 0, for n ≥ 2, with the initial conditions f (0)= –3, f (1) = 23

EXERCISE 2.4 1. Find the recurrence relation of S(k) = 6 (–5)k, n ≥ 0. 2. Find the recurrence relation of f (k) = 5 + 2k+1 + (–3)k, k ≥ 0. 3. Find the recurrence relation of S(n) = 2 + 9n, n ≥ 0. 4. Find the recurrence relation of the sequence {1, 3, 32, 33, ......} 5. Find the recurrence relation of yn = A (–3)n + B (4)n, for n ≥ 0. 6. Find the recurrence relation of D (n) = (A + nB) 4n, n ≥ 0. 7. Find the recurrence relation for the sequence S(n) = 2n + 9.

Classification of Recurrence relations A recurrence relation of the form C0(n) an + C1(n) an–1 + ....... + Ck(n) an–k = f (n), for n ≥ k, where n and k are positive integers, C0(n), C1(n), ......., Ck(n) and f (n) are the functions of n is said to be a linear recurrence relation. If C0(n) and CK(n) are not identically zero, then it is said to be a linear recurrence relation of “order k”. If C0(n), C1(n), ....., Cn(n) are constants, then it is said to be a linear recurrence relation with constant coefficient. If f (n) = 0, then it is said to be a homogeneous recurrence relation. If f (n) ≠ 0, then it is said to be a non-homogeneous (or) in homogeneous recurrence relation. Classification of Recurrence relation Linear Recurrence Relations

Type

Sn – 5 Sn–1 = 0

First order Homogeneous constant coefficient

Sn – 5 Sn–1 = 2n + 3

First order Non homogeneous constant coefficient

S(n) – 2S(n–1) + 3 S(n–3) = 7 – 5n Third order Non homogeneous constant coefficient D(k) – (k – 1) D(k–1) = 0

First order Homogeneous variable coefficient

an – nan – 1 + n(n–1) an–2 = 5

Second order Non homogeneous

variable coefficient Non-Linear Recurrence Relations 1 an = (1 + a n −1 )

Type First order Non homogeneous constant coefficient

S

2

n

an =

+S

2

n −1

=1

a n −1 a 2 n−2

First order Non homogeneous constant coefficient. Second order Homogeneous constant coefficient

⎢n⎥ S(n) = S ( ⎢ ⎥ )+ 7 ⎣2⎦

Infinite order Non homogeneous constant coefficient

In the example 9 of the above table, is infinite order recurrence relation. Because for any positive integer k, we can find recurrence relation in terms of n with order k. Take n = 2k, then S (2k) =

⎛ ⎢n⎥⎞ S ⎜⎜ ⎢ ⎥ ⎟⎟ + 7 ⎝ ⎣2⎦⎠

= S(k) + 7 = S(2k – k) + 7 Hence S(n) = S(n – k) + 7 So that, it is not possible to find a fixed positive integer k, such that a relation of the type S(n) + c1 S (n – 1) + ..... + ck S (n – k) = f (n) holds, for all n ≥ k. Solution of Recurrence Relations with constant coefficients A sequence is called a “solution” of a recurrence relation if its terms satisfy the recurrence relation. ∞ For example, A sequence {S n }n =0 , where Sn = 2n satisfies the recurrence relation Sn = 2 Sn–1, for n ≥ 1 is called a solution. First order homogeneous In this section, we find a solution of the first order homogeneous recurrence relation with constant coefficient. Equate Sn and Sn–1, find Sn–1 in terms of Sn–2 by using the given relation, and continue the process up to S0, hence using the initial conditions, we can find Sn in terms of n, is called solution of the given recurrence relation. Also called closed form expression for the given sequence. For this type we can also use the induction principle to find the solution.

Example 1: We solve the recurrence relation S(n) + 5S(n – 1) = 0, S (0) = 3. Now, S(n) = – 5 S (n – 1) = = = S (n) =

– 5 . (–5) S (n – 2) = (–5)2 S (n –2) (– 5)3 S (n – 3) ........ (– 5)n S (0) 3.(–5)n, n S 0 is the required solution.

Example 2: Find a closed form expression for the recurrence relation f (k) – 2 f (k – 1) = 0, f (0) = 7. Given that f (k) = 2f (k – 1) we can find the solution by induction method. As f (0) = 7 For k = 1, f (1) = 2 (7) and f (2) = 22 (7) 2k (7) We can show that f (k + 1) = 2k+1 (7)

Assume that

f (k) =

By induction method f (n) = is the required solution.

(7) 2n, for all n S 0,

Solution of Higher order Linear Homogeneous relations Consider the mth order homogeneous recurrence relation with constant coefficient. S(n) + c1 S(n – 1) + ...... + cms (n – m) = 0 ..... (1) where c1, c2, ......., cm are constant. (cm ≠ 0) Definition: The characteristic equation of the homogeneous relation of order m S(n) + c1 S (n – 1) + ...... + cm S (n – m) = 0 is the mth degree equation am + c1am–1 + ..... + cm–1a . + cm = 0 Algorithm (to solve higher order homogeneous relations) Step 1: Step 2:

Write the characteristic equation of the given recurrence relation. Find all roots of the characteristic equation. (They are called charactertic roots).

Step 3: Case (i): If the roots a1, a2, a3, ......, am are distinct then the general solution of the recurrence relation is

S(n) = b1a1n + b2a2n + ....... + bmamn ....... (2) where b1, b2, ..... bm are constant. Case (ii): If the roots ai is repeated r times, then the general solution for that root is (b0 + b1n + b2n2 + ...... + br–1nr–1 )ain, where b0, b1, ....... br–1 are constant. If m initial conditions are given, obtain the linear equations in m unknown b1, b2, ........ bm, hence find the value of the unknowns. Note:If a characteristic equation has integral roots then the roots will be factors of the independent term of the polynomials. In such cases, trail and error method can be applied to factors of the independent terms first. Step 4:

WORKED EXAMPLES 2.7 Example 1: Write the characteristic equation of S(k) – 10 S(k–1) + 9 S(k – 2) = 0,. k ≥ 2. Solution: The characteristic equation is a2 – 10a + 9 = 0 Example 2: Write the characteristic equation of S(n + 3) + 4 S (n + 2) – 7 S(n + 1) + 5S (n) = 0, n ≥ 0. Solution: The characteristic equation is a3 + 4a2 – 7a + 5 = 0 Example 3: Solve the recurrence relation f (n) – 8 f (n – 1) + 16 f (n – 2) = 0, n S 2, where f (2) = 16, f (3) = 80. Solution: The characteristic equation is a2 – 8a + 16 = 0 The characteristic roots are 4, 4 f (n) =

(a + b. n) 4n

....... (1)

Given that f (2) = 16 = f (3) = 80 = 16a + 32b = 64a + 192b = (2) × 4 ⇒ 64a + 128b = 3 ⇒ 64a + 192 b = 64b =

(a + 2b) 42 (a + 3b) 43 16 80 64 80 16

... (2) ... (3)

1 1 , hence a = 2 4 ⎛1 n⎞ (1) ⇒ f (n) = ⎜ + ⎟ 4n, is the required solution. ⎝ 2 4⎠

b =

Example 4: Solve the following recurrence relation S(k) – 7 S(k – 1) + 6 S (k – 2) = 0, for n ≥ 2, S(0) = 8, S (1) = 6. Solution: The characteristic equation is given by a2 – 7a + 6 = 0 The roots are

a = S(k) =

A(1)k + B(6)k ..... (1)

S(0) = 8 = 8 =

A(1)0 + B(6)0 A+B ......(2) A(1)1 + B(6)1

Solution is Given that i.e.,

1, 6

and S(1) = 6 = i.e., 6 = Now, (2) – (3) ⇒ 2 = B = and A =

A + 6B –5B 2 – 5

......(3)

8–B=8+

2 42 = 5 5

42 5 42 ⎛ 2 ⎞ k (1) ⇒ S(k) = + ⎜ − ⎟ 6 is the solution. 5 ⎝ 5⎠

i.e., A =

Example 5: Solve the recurrence relation S(n) – 4 S(n – 1) – 11 S (n – 2) + 30 S (n – 3) = 0, for n ≥ 3, with S(0) = 0, S(1) = – 35, S (2) = –85. Solution: The characteristic equation is a3 – 4a2 – 11a + 30 = 0 ...... (1) Since it is the cubic equation, we can find one root by trail and error method. (First we check the factors of 30, i.e., ± 1, ± 2, ± 3, ± 5, ± 6, ± 10, ± 15). a = 2 is the one root.

2

1 0 1

–4 2 –2

–11 –4 –15

30 –30 0

Remaining roots can be obtained from a2 – 2a – 15 = 0 which are – 3 and 5. a = The general solution is

2, –3, 5 are the roots of (1)

S (n) = A(2)n + B (–3)n + C (5)n ..... (2) Given that S(0) = 0, S(1) = –35, S(2) = –85 we get (2) ⇒ A + B + C = 0 ..... (3) 2A – 3B + 5C = – 35 ..... (4) 4A + 9B + 25C = – 85 ..... (5) Now, (3) × 2 ⇒ 2A + 2B + 2C = 0 (4) ⇒ 2A – 3B + 5C = – 35 5B – 3C = 35 ..... (6) (4) × 2 ⇒ 4A – 6B + 10C = – 70 (5) ⇒ 4A + 9B + 25C = – 85 – 15B – 15C = 15 ⇒ B+C = –1 ..... (7) (7) × 3 ⇒ 3B + 3C = – 3 (6) ⇒ 5B – 3C = 35 8B = 32 ⇒B = 4 (7) ⇒ C = –1–B=–5 C = –5 (5) ⇒ A = –B–C A = 1 The solution is S(n) = 2n + 4 (–3)n – 5(5)n, for n ≥ 0. Example 6: Write the recurrence relation for Fibonacci numbers and hence solve it. Solution: The recurrence relation of Fibonacci numbers is F(n) = F (n – 1) + F (n – 2), n ≥ 2 with F(0) =1, F (1) = 1 i.e., F (n) – F (n – 1) – F (n – 2) = 0 The characteristic equation is a2 – a – 1 = 0 a Hence the roots are

=

1± 5 2

1− 5 1+ 5 , . 2 2

The solution is F(n) = As F(0) = 1, F(1) = 1 We get, 1 =

⎛1 + 5 ⎞ ⎟ C ⎜⎜ ⎟ 2 ⎝ ⎠

n

n

⎛1 − 5 ⎞ ⎟ .... (1) + C2 ⎜⎜ ⎟ 2 ⎝ ⎠

C1 + C2

.... (2)

1 =

C1

1+ 5 1− 5 + C2 2 2

1 =

C1

1+ 5 1− 5 + (1 – C1) 2 2

.... (3)

(substitute (2) in (3))

1+

2 =

C1 (1 +

2 =

C1 (1 + 5 ) + (1 –

5

=

C1 (1 +

=

2 5 C1

C1 =

1+ 5 2 5

5 ) + (1 – C1) (1 –

5 ) – C1 (1 –

5)

5 –1+ 5 )

−1+ 5

, hence C2 =

2 5 n

The solution is F (n) =

5)

1 + 5 ⎛1 + 5 ⎞ −1+ 5 ⎜ ⎟ + ⎜ ⎟ 2 5 ⎝ 2 ⎠ 2 5

⎛1 − 5 ⎞ ⎜ ⎟ ⎜ 2 ⎟ ⎝ ⎠

Example 7: Solve the recurrence relation un+3 – 6 un+2 + 11 un+1 – 6 un= 0, with u0 = 2, u1 = 0, u2 = –2. Solution: The characteristic equation is a3 – 6a2 + 11a – 6 = 0 a = 1 is a root. 1 1 0

–6 1

11 –5

–6 6

1

–5

6

0

a2 – 5a + 6 = 0 ⇒ a = 2, 3 The roots are a = 1, 2, 3 The solution of the recurrence relation is un = A(1)n + B(2)n + C(3)n...... (1)

n

As u0 = 2, u1 = 0, u2 = –2, we get 2 = 0 = –2 = Now, (3) – (2) ⇒ –2 = (4) – (3) ⇒ –2 = i.e., –2 = –1 = 1 = Hence, B = – 4, A = The required solution is

A+B+C A + 2B + 3C A + 4B + 9C B + 2C 2B + 6C B + 2C B + 3C C 5

un =

5 + (– 4) 2n + 1 (3)n

un =

5 – (2)n+2 + 3n, n ≥ 0

..... (2) ..... (3) ..... (4)

Example 8: Solve the recurrence relation an = 2 (an–1 – an–2), for n ≥ 2 with a0 = 1, a1 = 2. Solution: an = 2 (an–1 – an–2) ⇒ an – 2 an–1 + 2 an–2 = 0 The characteristic equation is given by λ 2 – 2λ + 2 = 0

..... (1)

λ

= 1 ± i The roots are 1 + i, 1 – i. Solution is an = A (1 + i)n + B (1 – i)n, where A and B are arbitrary complex constants. (If roots are real the constants are real arbitrary constants) Now, we have z = x +iy = r [cos θ + i sin θ ] ⎛ y⎞ r = x 2 + y 2 , θ = tan–1 ⎜ ⎟ ⎝ x⎠ and DeMoivre’s theorem (cos θ + i sin θ )n = cos n θ + i sin n θ , for n ≥ 0

where

we have,

(1 + i)n = =

⎡ π π ⎞⎤ ⎛ ⎢ 2 ⎜ cos 4 + i sin 4 ⎟⎥ ⎝ ⎠⎦ ⎣

( )

⎡ ⎢ 2 ⎣

n

n

nπ nπ ⎛ + i sin ⎜ cos 4 4 ⎝

⎞⎤ ⎟⎥ ⎠⎦

(1 – i)n =

and

( )

⎡ ⎢ 2 ⎣

n

nπ nπ ⎞⎤ ⎛ − i sin ⎜ cos ⎟ 4 4 ⎠⎥⎦ ⎝

Now,

( )

⎡ an = A ⎢ 2 ⎣

n

nπ nπ ⎛ + i sin ⎜ cos 4 4 ⎝

( )

⎡ ⎞⎤ ⎟⎥ +B ⎢ 2 ⎠⎦ ⎣

n

( )

nπ nπ ⎛ + i ( A − B) sin ⎜ ( A + B) cos 4 4 ⎝

( )

⎞⎤ ⎟⎥ ... (2) ⎠⎦

⎡ = ⎢ 2 ⎣

n

n ⎛ ⎡ nπ nπ an = ⎢ 2 ⎜ C1 cos + C 2 sin 4 4 ⎝ ⎣ is the required solution of (1). Let C1 = A + B, C2 = i (A – B)

nπ nπ ⎛ − i sin ⎜ cos 4 4 ⎝

⎞⎤ ⎟⎥ ⎠⎦

⎞⎤ ⎟⎥ ⎠⎦

Since a0 = 1, a1 = 2. (2)

⇒ a0 = [C1 cos 0 + C2 sin 0] = C1 ⇒ 1= C1 a1 = 2 = 2 = ⇒ C2 =

(2) ⇒

( )

⎡ an= ⎢ 2 ⎣

n

( )

⎡ π π ⎞⎤ ⎛ ⎢ 2 ⎜ C1 cos 4 + C 2 sin 4 ⎟⎥ ⎝ ⎠⎦ ⎣

( )

⎡ ⎛ 1 1 ⎞⎤ ⎟⎟⎥ + C2 ⎢ 2 ⎜⎜ C1 2 2 ⎠⎦ ⎝ ⎣ C1 + C2 1

nπ nπ ⎛ + i sin ⎜ cos 4 4 ⎝

⎞⎤ ⎟⎥ , n ≥ 0 ⎠⎦

Example 9: Solve the recurrence relation an+2 + an = 0, where n ≥ 0 and a0 = 1, a1 = 3. Solution: The characteristic equation is given by α2+1 = 0

α

=

+i

an

=

A (i) + B (–i)n , where A, B are arbitrary complex

The general solution is constants. We have

i = cos

π

+ i sin

π

2 2 nπ nπ (i)n = cos + i sin 2 2

nπ nπ – i sin 2 2 nπ nπ an = A (cos + i sin ) 2 2 nπ nπ + B(cos - i sin ) 2 2

and (–i)n = cos

nπ nπ + i (A – B) sin 2 2 nπ nπ an = C1 cos + C2 sin , 2 2 C1 = A + B, C2 = i (A – B).

= (A + B) cos

Let

Given that a0 = 1 and a1 = 3, we get 1 = C1 an

and 3 = C2 =

cos

nπ nπ + 3 sin , for all n ≥ 0 2 2

EXERCISES 2.5 Part - A 1. What is meant by solution of the recurrence relation? 2. What is the characteristic equation of the following recurrence relation S(k) + 2 S(k – 1) – 3 S(k – 2) – 6 S (k – 4) = 0? 3. If an+2 = an+1 + an, then the sequence {an} is known as ........... sequence., where a1 = 1, a2 = 1. 4. Find the homogeneous solution of Sn – 7Sn–1 + 10 Sn–2 = 6 + 8n 5. Give an example for non-homogeneous linear recurrence relation with constant coefficient of order 3. Part - B Solve the following recurrence relations 6. S(n) – 2 S (n – 1) – 8S (n – 2) = 0, for n ≥ 2 7. S (k) – 20 S (k – 1) + 100 S (k – 2) = 0, S (0) = 2, S (1) = 30. 8. f (n) + 6 f (n – 1) + 12 f (n – 2) + 8 f (n – 3) = 0 9. un – 7un–2 + 6 un–3 = 0, where u0 = 8, u1 = 6, u2 = 22. 10. yn+2 – 3 yn+1 – 4yn = 0, with u0 = 1, u1 = 3. 11. Fn = Fn–1 + Fn–2, n S 2, with F0 = 1, F1 = 1. 12. D (n) – 8 D (n – 1) – 9 D (n – 2) = 0, with D (0) = 1, D (1) = 0.

13. S (k) – 10 S (k – 1) + 9 S (k – 2) = 0, with S (0) = 3, S (1) = 11.

Non-Homogeneous Recurrence Relations The non-homogeneous recurrence relation is given by S(n) + c1 S (n – 1) + c2 S (n – 2) + ....... + cm S (n – m) = Φ (n), where Φ (n) ≠ 0 and c1, c2 , ..... cm are constants. The solution of non-homogeneous is the sum of two solutions (i) Solution of homogeneous recurrence relation (by considering RHS = 0) (ii) Particular solution depending on the RHS of the given recurrence relation. Procedure for finding the particular solution (a) If the RHS of the recurrence relation is a0 + a1n + ...... + ar nr, then substitute d0 + d1n + d2n2 + ..... + drnr in place of S (n). d0 + d1(n – 1) + d2(n – 1)2 + ..... + dr(n – 1)r in place of S (n – 1), ..... and so on, in LHS of the given recurrence relation. (b) If the RHS is c ( α )n where a is not the characteristic root, then substitute d ( α )n in place of S(n), d ( α )n–1 in place of S(n – 1), ... and so on, in the LHS of the given recurrence relation. (c) If the RHS is c( α )n where α is the characteristic root of m times, then substitute d nm an in place of S(n), d (n – 1)m α n–1 in place of S(n – 1), ... and so on, in the LHS of the given recurrence relation. Step 2: At the end of the step 1, we get a polynomial in n with coefficients d0, d1, ..... on LHS, equate now the LHS and RHS, and compare the coefficients find the constants d0, d1, ...... Remark: If the initial conditions are given, then find the constants present in the solution of the homogeneous relation. Step 1:

WORKED EXAMPLES 2.8 Example 1: Solve S(k) – 5 S(k – 1) + 6 S(k – 2) = 2, with S (0) = 1, S (1) = –1. Solution: To find homogeneous solution: The characteristic equation is a2 – 5a + 6 = 0 The roots are 2, 3. The homogeneous solution is = A (2)k + B (3)k ..... (1) To find particular solution: As the RHS of the recurrence relation is a constant. We place a constant c in place of S (k), c in place of S (k – 1), and

c in place of S (k – 2) in LHS of the given recurrence relation and hence equate to RHS, we get c – 5c + 6c = 2 2c = 2 ⇒c = 1 The particular solution is 1. The general solution is S(k) = A(2)k + B(3)k + 1 ..... (2) Given that S(0) = 1, S(1) = – 1, (2) ⇒ 1 = A+B+1 – 1 = 2A + 3B + 1 i.e., A + B = 0 and 2A + 3B = – 2 A = – B and 2A + 3B = – 2 2 (–B) + 3B = – 2 B = – 2 and A = 2. The solution is S(k) = 2(2)k – 2 (3)k + 1 i.e.,

S(k) =

2k+1 – 2.(3)k + 1

Example 2: Solve y(n) – 3y (n – 1) – 4y (n – 2) = 4n. Solution: To find homogeneous solution: The characteristic equation is a2 – 3a – 4 = 0 The roots are: 4, – 1. The homogeneous solution is = A (4)n + B(–1)n ...... (1) To find particular solution: As the RHS is 4n. Since 4 is a simple root of the characteristic equation, substitute dn4n in place of y (n), d (n – 1) 4n – 1 in place of y (n – 1), and d (n – 2) 4n–2 in place of y (n – 2) in the LHS and equate to RHS, we get dn4n – 3 d (n – 1)4n–1 – 4 d (n – 2) 4n–2 = 4n Now, divide both sides by 4n–2 16dn – 12 d (n – 1) – 4 d (n – 2) = 16 4 compare the constants, we get d = 5 4 4 Hence the particular solution is dn 4n = n4n = n4 n +1 5 5 4 The general solution is y (n) = A (4)n + B(–1)n + n4 n +1 5

Remark: 1. If the RHS is c α n, α is not a root of the characteristic equation, then substitute d an in place of S(n), d α n–1 in place of S(n – 1), and so on. 2. If the RHS is c α n, a is a simple root, substitute d n α n in place of S(n), d(n – 1) α n–1 in place of S(n – 1), and so on. 3. If the RHS is c α n, a is double root of the characteristic equation, then substitute dn2 α n in place of S (n), d (n – 1)2 α n–1 in place of S(n – 1), and so on. Example 3: Solve S (k) – 6 S (k – 1) + 9S (k –2) = 14.3k + 2.k + 1. With S (0) =0, S(1) = 1. Solution: To find homogeneous solution: The characteristic equation is a2 – 6a + 9 = 0 The roots are 3, 3 The homogeneous solution

= ( α + k β ) 3k

..... (1)

To find particular solutions: (i) PI corresponding to 3k. 3 is the double root of the characteristic equation. Substitute dk2 3k in place of S (k), d (k – 1)2 3k–1 in place of S (k – 1), and d (k – 2)2 3k–2 in place of S (k – 2) in the LHS and equate to 14(3)k, we get d(k)2 3k – 6 d(k – 1)2 3k–1 + 9d (k –2)2 3k–2 = 14 (3)k Divide by 3k on both sides, we get ⎛1⎞ ⎛1⎞ dk2 – 6d (k – 1)2 ⎜ ⎟ + 9d (k – 2)2 . ⎜ ⎟ = 14 ⎝ 3⎠ ⎝9⎠ dk2 – 2d (k2 – 2k + 1) + d (k2 – 4k + 4) – 2d + 4d 2d d

= = = =

14 14 14 7

PI1 = 7 k23k

..... (2)

(ii) PI corresponding to (2k + 1): As RHS is 2k + 1, substitute a + bk in place of S (k), a + (k –1)b in place of S (k –1), and a + (k – 2)b in place of S (k – 2) in the LHS and equate to 2k + 1, we get. [a + kb] – 6 [a + (k – 1)b] + 9 [a + (k – 2) b] = 2k + 1 a + kb – 6a – 6kb + 6b + 9a + 9kb – 18b = 2k + 1 i.e. [4b] k + 4a – 12b = 2k + 1 Comparing the coefficient of k

4b We get b =

=

2 and 4a – 12b = 1

7 1 , a= 2 4

Therefore particular solution for 2k + 1 is

7 1 + (k) 4 2

The general solution is S(k)

=

As S(0) = 0 ⇒

0

=

As S(1) = 1 ⇒

1

=

7 ( α + k β ) 3k + 7 (k)2 3k + + 4 7 α + 4 7 ( α + β ) 3 + 7 (1)2 (3)1 + + 4

1 2

1 2

By solving for α & β , we get 7 4

α=– , β =–

17 3

The general solution is

i.e.,

S(k)

=

S(k)

=

7 k 7 (- -6k)3k + 7 (k)2 3k + + 4 2 4 17 7 k 7 (7k 2 - k - )3 k + + 3 4 2 4

Example 4: Solve S(k) + 5 S(k – 1) + 6 S (k – 2) = 3k2 – k + 1. Solution: To find homogeneous solution: The characteristic equation is a2 + 5a + 6 = 0 The roots are – 2, – 3. The homogeneous solution = C1 (–2)k + C2 (–3)k To find PI As the RHS is of the form 3k2 – k + 1, substitute a + bk + ck2 in place of S (k), a + b (k – 1) + c (k –1)2 in place of S (k –1), and a + b (k – 2) + c (k – 2)2 in place of S (k – 2), hence equate to RHS. We get [a + bk + ck2] + 5 [a + b (k – 1) + c(k – 1)2] + 6 [a + b (k – 2) + c(k – 2)2] = 3 k2 – k + 1 [a + bk + ck2] + 5[a + bk – b + ck2 – 2ck + c] + 6 [a + bk – 2b + ck2 – 4ck + 4c] = 3k2 – k + 1 [c + 5c + 6c] k2 + [b + 5b – 10c + 6b – 24c] k + [a + 5a – 5b + 5c + 6a – 12b + 24c] = 3k2 – k + 1

[12c] k2 + [12b – 34c] k + [12a – 17b + 29c] = 3k2 – k + 1 By equating the coefficient, we get 12c = 3 ..... (1) 12b – 34c = –1 ..... (2) 12a – 17b + 29c = 1 ..... (3) 1 5 35 \c = ,b= ,a= 4 8 8 PI = a + bk + ck2 35 5 1 + k + k2 8 8 4 1 = (35 + 5k + 2k2) 8

=

The general solution is 1 S(k) = C1 (–2)k + C2 (–3)k + (35 + 5k + 2k2) 8

Example 5: Solve S(k) – 4 S(k – 1) + 4 S (k – 2) = (k + 1)2k. Solution: The characteristic equation is given by a2 – 4a + 4 = 0 a

=

2, 2

The homogeneous solution = (A + Bk)2k. To find PI: Since the RHS is (k + 1) 2k, and 2 is a double root. Let Substitute

PI

=

S(k)

=

S (k – 1)

=

(ck + d).k2.2k (ck + d) k2 2k [c (k – 1) + d] (k – 1)2 2k–1 [c (k – 2) + d] (k – 2)2 2k–2 in LHS

S (k – 2) = and hence equal to RHS, we get (ck + d) k22k – 4 [c (k – 1) + d]. (k – 1)2 2k–1

+ 4 [c [k – 2) + d] (k – 2)2 2k – 2 = (k + 1) 2k Divide both sides by 2k 1 [ck + d] k2 – 4 [c (k – 1) + d] (k – 1)2 . 2 1 = + 4 [ c (k – 2) + d] (k – 2)2 4

k+1

ck3 + dk2 – 2c (k – 1)3 – 2d (k – 1)2 + c (k – 2)3 + d (k – 2)2 = k + 1 (6c) k + (2d – 6c) = k + 1 comparing the coefficients, we get 1 d=1 c= 6

⎛k3 ⎞ ⎛k ⎞ + k 2 ⎟⎟ 2k PI = ⎜ + 1⎟ k22k = ⎜⎜ ⎝6 ⎠ ⎝ 6 ⎠ The general solution is S (k) S (k)

=

⎞ ⎛k3 + k 2 ⎟⎟ 2k (A + Bk) 2k + ⎜⎜ ⎠ ⎝ 6

=

⎛ k3 ⎞ (A + Bk + ⎜⎜ + k 2 ⎟⎟ ).2k ⎝ 6 ⎠

Example 6: S (k) – 4S (k – 1) + 4S (k – 2) = 3k + 2k, with k ≥ 2, and S (0) = 1, S (1) = 1. Solution: (i) To find the homogeneous solution: The characteristic equation is given by a2 – 4a + 4 = 0 a

=

2, 2

The homogeneous solution = (A + Bk) 2k (ii) To find the particular integral for 3k: Let PI1 = c + dk then substitute

S (k) S (k – 1) and S (k – 2)

= = =

c + dk c + d (k – 1) c + d (k – 2) in LHS and equate to 3k

We get [c + dk] – 4 [c + d (k – 1)] + 4 [ c + d (k – 2)] = (c – 4d) + dk = 3k By comparing the coefficients, we get d = 3, c = 12 PI1 = 12 + 3k

3k

(iii) To find the particular integral for 2k: Let PI2 = ak22k (since 2 is a characteristic root of order 2) substitute

S (k)

=

ak2 2k,

S (k – 1)

=

S (k – 2)

=

a (k – 1)2 2k – 1 a (k – 2)2 2k – 2

in the LHS and equate to 2k. We get, ak22k – 4 [a (k – 1)2] 2k – 1 + 4 [a (k – 2)2] 2k – 2 = 2k Dividing both sides by 2k, we get 1 1 ak2 – 4a (k2 – 2k + 1)( ) + 4 [a (k2 – 4k + 4)] ( ) = 1 2 4 2a = 1 1 a = 2 1 PI2 = ( ) (k)2 2k = k2 2k–1 2 The general solution is S (k) = (A + Bk)2k + (12 + 3k) + k22k–1 Given that S (0) = 1 ⇒ 1 S (1) = 1 ⇒ 1

= =

A = –11, S (k)

=

S (k)

=

A + 12 (A + B) 2 + 16 7 B= 2 7 ⎞ ⎛ ⎜ − 11 + k ⎟ 2k + (12 + 3k) + k2 2k–1 2 ⎠ ⎝ (k2 + 7k – 22) 2k–1 + (12 + 3k)

Example 7: Solve the recurrence relation an – 3 an–1 = n,n ≥ 1 with a0 = 1. Solution: To find homogeneous solution: The characteristic equation is given by α–3=0 ⇒ α=3 The homogeneous solution is = A(3)n To find particular solution: As the RHS of the recurrence relation is linear, let PI = cn + d, then substitute S(n) = cn + d S (n – 1) = c (n – 1) + d in LHS of the given recurrence relation and hence equate to RHS, we get [cn + d] – 3 [c (n – 1) + d] = n cn + d – 3cn + 3c – 3d = n (–2c)n + (3c – 2d) = n

comparing the coefficients, we get 1` and 2

– 2c

=

1; c = –

3c – 2d

=

0

2d

=

3c ⇒ d = –

PI

=



General solution is

an

=

As a0 = 1,

A

=

an

=

3 4

n 3 – 2 4 n 3 A (3)n – – 2 4 7 4 7 n 3 (3)n – – 4 2 4

EXERCISES 2.6 1. Solve S(k) – 4 S(k – 1) + 4 S(k – 2) = 3k + 2k, with S (0) = 1, S(1) = 1. 2. Solve S(k) – 5 S(k – 1) + 6 S(k – 2) = 4, with S (0) = 1, S(1) = –1. 3. Solve S(k) – 4 S(k – 1) + 4 S(k – 2) = (k + 1) 2k. 4. Solve D (k) – 5 D(k – 1) + 6 D(k – 2) = 2k + k. 5. Solve: S (k) – 7 S(k – 1) + 10 S(k – 2) = 6 + 8k, with S(0) = 1, and S(1) = 2.

Answer to Exercise 2.4 1. S(k) + 5 S (k – 1) = 0, S(0) = 6 and k ≥ 1. 2. f (k) – 7f (k – 2) + 6 f (k – 3) = 0, where f (0) = 8, f (1) = 6, f(2) = 22. 3. S (n) – 10S (n –1) + 9 S (n – 2) = 0, with S (0) = 3, S (1) = 11. 4. an = 3an–1, with a0 = 1. 5. yn – yn–1 – 12 yn–2 = 0, n ≥ 2. 6. D(n) – 8D (n – 1) + 16 D(n – 2) = 0, n S 2. 7. S(n) – S (n – 1) = 2, n ≥ 1 with S (0) = 9.

Answer to Exercise 2.5 6. S (n) = A (4)n + B (–2)n, n ≥ 0, where A and B are constants. 7. S (k) = (2 + k) 10k 8. S (k) = (A + B.k + c.k2) (–2)k 9. Hint: the characteristic equation is a3 + 0a2 – 7a + 6 = 0. Since the coefficient

of un–1 is zero. un = 5 + 2n+1 + (–3)n 10. yn =

(−1) n 1 (4)n+1 + , 5 5 n +1

1 ⎛1 + 5 ⎞ 1 ⎛1 − 5 ⎞ ⎜ ⎟ − ⎜ ⎟ 11. Fn = 5 ⎜⎝ 2 ⎟⎠ 5 ⎜⎝ 2 ⎟⎠ 1 9 (9)n + (–1)n 12. D (n) = 10 10 13. S (k) = 2 + 9k.

n +1

Answer to Exercise 2.6 1.

S(k) = (k2 + 7k – 22) 2k–1 + 3k + 12 [Hint: for 3k, let PI1 = ak + b, for 2k, let PI2 = ck22k]

2. S(k) = – 4.2k + 3k + 4 k⎞ ⎛ 3. S (k) = (A + Bk)2k + k2 ⎜1 + ⎟ 2k. 6⎠ ⎝ [Hint: PI1 = (ak + b) k22k, as 2 is a double root the characteristic equation]

4. Hint: Take the PI as (a + bk) + d.k.2k, since 2 is a root of characteristic equation. D(k) = .(2)k + (3)k + + – k2k+ 1 5. S(k) = –9.2k + 2.5k + 8 + 2k

unit2.pdf

techniques is needed in almost every discipline where mathematics is applied. Combinatorics is an important part of discrete mathematics. It is vastly applied in the fields of gambling games, computer simulations, and. wherever the counting is needed. The Basics of counting. Counting problems arise through mathematics ...

398KB Sizes 0 Downloads 183 Views

Recommend Documents

No documents