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

Slides:



Advertisements
Similar presentations
Binomial Expansion and Maclaurin series Department of Mathematics University of Leicester.
Advertisements

Counting Chapter 6 With Question/Answer Animations.
Factoring Polynomials
( ) EXAMPLE 3 Solve ax2 + bx + c = 0 when a = 1
Solving Quadratic Equations Algebraically Lesson 2.2.
Chapter 6 Section 4: Factoring and Solving Polynomials Equations
1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.
Chapter 9 Generating functions Yen-Liang Chen Dept of Information Management National Central University.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 26, Monday, November 3.
Chapter 6.1 Generating Functions
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 24, Wednesday, October 29.
4/5/05Tucker, Sec Applied Combinatorics, 4rth Ed. Alan Tucker Section 5.4 Distributions Prepared by Jo Ellis-Monaghan.
Counting Techniques: r-combinations with
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 25, Friday, October 31.
Exponential Generating Function
Tucker, Section 5.41 Section 5.4 Distributions By Colleen Raimondi.
Bell Work: Find the values of all the unknowns: R T = R T T + T = 60 R = 3 R =
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.
Miss Battaglia AB/BC Calculus
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Copyright © Cengage Learning. All rights reserved. Quadratic Equations, Quadratic Functions, and Complex Numbers 9.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Polynomial Review What is a polynomial? An algebraic expression consisting of one or more summed terms, each term consisting of a coefficient and one or.
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
Discrete Mathematics Chapter 7 Advanced Counting Techniques 大葉大學 資訊工程系 黃鈴玲.
1 Chapter 7 Generating functions. 2 Summary Generating functions Recurrences and generating functions A geometry example Exponential generating functions.
Chapter 3 Permutations and combinations
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture.
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
4.5.2 Applications of Inclusion-Exclusion principle
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Lesson Counting Techniques. Objectives Solve counting problems using the Multiplication Rule Solve counting problems using permutations Solve counting.
1 Chapter 1 Fundamental Principles of Counting Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004.
Chapter 5 The Binomial Coefficients
Simple Arrangements & Selections. Combinations & Permutations A permutation of n distinct objects is an arrangement, or ordering, of the n objects. An.
1 Lecture 4 (part 2) Combinatorics Reading: Epp Chp 6.
4.1.2 Pigeonhole principle:Strong Form  Theorem 4.2: Let q 1,q 2,…,q n be positive integers. If q 1 +q 2 +…+q n -n+1 objects are put into n boxes, then.
Solving Quadratic Equations. Solving by Factoring.
Generating Functions and Counting Trees. Today’s Plan 1.Generating functions for basic sequences 2.Operations on generating functions 3.Counting 4.Solve.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
Example 1A Solve the equation. Check your answer. (x – 7)(x + 2) = 0
Solving Equations by Factoring (x+3)(2x-1) (3x-1)(x-2)
POLYNOMIALS 9/20/2015. STANDARD FORM OF A POLYNOMIAL ax + bx + cx … mx + k nn-1n-2 The degree is ‘n’
Discrete Mathematics Chapter 6 Advanced Counting Techniques.
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Chapter 9.
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
Copyright © Peter Cappello 2011 Simple Arrangements & Selections.
Section Basic Counting Principles: The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n 1.
1 DISCRETE STRUCTURES DISCRETE STRUCTURES SSK3003 DR. ALI MAMAT 1.
Aim: Solving Quadratic Equation by Factoring Course: Adv. Alg. & Trig Aim: How to solve quadratic equations? Do Now: I III II Rectangular Box Rectangular.
Topic VII: Polynomial Functions 7.3 Solving Polynomial Equations.
Last Answer LETTER I h(x) = 3x 4 – 8x Last Answer LETTER R Without graphing, solve this polynomial: y = x 3 – 12x x.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
UNIT 5 Fundamental principles of counting
The Pigeonhole Principle
Solving Quadratic Equations by Factoring
LESSON 2–2 Polynomial Functions.
7.3 Solving Equations Using Quadratic Techniques
Polynomials & Factoring
Modeling with Recurrence Relations
Copyright 2013, 2010, 2007, 2005, Pearson, Education, Inc.
CS100: Discrete structures
COUNTING AND PROBABILITY
Quadratic Equations and Functions
2 Chapter Chapter 2 Equations, Inequalities and Problem Solving.
Exponential Functions
ICS 253: Discrete Structures I
Presentation transcript:

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

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 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 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 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 Substitution Technique Equation: Substitute 2x for y   is the generating function for the sequence 1, 2, 2 2, 2 3, …

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 Maclaurin Expansion If the series is centered at 0, it is called a Maclaurin series.

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

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

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

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 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 Composition Functions If and h(x) = f(x)g(x), then

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) = = = (n 3 = 3) = (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 Example 6 Determine the coefficient of x 8 in  a = 1, b = -1, c = -1. The coefficient of x 8 is

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 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 = p(4) = 5: 4 = 3+1 = 2+2 = = p(5) = 7: 5 = 4+1 = 3+2 = = = = 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 Partitions of Integers (Cont.) p(n) = the coefficient of x n in f n (x). #

20 Distinct Partitions of Integers Determine the number of partitioning a positive integer n into distinct summands. p d (6) = 4: 6 = = 1+5 = 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 Odd Partitions of Integers Determine the number of partitioning a positive integer n into odd summands. p o (6) = 4: = 1+5 = = 3+3 p o (n) = the coefficient of x n in p n o (x). #

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 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 Properties

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 Solution (a) Generating function: The coefficient of x 12 /12! in f(x) is 4 12 /4 = 4 11.

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 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 …+ n = C(-3,n-1)(-1) n-1 = n(n+1)/2.

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

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

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 Recurrence Relations (II) Solve the relation a n+2 – 5a n a n = 2, n  0, a 0 = 3, a 1 = 7. Let #

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 Recurrence Relations (III)

35 Recurrence Relations (III) #

36 Nonlinear Recurrence Relations Let

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

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