1 Chapter 7 Generating functions. 2 Summary Generating functions Recurrences and generating functions A geometry example Exponential generating functions.

Slides:



Advertisements
Similar presentations
Section 6.2 Calculating Coefficients Of Generating Functions
Advertisements

Counting Chapter 6 With Question/Answer Animations.
Lecture 17 Generating Functions. Recap Generating functions are defined by a sequence as follows: Thus: For every sequence there a generating function.
CN College Algebra Ch. 11: Sequences 11.3: Geometric Sequences Goals: Determine if a sequence is geometric. Find a formula for a geometric sequence. Find.
A second order ordinary differential equation has the general form
Chapter 9 Generating functions Yen-Liang Chen Dept of Information Management National Central University.
Ch 5.1: Review of Power Series
Ch 2.1: Linear Equations; Method of Integrating Factors
10.1 Gaussian Elimination Method
Linear Systems The definition of a linear equation given in Chapter 1 can be extended to more variables; any equation of the form for real numbers.
LINEAR EQUATION IN TWO VARIABLES. System of equations or simultaneous equations – System of equations or simultaneous equations – A pair of linear equations.
Linear Algebra - Chapter 1 [YR2005]
Generating Function October 21, 2014 Generating Functions Given an infinite sequence, its ordinary generating function is the power series: ‏G(x) = g.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
Systems and Matrices (Chapter5)
Systems of Linear Equation and Matrices
7.4 Generating Functions Definition 1: The generation function for the sequence a 0, a 1,...,a k,... of real numbers is the infinite series G(x) = a 0.
ME 1202: Linear Algebra & Ordinary Differential Equations (ODEs)
Chapter 5 Rational Expressions Algebra II Notes Mr. Heil.
Chapter 6 The Inclusion-Exclusion Principle and Applications
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Mathematics. Session 1 Exponential Series & Logarithmic Series.
4.6.2 Exponential generating functions
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Chapter 3 Permutations and combinations
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 5 Systems and Matrices Copyright © 2013, 2009, 2005 Pearson Education, Inc.
1 C ollege A lgebra Systems and Matrices (Chapter5) 1.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
Polynomials P4.
4.5.2 Applications of Inclusion-Exclusion principle
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
7.2-3 Solving Linear Equations. A linear equation in one variable is an equation in which the same letter is used in all variable terms and the exponent.
Chapter 5 The Binomial Coefficients
Boyce/DiPrima 9 th ed, Ch 5.1: Review of Power Series Elementary Differential Equations and Boundary Value Problems, 9 th edition, by William E. Boyce.
Chapter 5 Eigenvalues and Eigenvectors 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Infinite Sequences and Series 8. Taylor and Maclaurin Series 8.7.
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
Boyce/DiPrima 9th ed, Ch 4.1: Higher Order Linear ODEs: General Theory Elementary Differential Equations and Boundary Value Problems, 9th edition, by.
Generating Functions and Counting Trees. Today’s Plan 1.Generating functions for basic sequences 2.Operations on generating functions 3.Counting 4.Solve.
Copyright © 2011 Pearson Education, Inc. Solving Linear Systems Using Matrices Section 6.1 Matrices and Determinants.
3-2 Solving Linear Systems Algebraically Objective: CA 2.0: Students solve system of linear equations in two variables algebraically.
7.2 Solving Linear Recurrence Relations Some of these recurrence relations can be solved using iteration or some other ad hoc technique. However, one important.
Recurrence Relations. Outline Recurrence relationsSolving recurrence relationsRecurrence and Divide-and-conquer algorithmsGenerating functions
Advanced Engineering Mathematics, 7 th Edition Peter V. O’Neil © 2012 Cengage Learning Engineering. All Rights Reserved. CHAPTER 4 Series Solutions.
4.6 Generating functions Generating functions
Sullivan Algebra and Trigonometry: Section 1.1 Objectives of this Section Solve an Equation in One Variable Solve a Linear Equation Solve Equations That.
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
1 Chapter 2 Pigeonhole Principle. 2 Summary Pigeonhole principle –simple form Pigeonhole principle –strong form Ramsey’s theorem.
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Chapter 9.
Binomial Coefficients and Identities
Chapter R Section 7: Radical Notation and Rational Exponents
CMSC Discrete Structures
Copyright © Cengage Learning. All rights reserved.
Linear Equations in One Variable
A second order ordinary differential equation has the general form
Chapter 5 Series Solutions of Linear Differential Equations.
Copyright © Cengage Learning. All rights reserved.
CMSC Discrete Structures
College Algebra Chapter 6 Matrices and Determinants and Applications
2.Derangements A derangement of {1,2,…,n} is a permutation i1i2…in of {1,2,…,n} in which no integer is in its natural position: i11,i22,…,inn. We denote.
CMSC Discrete Structures
2 Equations, Inequalities, and Applications.
Recurrence Relations Discrete Structures.
One step equations Chapter 2 Section 2.1.
Solving 1 and 2 Step Equations
Solving Systems of Linear Equations by Elimination
Presentation transcript:

1 Chapter 7 Generating functions

2 Summary Generating functions Recurrences and generating functions A geometry example Exponential generating functions Assignments

3 Generating functions

4 What generating functions do? Count the number of possibilities for a problem by means of algebra Generating functions are Taylor series of infinitely differentiable functions If we can find the function and its Taylor series, then the coefficients of the Taylor series give the solution to the problem.

5 Definition of generating functions Let h 0, h 1, …, h n, …… be an infinite sequence of numbers. Its generating function is defined to be the infinite series g(x) = h 10 + h 1 x + h 2 x 2 +…+ h n x n +…… The coefficient of x n in g(x) is the nth term h n of the sequence, and thus x n acts as a “place holder” for h n.

6 Examples 1. The generating function of the infinite sequence 1, 1, 1, …, 1, …, each of whose terms equals 1 is g(x) = 1 +x+x 2 +…+x n +… = 1/(1-x) 2. Let m be a positive integer. The generating function for the binomial coefficients c(m,0), c(m,1) c(m, 2),…., c(m,m) is g m (x) = c(m,0) +c(m,1)x +c(m,2)x 2 +…+c(m,m)x m = (1+x) m (by the binomial theorem).

7 Exercises Let a be real number. By Newton’s binomial theorem, what is the generating function for the infinite sequence of binomial coefficients c(a, 0), c(a, 1),…c(a, n),…? Let k be an integer and let the sequence h 0, h 1, h 2,…, h n, …be defined by letting h n equals the number of non-negative integral solution of e 1 +e 2 +…e k =n. What is the generating function for this sequence?

8 More examples For what sequence is (1+x+x 2 +x 3 +x 4 +x 5 )(1+x+x 2 )(1+x+x 2 +x 3 +x 4 ) the generating function? Let x e1 (0≤e 1 ≤5), x e2, (0≤e 2 ≤2), and x e3 (0≤e 3 ≤4) denote the typical terms in the first, second and third factors, respectively. Multiplying we obtain x e1 x e2 x e3 = x n, provided e 1 +e 2 +e 3 = n. Thus the coefficient of x n in the product is the number of h n of integral solutions of e 1 +e 2 +e 3 = n in which 0 ≤e 1 ≤5, 0≤e 2 ≤2 and 0≤e 3 ≤4. (note that h n = 0 for n>11)

9 More examples (cont’d) Determine the generating function for the number of n- combinations of apples, bananas, oragnes, and pears where in each n-combination the number of apples is even, the number of bananas is odd, the number of oranges is between 0 and 4 and the there is at least one pear. Hints: the problem is equivalent to finding the number h n of non-negative integral solutions of e 1 + e 2 + e 3 + e 4 = n.

10 where e 1 is even (e 1 counts the number of apples), e 2 is odd, 0 ≤e 3 ≤4, and e 4 ≥1. We create one factor for each type of fruit where the exponents are the allowable number’s in the n-combinations for that type of fruit: g(x) = (1 + x 2 + x 4 +…)(x + x 3 + x 5 +…)(1 + x + x 2 + x 3 + x 4 ) (x + x 2 + x 3 + x 4 +…)

11 Exercises Determine the number h n of bags of fruit that can be made out of apples, bananas, oranges, and pears where in each bag the number of apples is even, the number of bananas is a multiple of 5, the number of oranges is at most 4 and the number of pears is 0 or 1. Hints: This is to calculate the coefficient of x n for the generating functions of this problem.

12 Exercises (cont’d) Determine the generating function for the number h n of solutions of the equation e 1 + e 2 + … + e k = n in non-negative odd integers e 1, e 2, …, e k.

13 Exercises (cont’d) Let h n denote the number of non-nagative integral solutions of the equation 3e 1 + 4e 2 + 2e 3 + 5e 4 = n. Find the generating function g(x) for h 0, h 1, h 2, …, h n,……. Hints: change the variable by let f 1 = 3e 1, f 2 = 4e 2, f 3 = 2e 3 and f 4 =5e 4. Then h n also equals the number of non-negative integral solutions of f 1 + f 2 + f 3 + f 4 = n where f 1 is a multiple of 3, f 2 is a multiple of 4, f 3 is even and f 4 is a multiple of 5. CONTINUE BY YOURSELF.

14 Recurrences and generating functions

15 What will be done? Use generating functions to solve linear homogeneous recurrence relations with constant coefficients. Newton’s binomial theorem will be applied.

16 Review: Newton’s binomial theorem If n is a positive integer and r is a non-zero real number, then

17 Examples Determine the generating function for the sequence of squares 0, 1, 4, …, n 2,….. Solution: by the above Newton’s binomial theorem with n =2 and r =1, (1-x) -2 = 1+2x+3x 2 +…+nx n-1 +…. Hence x/(1-x) 2 =x+2x 2 + 3x 3 +…+nx n +….. Differentiating, we obtain ( 1+x)/(1-x) 3 =1+2 2 x+3 2 x 2 +…+n 2 x n-1 +….. Multiplying by x, we obtain the desired generating function x(1+x)/(1-x) 3.

18 Examples (cont’d) Solve the recurrence relation h n = 5h n-1 – 6 h n-2, (n≥2) subject to the initial values h 0 = 1 and h 1 = -2. Hints: let g(x) = h 0 +h 1 x+h 2 x 2 +…+h n x n +…. be the generating function for h 0, h 1, h 2, …, h n … we then have the following equations

19 g(x) = h 0 +h 1 x+h 2 x 2 +…+h n x n +…. -5xg(x) = -5h 0 x -5h 1 x 2 - 5h 2 x 3 -…- 5h n-1 x n - …. 6x 2 g(x) = 6h 0 x 2 +6h 1 x 3 +6h 2 x 4 +…+6h n-2 x n +…. Adding these three equations, we obtain (1-5x+6x 2 )g(x) = h 0 +(h 1 -5h 0 )x+(h 2 - 5h 1 +6h 0 )x 2 +…+(h n -5h n-1 +6h n-2 )x n +…. = h 0 +(h 1 -5h 0 )x = 1-7x (by assumptions) Hence, g(x) = (1-7x)/(1-5x+6x 2 ) = 5/(1-2x) – 4/(1-3x)

20 By Newton’s binomial theorem (1-2x) -1 = 1+2x+2 2 x 2 +…+2 n x n ….. (1-3x) -1 = 1+3x+3 2 x 2 +…+3 n x n ….. Therefore, g(x) = 1 + (-2)x + (-15)x 2 +…+ (5×2 n – 4×3 n )x n +… and we obtain h n = 5×2 n – 4×3 n (n = 0, 1, 2, …).

21 Exercise Solve the recurrence relation h n + h n-1 – 16 h n-2 +20h n-1 = 0 (n≥3) subject to the initial values h 0 = 0, h 1 = 1 and h 2 = -1.

22 A geometry example

23 Ways to dividing a convex polygonal region Let h n denote the number of ways of dividing a convex polygonal region with n+1 sides into triangular regions by inserting diagonals which do not intersect in the interior. Define h 1 =1. Then h n satisfies the recurrence relation h n = h 1 h n-1 +h 2 h n-2 +…+h n-1 h 1, (n≥2). The solution of this recurrence relation is h n = n -1 C(2n-2, n-1), (n=1, 2, 3, …).

24 Exponential generating functions

25 Review: Taylor’s series for e x

26 Definition of exponential generating functions The exponential generating function for the sequence h 0, h 1, h 2, …, h n, … is defined to be

27 Examples Let n be a positive integer. Determine the exponential generating function for the sequence of numbers P(n, 0), P(n, 1), P(n, 2), …, P(n, n), where P(n, k) denote the number of k-permutations of an n- element set, and thus has the value n!/(n- k)! For k = 0, 1, …, n. The exponential generating function is

28 Thus (1+x) n is both the exponential generating function for the sequence P(n, 0), P(n, 1), P(n, 2), …, P(n, n) and, as we have seen in previous section, the ordinary generating function for the sequence C(n, 0), C(n, 1), C(n, 2), …, C(n, n).

29 Examples (cont’d) The exponential generating function for the sequence 1, 1, 1, …, 1, …. is More generally, if a is any real number, the exponential generating function for the sequence a 0 = 1, a, a 2, …, a n, …. is

30 A theorem Let S be the multiset {n 1 {a 1 }, n 2 {a 2 },…, n k {a k }} where n 1, n 2, …, n k are non-negative integers. Let h n be the number of n-permutations of S. Then the exponential generating function g (e) (x) for the sequence h 0, h 1, h 2,…,h n,… is given by g (e) (x)= f n1 (x) f n2 (x) …. f nk (x) where for i=1, 2, …, k, f nk (x) = 1 +x+x 2 /2!+…+x ni /n i !.

31 Examples Determine the number of ways to color the squares of a 1-by-n chessboard, usign the colors red, white, and blue, if an even number of squares are to be colored red. Hints: Let h n denote the number of such colorings where we define h 0 =1. Then h n equals tgeh number of n-permutations of a multiset of three colors, each with an infinite repetition number, in which red occurs an even number of times. Thus the exponential generating function for h 0, h 1, h 2,…h n,… is the product of red, white and blue factors:

32 Hence, h n = (3 n +1)/2.

33 Exercises Determine the number h n of n digit numbers with each digit odd where the digits 1 and 3 occur an even number of times. Hints: let h 0 =1. the number h n equals the number of n-permutations of the multiset S = {∞1, ∞3, ∞5, ∞7, ∞9}, in which 1 and 3 occur an even number of times. ……..

34 Exercises (cont’d) Determine the number of ways to color the squares of a 1-by-n chessboard, usign the colors red, white, and blue, if an even number of squares are to be colored red and there is at least one blue square.

35 Assignments EX 23(d), 25(c), 27, 29, 30, 37(c), 38.