Chapter 9 Generating functions Yen-Liang Chen Dept of Information Management National Central University.

Slides:



Advertisements
Similar presentations
Counting Chapter 6 With Question/Answer Animations.
Advertisements

DISCRETE RANDOM VARIABLES AND PROBABILITY DISTRIBUTIONS
Chapter 13 sec. 3.  Def.  Is an ordering of distinct objects in a straight line. If we select r different objects from a set of n objects and arrange.
Counting and Probability The outcome of a random process is sure to occur, but impossible to predict. Examples: fair coin tossing, rolling a pair of dice,
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
Discrete Structures Chapter 5 Pigeonhole Principle Nurul Amelina Nasharuddin Multimedia Department.
Chapter 6.1 Generating Functions
Sections 4.1, 4.2, 4.3 Important Definitions in the Text:
4/5/05Tucker, Sec Applied Combinatorics, 4rth Ed. Alan Tucker Section 5.4 Distributions Prepared by Jo Ellis-Monaghan.
Arrangements & Selections with Repetition
Counting Techniques: r-combinations with
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 25, Friday, October 31.
Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management National Central University.
Tucker, Section 5.41 Section 5.4 Distributions By Colleen Raimondi.
INTRODUCTORY MATHEMATICAL ANALYSIS For Business, Economics, and the Life and Social Sciences  2007 Pearson Education Asia Chapter 8 Introduction to Probability.
Generating Function October 21, 2014 Generating Functions Given an infinite sequence, its ordinary generating function is the power series: ‏G(x) = g.
College Algebra Fifth Edition
Chapter 1 Fundamental principles of counting 陳彥良 中央大學資管系.
4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is.
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.
Chapter 6 The Inclusion-Exclusion Principle and Applications
Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics.
Generalized Permutations and Combinations
4.6.2 Exponential generating functions
Permutations and Combinations
9.3 Addition Rule. The basic rule underlying the calculation of the number of elements in a union or difference or intersection is the addition rule.
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
1 Chapter 7 Generating functions. 2 Summary Generating functions Recurrences and generating functions A geometry example Exponential generating functions.
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 6 Generating Functions.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
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.
Chapter 5 The Binomial Coefficients
The Basics of Counting Section 6.1.
Section Section Summary The Product Rule The Sum Rule The Subtraction Rule The Division Rule Examples, Examples, and Examples Tree Diagrams.
Expectation. Let X denote a discrete random variable with probability function p(x) (probability density function f(x) if X is continuous) then the expected.
ICS 253: Discrete Structures I Discrete Probability King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Discrete Mathematics Lecture # 25 Permutation & Combination.
Counting.
4.6 Generating functions Generating functions
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Chapter 4. Discrete Probability Distributions Sections 4.9, 4.10: Moment Generating Function and Probability.
Section 1.3 Each arrangement (ordering) of n distinguishable objects is called a permutation, and the number of permutations of n distinguishable objects.
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.
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.
3/7/20161 Now it’s time to look at… Discrete Probability.
CS 104: Discrete Mathematics
Distributions. Basic Model for Distributions of Distinct Objects The following problems are equivalent: Distributing n distinct objects into b distinct.
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
1 DISCRETE STRUCTURES DISCRETE STRUCTURES SSK3003 DR. ALI MAMAT 1.
Chapter 6 With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
Section 6.3. Section Summary Permutations Combinations.
Example A standard deck of 52 cards has 13 kinds of cards, with four cards of each of kind, one in each of the four suits, hearts, diamonds, spades, and.
UNIT 5 Fundamental principles of counting
The Pigeonhole Principle
Chapter 5, Section 5.1 The Basics of Counting
Generalized Permutations and Combinations
COCS DISCRETE STRUCTURES
Permutations 7.2 Chapter 7 Combinatorics 7.2.1
Counting Chapter 6 With Question/Answer Animations
CS100: Discrete structures
Arrangements & Selections with Repetition
8.3 Counting Apply the fundamental counting principle
Arrangements & Selections with Repetition
COUNTING AND PROBABILITY
5.6 Finding Rational Zeros Algebra II
Presentation transcript:

Chapter 9 Generating functions Yen-Liang Chen Dept of Information Management National Central University

9.1. Introductory examples  Ex oranges for three children, Grace, Mary, and Frank. Grace gets at least four, and Mary and Frank gets at least two, but Frank gets no more than five. (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 ) The coefficient of x 12 is the solution.

Ex 9.2  Four kinds of jelly beans, Red, Green, White, Black  In how many ways can we select 24 jelly beans so that we have an even number of white beans and at least six black ones? Red (green): 1+ x 1 + x 2 + ….+ x 23 + x 24 White: 1+ x 2 + x 4 + ….+ x 22 + x 24 Black: x 6 + x 7 + ….+ x 23 + x 24  f(x)=(1+ x 1 + x 2 + ….+ x 23 + x 24 )(1+ x 2 + x 4 + ….+ x 22 + x 24 )(x 6 + x 7 + ….+ x 23 + x 24 )  The coefficient of x 24 is the solution.

Ex 9.3.  How many nonnegative integer solutions are there for c 1 +c 2 +c 3 +c 4 =25?  f(x)=(1+ x 1 + x 2 + ….+ x 24 + x 25 ) 4  The coefficient of x 25 is the solution.

9.2. Definition and examples: calculational techniques  Ex 9.4. (1+x) n is the generating function for the sequence C(n, 0), C(n, 1),…, C(n, n), 0,0,0…

Ex 9.5  (1-x n+1 )/(1-x) is the generating function for the sequence 1,1,1, …,1, 0, 0,0 …, where the first n+1 terms are 1.  1/(1-x) is the generating function for the sequence 1,1,1, …,1, ….  1/(1-x) 2 is the generating function for the sequence 1,2,3,4, ….  x/(1-x) 2 is the generating function for the sequence 0,1,2,3, ….  (x+1)/(1-x) 3 is the generating function for the sequence 1 2,2 2,3 2,4 2, ….  x(x+1)/(1-x) 3 is the generating function for the sequence 0 2,1 2,2 2,3 2,4 2, ….

Ex 9.6  1/(1-ax) is the generating function for the sequence a 0,a 1,a 2,a 3, ….  Let f(x)=1/(1-x). Then g(x)=f(x)-x 2 is the generating function for the sequence 1,1,0, 1, 1, …, ….  Let a i =i 2 +i for i  0. Then its generating function is [x(x+1)/(1-x) 3 ]+[x/(1-x) 2 ]=2x/(1- x) 3

Define C(n, r) for n  R  Since when n  Z +, we have  So for n  R we define  For example, if n is positive, we have

Tayor ’ s and Maclaurin ’ s Series  f(x)=f(c)+ (x-c) f(c) +(x-c) 2 f“(c)/2!+ (x- c) 3 f (3) (c)/3! + (x-c) 4 f (4) (c)/4! +..+ (x-c) n f (n) (c)/n!  Let c=0. Then we have f(x)=f(0)+ (x) f(0) +(x) 2 f“(0)/2!+ (x) 3 f (3) (0)/3! + (x) 4 f (4) (0)/4! +..+ (x) n f (n) (0)/n!

Ex 9.7

Ex 9.9

Ex  Determine the coefficient of x 15 in f(x)=(x 2 +x 3 +x 4 + … ) 4.  (x 2 +x 3 +x 4 + … )=x 2 (1+x+x 2 + … )=x 2 /(1-x)  f(x)=(x 2 /(1-x)) 4 =x 8 /(1-x) 4  Hence the solution is the coefficient of x 7 in (1-x) -4, which is C(-4, 7)(-1) 7 =C(10, 7).

Ex 9.11  In how many ways can we select, with repetition allowed, r objects from n distinct objects?  Consider f(x)=(1+x+x 2 + … ) n (1/(1-x)) n =1/(1-x) n The coefficient of x r is C(n+r-1, r)  The answer is the coefficient of x r in f(x).

Ex 9.12  x/(1-x)= x 1 + x 2 +x 3 +x 4 + ….  The coefficient of x j in (x 1 +x 2 +x 3 +x 4 + ….) i is the number of ways that we form the integer j by i summands.  The number of ways to form an integer n is the coefficient of x n in the following generating function.

Ex  In how many ways can a police captain distribute 24 rifle shells to four police officers, so that each officer gets at least three shells but not more than eight.  f(x)= (x 3 +x 4 + x 5 + x 6 +x 7 +x 8 ) 4 =x 12 (1+x+x 2 +x 3 +x 4 +x 5 ) 4 =x 12 [(1-x 6 )/(1-x)] 4  the answer is the coefficient of x 12 in (1-x 6 ) 4 (1-x) -4

Ex  How many four element subsets of S={1, 2, …, 15} contains no consecutive integers?  {1, 3, 7, 10}  0, 2, 4, 3, 5  there exists a one-to-one correspondence between the four-element subsets to be counted and the integer solutions to c 1 +c 2 +c 3 +c 4 +c 5 =14 where 0  c 1, c 5 and 2  c 2, c 3, c 4.  The answer is the coefficient of x 14 in the following formula f(x)=(1+x+x 2 +x 3 + … )(x 2 +x 3 +x 4 + … ) 3 (1+x+x 2 +x 3 + … )=x 6 (1-x) -5

Ex  {1, 3, 7, 10}  0, 1, 3, 2, 5  there exists a one-to-one correspondence between the four-element subsets to be counted and the integer solutions to c 1 +c 2 +c 3 +c 4 +c 5 =11 where 0  c 1, c 5 and 1  c 2, c 3, c 4.  The answer is the coefficient of x 14 in the following formula  f(x)=(1+x+x 2 +x 3 + … )(x+x 2 +x 3 +x 4 + … ) 3 (1+x+x 2 +x 3 + … )=x 3 (1-x) -5

Ex  Brianna takes an examination until she passes it. Suppose in each test the probability of failure is 0.8, and of success is 0.2.  Let Y denote the number of times Brianna expects to take the exam before she passes it.  Please compute E(Y) and E(Y 2 ).

compute E(Y)

compute E(Y 2 ).

the convolution of sequences  Ex Let f(x)=x/(1-x) 2 =0+1x+2x 2 +3x 3 + …, where a i =i  g(x)=x(x+1)/(1-x) 3 =0+1 2 x+2 2 x x 3 + …, where b i =i 2  h(x)=f(x)g(x)=c 0 +c 1 x+c 2 x 2 +c 3 x 3 + …  c k =a 0 b k +a 1 b k-1 +a 2 b k-2 + … +a k-2 b 2 +a k-1 b 1 +a k b 0  c k =the sequence c is the convolution of sequences a and b

9.3. Partition of integers  p(x) is the number of partitions for x.  For n, the number of 1 ’ s is 0 or 1 or 2 or 3 …. The power series is 1+x+x 2 +x 3 +x 4 + ….  For n, the number of 2 ’ s can be kept tracked by the power series 1+x 2 +x 4 +x 6 +x 8 + ….  For n, the number of 3 ’ s can be kept tracked by the power series 1+x 3 +x 6 +x 9 +x 12 + ….  f(x)=(1+x+x 2 +x 3 +x 4 + … )(1+x 2 +x 4 +x 6 +x 8 +x 10 + … ) (1+x 3 +x 6 +x 9 + … ) … (1+x 10 + … ) =1/(1-x)  1/(1-x 2 )  1/(1-x 3 )  …  1/(1-x 10 )  At last, we have the following series for p(n) by the coefficient of x n

Ex 9.21  Find the number of ways an advertising agent can purchase n minutes if the time slots come in blocks of 30, 60, 120 seconds.  Let 30 seconds represent one time unit.  a+2b+4c=2n  f(x)= (1+x+x 2 +x 3 +x 4 + … ) (1+x 2 +x 4 +x 6 +x 8 + … )( 1+x 4 +x 8 +x 12 + … ) =1/(1-x)  1/(1-x 2 )  1/(1-x 4 ).  The coefficient of x 2n is the answer to the problem.

Examples  Ex p d (n) is the number of partitions of a positive integer n into distinct summands. P d (x)=(1+x)(1+x 2 )(1+x 3 ).. …  Ex p o (n) is the number of partitions of a positive integer n into odd summands. P o (x)= (1+x+x 2 +x 3 +x 4 + … ) (1+x 3 +x 6 +x 9 +x 12 + … )( 1+x 5 +x 10 +x 15 + … ) … P o (x)=1/(1-x)  1/(1-x 3 )  1/(1-x 5 )  1/(1-x 7 ) ... P d (x)= P o (x)

Ex  p oo (n) is the number of partitions of a positive integer n into odd summands and such summands must occur an odd number of times.  P oo (x)= (1+x+x 3 +x 5 +x 7 + … ) (1+x 3 +x 9 +x 15 + … )( 1+x 5 +x 15 +x 25 + … ) …

9.4. The exponential generating function

Ex 9.26  In how many ways can four of the letters in ENGINE be arranged?  f(x)=[1+x+(x 2 /2!)] 2 [1+x] 2, and the answer is the coefficient of x 4 /4!.

important series

Ex  We have 48 flags, 12 each of the colors red, white, blue and black. Twelve flags are placed on a vertical pole to show signal.  How many of these use an even number of blue flags and an odd number of black flags? l

Ex 9.28  how many of these use at least three white flags or no white flag at all?

Ex  A company hires 11 new employees, and they will be assigned to four different departments, A, B, C, D. Each department has at least one new employee. In how many ways can these assignments be done?

9.5. The summation operator  Let f(x)=a 0 +a 1 x+a 2 x 2 +a 3 x 3 + …. Then f(x)/(1-x) generate the sequence of a 0, a 0 +a 1, a 0 +a 1 +a 2, a 0 +a 1 +a 2 +a 3, … So we refer to 1/(1-x) as the summation operator.

Ex  1/(1-x) is the generating function for the sequence 1, 1, 1, 1, 1, …  [1/(1-x)]  [1/(1-x)] is the generating function for the sequence 1,2,3,4,5, …  x+x 2 is the generating function for the sequence 0, 1, 1, 0, 0, 0, …  (x+x 2 ) /(1-x) is the generating function for the sequence 0, 1, 2, 2, 2, 2, …  (x+x 2 ) /(1-x) 2 is the generating function for the sequence 0, 1, 3, 5, 7, 9, 11, …  (x+x 2 ) /(1-x) 3 is the generating function for the sequence 0, 1, 4, 9, 16, 25, 36, …

Ex  g(x)= 1/(1-x)=1+x+x 2 +x 3 +x 4 + …  q(x)=dg(x)/dx=1/(1-x) 2 =1+2x+3x 2 +4x 3 +. …  r(x)=xq(x)=x/(1-x) 2 = x+2x 2 +3x 3 +4x 4 +. …  xdr(x)/dx=(1+x)/(1-x) 3 = x+2 2 x x x 4 +.  x(1+x)/(1-x) 4 = x+( )x 2 +( )x 3 +( )x 4 +. …