Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 6 Generating Functions.

Similar presentations


Presentation on theme: "1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 6 Generating Functions."— Presentation transcript:

1 1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 6 Generating Functions

2 2 Combinations Again The ways to choose objects from three distinct objects a, b, and c. Interpreted by polynomial: + : or  : and 1+ax : (to select a) or (not to select a) 1+bx : (to select b) or (not to select b) 1+cx : (to select c) or (not to select c) (1+ax)  (1+bx)  (1+cx) = 1+ (a+b+c)x + (ab+bc+ca)x 2 + (abc)x 3   : select none, a+b+c: select one object, ab+bc+ca: select two objects, abc: select three objects.

3 3 Combinations Again Compute the number of integer solutions for x 1 +x 2 +x 3 =12, 4  x 1, 2  x 2, 2  x 3  5. Interpreted by polynomial: 4  x 1  8 : ( x 4 + x 5 + x 6 + x 7 + x 8 ) 2  x 2  6 : ( x 2 + x 3 + x 4 + x 5 + x 6 ) 2  x 3  5 : ( x 2 + x 3 + x 4 + x 5 )  The coefficient of x 12 in f(x) = ( x 4 + x 5 + x 6 + x 7 + x 8 ) ( x 2 + x 3 + x 4 + x 5 + x 6 ) ( x 2 + x 3 + x 4 + x 5 ) is the answer. The function f(x) is called a generating function for the distribution.

4 4 Generating Functions Let a 0, a 1, a 2, … be a sequence of real numbers. The function is called the generating function for the given sequence. Example: Sequence: C(n,0), C(n,1), C(n,2), …, C(n,n), 0, 0, … Generating function: (1+x) n. Sequence: 1,1,1, …,1,0,0, …(the first n+1 terms are 1) Generating function: (1-x n+1 )/(1-x). (1-x n+1 ) = (1-x) (1+x+x 2 +…+x n ). Sequence: 1,1,1, … Generating function: 1/(1-x). (|x|<1)

5 5 Calculus Technique Equation: Left: Right:   is the generating function for the sequence 1, 2, 3, 4, … is the generating function for the sequence 0, 1, 2, 3, 4, …

6 6 Substitution Technique Equation: Substitute 2x for y   is the generating function for the sequence 1, 2, 2 2, 2 3, …

7 7 Generalized Binomial Coefficients  n, r  Z + and n  r > 0, C(n,0) = 1, C(n,r) =  n  R, r  Z +, C(n,0) = 1, C(n,r) = Example:

8 8 Maclaurin Expansion If the series is centered at 0, it is called a Maclaurin series.

9 9 Maclaurin Expansion (Cont.) For n  Z +, the Maclaurin series expansion for (1+x) -n is given by

10 10 Example 1 Find the coefficient of x 5 in C(-7,5)(-2) 5 = #

11 11 Example 2 Find the coefficient of x r in C(-1/3,r)(3) r = #

12 12 Example 3 In how many ways can we select, with repetitions allowed, r objects from n distinct objects? The generating function for the possible choices for each object is 1+x+x 2 +x 3 +… Considering all distinct objects: (1+x+x 2 +x 3 +…) n = (1/(1-x)) n = (1-x) -n. The coefficient of x r in (1-x) -n is C(-n,r) (-1) r = C(n+r-1,r). #

13 13 Determine the coefficient of x 15 in (x 2 +x 3 +…) = x 2 (1+x+x 2 +x 3 +…) = x 2 /(1-x). The coefficient of x 15 in f(x) = the coefficient of x 15 in x 8 /(1-x) 4 = the coefficient of x 7 in 1/(1-x) 4 = C(-4,7)(-1) 7 = C(4+7-1,7) = 120. # Example 4

14 14 Composition Functions If and h(x) = f(x)g(x), then

15 15 Example 5 Count the number of the compositions of a positive integer. p = 4 (n 1 = 1) = 1+3 = 2+2 = 3+1 (n 2 = 3) = 1+1+2 = 1+2+1 = 2+1+1 (n 3 = 3) = 1+1+1+1 (n 4 = 1)  8 compositions of integer 4. n i is equal to the coefficient of x p in (x+x 2 +x 3 +…) i. n = the coefficient of x p in = 2 p-1. #

16 16 Example 6 Determine the coefficient of x 8 in  a = 1, b = -1, c = -1. The coefficient of x 8 is

17 17 Example 7 Determine how many 4-element subsets of S = {1, 2, 3, …, 15} contain no consecutive integers. Consider five differences x 1, x 2,…,x 5 between the four elements in {1,3,5,7} and 1, 15: 1  1 < 3 < 5 < 7  15. x 1 + x 2 + x 3 + x 4 + x 5 = 14, where x 1,x 5  0, x 2, x 3, x 4  2. The coefficient of x 14 in f(x) is C(-5,8)(-1) 8 = 495. #

18 18 Partitions of Integers Determine the number of partitioning a positive integer n into positive summands without regard to order. p(3) = 3: 3 = 2+1 = 1+1+1 p(4) = 5: 4 = 3+1 = 2+2 = 2+1+1 = 1+1+1+1 p(5) = 7: 5 = 4+1 = 3+2 = 3+1+1 = 2+2+1 = 2+1+1+1 = 1+1+1+1+1 1+x+x 2 +… provides 0’s,1’s,2’s,… “1”. 1+x 2 +x 4 +… provides 0’s,1’s,2’s,… “2”. 1+x 3 +x 6 +… provides 0’s,1’s,2’s,… “3”.

19 19 Partitions of Integers (Cont.) p(n) = the coefficient of x n in f n (x). #

20 20 Distinct Partitions of Integers Determine the number of partitioning a positive integer n into distinct summands. p d (6) = 4: 6 = 1+2+3 = 1+5 = 2+4 1+x provides 0’s or 1’s “1”. 1+x 2 provides 0’s or 1’s “2”. 1+x 3 provides 0’s or 1’s “3”. p d (n) = the coefficient of x n in p n d (x). #

21 21 Odd Partitions of Integers Determine the number of partitioning a positive integer n into odd summands. p o (6) = 4: 1+1+1+1+1+1 = 1+5 = 1+1+1+3 = 3+3 p o (n) = the coefficient of x n in p n o (x). #

22 22 Exponential Generating Functions Let a 0, a 1, a 2, … be a sequence of real numbers. The function is called the exponential generating function for the given sequence. Example: Sequence: 1, 1, 1, …, 1, 0, 0, … Generating function: Sequence: P(n,0),P(n,1),P(n,2), …,P(n,n),0,0, Generating function:

23 23 Example In how many ways can four of the letters in ENGINE be arranged? 1+x+(x 2 /2!) provides 0’s, 1’s, or 2’s “E” (or “N”). 1+x provides 0’s or 1’s “G” (or “I”). The coefficient of x 4 /4! in f(x) is 102. #

24 24 Properties

25 25 Example A ship carries 48 flags, 12 each of the colors red, white, blue, and black. Twelve of these flags are placed on a vertical pole to communicate a signal to other ship. (a) How many of these signals use an even number of blue flags and an odd number of black flags? (b) How many of the signals have at least three white flags or no white flags at all?

26 26 Solution (a) Generating function: The coefficient of x 12 /12! in f(x) is 4 12 /4 = 4 11.

27 27 Solution (b) Generating function: The coefficient of x 12 /12! in f(x) is 4 12 – 3 11  12! / 11! – ½  3 10  12! /10!. #

28 28 The Summation Operator For f(x) = a 0 + a 1 x + a 2 x 2 +…, consider the function f(x)/(1-x). The coefficient of x n-1 in 1/(1-x) 3 is 1 + 2 +…+ n = C(-3,n-1)(-1) n-1 = n(n+1)/2.

29 29 The Summation Operator The coefficient of x n-1 in (1+x)/(1-x) 4 is 1 2 +2 2 +…+n 2 = C(-4,n-1)(-1) n-1 + C(-4,n-2)(-1) n-2 = n(n+1)(2n+1)/6.

30 30 Recurrence Relations (I) Solve the relation a n – 3a n-1 = n, n  1, a 0 = 1. Let

31 31 Recurrence Relations (I) a n = the coefficient of x n in f(x) = (7/4)3 n + (-1/4) + (-1/2)C(-2,n)(-1) n. #

32 32 Recurrence Relations (II) Solve the relation a n+2 – 5a n+1 + 6 a n = 2, n  0, a 0 = 3, a 1 = 7. Let #

33 33 Recurrence Relations (III) Solve the system of recurrence relations a n+1 = 2a n + b n, b n+1 = a n + b n, n  0, a 0 = 1, b 0 = 0. Let

34 34 Recurrence Relations (III)

35 35 Recurrence Relations (III) #

36 36 Nonlinear Recurrence Relations Let

37 37 Catalan Number What is the number b n of rooted ordered binary trees on n vertices. Let

38 38 Catalan Number b n = the coefficient of x n+1 in xf(x) = -C(1/2,n+1)(-4) n+1 /2 = -(-1) n [1/2][1/2][3/2][5/2]…[(2n-1)/2](-4) n+1 / [2  (n+1)!] = (2n)! / [n!(n+1)!] = 1/(n+1) C(2n,n). #

39 39 Brainstorm 現在有某個計算式,當出現 2 或 9 就用△來代替,其 他數字則用□代替,你能推算出原本的計算式嗎? □  □ □ ------------- △ □ △ △ △ △ ----------------- △ □ □ △


Download ppt "1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 6 Generating Functions."

Similar presentations


Ads by Google