Download presentation

Presentation is loading. Please wait.

Published byEthelbert Roberts Modified over 2 years ago

1
Lecture 17 Generating Functions

2
Recap Generating functions are defined by a sequence as follows: Thus: For every sequence there a generating function and for every sequence there is a generating function. Idea: Use properties of functions to solve problems about sequences.

3
Recap: Important Gen. Functions binomial coefficients adding sequences multiplying sequences

4
Recap: Extended Binomial Coeff. The binomial theorem was extended to real values for u, using the definition of extended binomial coefficients.

5
Application to Counting Problems What is the number of r-combinations from a set with n elements when repetition is allowed? I.e. in how many ways can we pick r element from a bag of n elements, when the supply of these elements in infinite (imagine we replace the elements). n colors r indistinguishable slots the balls are replaced when they have been drawn

6
Application to Counting (1+x+x^2+x^3+x^4+....) x x^3 1 1 1 1 = x^4 This is just one combination of dividing 4 balls into 6 slots. In general we can choose any combination of terms as long as the powers add up to 4. The number of r-combinations of a set with n elements with repetition is therefore equal to the coefficient in front of the term x^4 in the generating function: G(x)=(1+x+x^2+...)^n

7
r-Combinations with repetion Now let’s compute that coefficient: Looks familiar ?

8
r-combinations without repetition the balls are not replaced when they have been drawn X X X X r indistinguishable slots n colors (1+x) A ball can only be used once, thus it is there or it is not there in the collection of slots. x x x x 1 1 = x^4 The number of r-combinations of a set with n elements without repetition is therefore equal to the coefficient in front of the generating function G(x)=(1+x)^n

9
r-combinations without repetition So let’s compute that coefficient: Looks familiar? binomial theorem

10
Counting with constraints Now let’s say, we want to make sure that we pick r elements out of n with repetition allowed, but we want at least 1 element from each kind: G(x) = (x+x^2+x^3+...)^n We are looking for the coefficient of x^r. Here we used the calculation of a few slides back. Here we redefined: j=n+k Note that choosing less than n objects is not possible!

11
Solving Recurrence Relations therefore we have found that a[k]=2x3^k is the solution!

12
Some Exercises (white board)

13
6.5 Inclusion-Exclusion A AB U It’s simply a matter of not over-counting the blue area in the intersection.

14
Now three Sets A B C U Image a blue circle has area 4. The intersections between 2 circles have area 2 and the intersection between three circles 1. What is the total area covered? A=4+4+4 – 2 -2 -2 + 1 = 12 – 6 + 1 = 7. area = 2-1=1 area = 1 area = 4-3=1

15
General Case Proof: We show that each element is counted exactly once. Assume element ‘a’ is in r sets out of the n sets A1,...,An. -The first term counts ‘a’ r-times=C(r,1). -The second term counts ‘a’ -C(r,2) times (there are C(r,2) pairs in a set of r elements). -The k’th term counts ‘a’ -C(r,k) times (there are C(r,k) k-subsets in a set of r elements). -... - If k=r then there are precisely (-1)^(r+1) C(r,r) terms. - For k>r ‘a’ is not in the intersection: it is counted 0 times. Total: C(r,1)-C(r,2)+...+(-1)^(r+1)C(r,r) Now use: to show that each element is counted exactly once.

Similar presentations

Presentation is loading. Please wait....

OK

Binomial Coefficients, Inclusion-exclusion principle

Binomial Coefficients, Inclusion-exclusion principle

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google