Lecture 17 Generating Functions. Recap Generating functions are defined by a sequence as follows: Thus: For every sequence there a generating function.

Slides:



Advertisements
Similar presentations
4.5 Generalized Permutations and Combinations
Advertisements

Inclusion-Exclusion Rosen 6.5 & 6.6
Lecture & 6.6 Inclusion-Exclusion. 6.5 Inclusion-Exclusion A AB U It’s simply a matter of not over-counting the blue area in the intersection.
Counting Chapter 6 With Question/Answer Animations.
COUNTING AND PROBABILITY
1 Copyright M.R.K. Krishna Rao Solving Recurrence Relations Steps for solving a linear homogeneous recurrence relation of degree 2 : Step #1.
Solving Equations with the Variable on Both Sides Objectives: to solve equations with the variable on both sides.
Systems of Nonlinear Equations and Their Solutions
CSE115/ENGR160 Discrete Mathematics 04/19/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 04/17/12
CSE115/ENGR160 Discrete Mathematics 04/21/11 Ming-Hsuan Yang UC Merced 1.
Lecture 14: Oct 28 Inclusion-Exclusion Principle.
Lecture 19 Exam: Tuesday June14 4-6pm Overview. Disclaimer The following is a only study guide. You need to know all the material treated in class.
Permutations r-permutation (AKA “ordered r-selection”) An ordered arrangement of r elements of a set of n distinct elements. permutation of a set of n.
Lecture 5 Counting 4.3, Permutations r-permutation: An ordered arrangement of r elements of a set of n distinct elements. Example: S={1,2,3}:
Chapter 6.1 Generating Functions
Counting Techniques: r-combinations with
Counting II: Pascal, Binomials, and Other Tricks Great Theoretical Ideas In Computer Science A. Gupta D. Sleator CS Fall 2010 Lecture 8Sept. 16,
Lecture 19 Exam: Tuesday June15 4-6pm Overview. General Remarks Expect more questions than before that test your knowledge of the material. (rather then.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Recursion Lecture 17: Nov 11. Quiz int hello(int n) { if (n==0) return 0; else printf(“Hello World %d\n”,n); hello(n-1); } 1.What would the program do.
Solving Systems of Equations Algebraically
Solving Equations with the Variable on Both Sides
Lecture II.  Using the example from Birenens Chapter 1: Assume we are interested in the game Texas lotto (similar to Florida lotto).  In this game,
Chapter 4 Section 1 Copyright © 2011 Pearson Education, Inc.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
Advanced Counting Techniques
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Systems of Nonlinear Equations in Two Variables
Rev.S08 MAC 1140 Module 12 Introduction to Sequences, Counting, The Binomial Theorem, and Mathematical Induction.
More Counting Lecture 16: Nov 9 A B …… f. This Lecture We will study how to define mappings to count. There will be many examples shown. Bijection rule.
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
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Binomial Coefficients, Inclusion-exclusion principle
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Polynomial Functions. A Polynomial is an expression that is either a real number, a variable, or a product of real numbers and variables with whole number.
Slide 7- 1 Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
1 Chapter 7 Generating functions. 2 Summary Generating functions Recurrences and generating functions A geometry example Exponential generating functions.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Counting Subsets of a Set: Combinations Lecture 31 Section 6.4 Wed, Mar 21, 2007.
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.
CPSC 531: Probability Review1 CPSC 531:Probability & Statistics: Review Instructor: Anirban Mahanti Office: ICT Class.
4.5.2 Applications of Inclusion-Exclusion principle
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Lecture 5 Counting 4.3, Permutations r-permutation: An ordered arrangement of r elements of a set of n distinct elements. Example: S={1,2,3}:
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CS201: Data Structures and Discrete Mathematics I
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,
Matrix Algebra Section 7.2. Review of order of matrices 2 rows, 3 columns Order is determined by: (# of rows) x (# of columns)
1 Section 6.5 Inclusion/Exclusion. 2 Finding the number of elements in the union of 2 sets From set theory, we know that the number of elements in the.
Section 1Chapter 4. 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Objectives Systems of Linear Equations in Two Variables Decide whether.
4.6 Generating functions Generating functions
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
Graphing Functions.
Lecture 16 Generating Functions. Basically, generating functions are a tool to solve a wide variety of counting problems and recurrence relations, find.
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 6.4. Powers of Binomial Expressions Definition: A binomial expression is the sum of two terms, such as x + y. (More generally, these terms can.
L14: Permutations, Combinations and Some Review EECS 203: Discrete Mathematics.
Counting Subsets of a Set: Combinations Lecture 28 Section 6.4 Thu, Mar 30, 2006.
Week 9 - Friday.  What did we talk about last time?  Permutations  Counting elements in sets  Brief introduction to combinations.
Section 6.3. Section Summary Permutations Combinations.
Chapter 4 Section 1.
Solve Multi-step Equations
Solve Multi-step Equations
Presentation transcript:

Lecture 17 Generating Functions

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.

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

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

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

Application to Counting (1+x+x^2+x^3+x^4+....) x x^ = 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

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

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

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

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!

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

Some Exercises (white board)

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

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 – = 12 – = 7. area = 2-1=1 area = 1 area = 4-3=1

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.