Lecture 11 April 24. We first prove the case n = 1. Since

Similar documents
Recurrence Relations

September 2012 C1 Note. C1 Notes (Edexcel) Copyright - For AS, A2 notes and IGCSE / GCSE worksheets 1

Math 155 (Lecture 3)

(ii) Two-permutations of {a, b, c}. Answer. (B) P (3, 3) = 3! (C) 3! = 6, and there are 6 items in (A). ... Answer.

Infinite Sequences and Series

Let us consider the following problem to warm up towards a more general statement.

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Solutions to Final Exam

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

subcaptionfont+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0 subcaption ALGEBRAIC COMBINATORICS LECTURE 8 TUESDAY, 2/16/2016

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

INTEGRATION BY PARTS (TABLE METHOD)

1 Generating functions for balls in boxes

4.3 Growth Rates of Solutions to Recurrences

6.3 Testing Series With Positive Terms

Bertrand s Postulate

SNAP Centre Workshop. Basic Algebraic Manipulation

In algebra one spends much time finding common denominators and thus simplifying rational expressions. For example:

Math 475, Problem Set #12: Answers

CSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture)

Lecture 6 April 10. We now give two identities which are useful for simplifying sums of binomial coefficients.

CS / MCS 401 Homework 3 grader solutions

MT5821 Advanced Combinatorics

Zeros of Polynomials

FLOOR AND ROOF FUNCTION ANALOGS OF THE BELL NUMBERS. H. W. Gould Department of Mathematics, West Virginia University, Morgantown, WV 26506, USA

MT5821 Advanced Combinatorics

Math 172 Spring 2010 Haiman Notes on ordinary generating functions

1. By using truth tables prove that, for all statements P and Q, the statement

3.2 Properties of Division 3.3 Zeros of Polynomials 3.4 Complex and Rational Zeros of Polynomials

USA Mathematical Talent Search Round 3 Solutions Year 27 Academic Year

Properties and Tests of Zeros of Polynomial Functions

8. Applications To Linear Differential Equations

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

APPENDIX F Complex Numbers

LESSON 2: SIMPLIFYING RADICALS

Complex Numbers Solutions

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense,

Section 5.1 The Basics of Counting

CHAPTER I: Vector Spaces

Linear Differential Equations of Higher Order Basic Theory: Initial-Value Problems d y d y dy

Ma 530 Infinite Series I

COS 341 Discrete Mathematics. Exponential Generating Functions and Recurrence Relations

The Binomial Theorem

Lecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) =

Seunghee Ye Ma 8: Week 5 Oct 28

Notes on iteration and Newton s method. Iteration

Enumerative & Asymptotic Combinatorics

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

Chapter 7 COMBINATIONS AND PERMUTATIONS. where we have the specific formula for the binomial coefficients:

18th Bay Area Mathematical Olympiad. Problems and Solutions. February 23, 2016

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n

( ) GENERATING FUNCTIONS

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is

Chapter 6. Advanced Counting Techniques

Some Basic Counting Techniques

SOLUTIONS TO PRISM PROBLEMS Junior Level 2014

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

The Random Walk For Dummies

Algebra II Notes Unit Seven: Powers, Roots, and Radicals

CALCULUS BASIC SUMMER REVIEW

U8L1: Sec Equations of Lines in R 2

Solutions. tan 2 θ(tan 2 θ + 1) = cot6 θ,

Week 5-6: The Binomial Coefficients

Discrete Mathematics Recurrences

Combinatorics. Stephan Wagner

Section 1.1. Calculus: Areas And Tangents. Difference Equations to Differential Equations

SEQUENCE AND SERIES NCERT

SEQUENCES AND SERIES

Combinatorially Thinking

David Vella, Skidmore College.

The Growth of Functions. Theoretical Supplement

Chapter 4. Fourier Series

Sail into Summer with Math!

Math 61CM - Solutions to homework 3

Exponents. Learning Objectives. Pre-Activity

Math F215: Induction April 7, 2013

Linear Regression Demystified

Polynomials with Rational Roots that Differ by a Non-zero Constant. Generalities

x x x Using a second Taylor polynomial with remainder, find the best constant C so that for x 0,

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

Summary: Congruences. j=1. 1 Here we use the Mathematica syntax for the function. In Maple worksheets, the function

2.4 - Sequences and Series

Lecture 3: Catalan Numbers

1. n! = n. tion. For example, (n+1)! working with factorials. = (n+1) n (n 1) 2 1

4 The Sperner property.

Random Models. Tusheng Zhang. February 14, 2013

2 Geometric interpretation of complex numbers

Summer High School 2009 Aaron Bertram

CALCULATION OF FIBONACCI VECTORS

Z ß cos x + si x R du We start with the substitutio u = si(x), so du = cos(x). The itegral becomes but +u we should chage the limits to go with the ew

Topic 1 2: Sequences and Series. A sequence is an ordered list of numbers, e.g. 1, 2, 4, 8, 16, or

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

Lecture Notes for CS 313H, Fall 2011

Section 6.4: Series. Section 6.4 Series 413

CHAPTER 10 INFINITE SEQUENCES AND SERIES

GENERATING FUNCTIONS AND RANDOM WALKS

Sequences. Notation. Convergence of a Sequence

Transcription:

Lecture April 4 It frequetly happes that we wat to prove a statemet is true for =,, For istace o the first day we saw that + + = ( +, for We gave a proof for this usig a method of coutig a set of dots i two differet ways However we could prove it i aother way First let us prove it for = Sice = ( + /, the case = is true Now let us assume that the statemet is true for (ie, we ca assume it is true + + + = ( + ad cosider the case + We have ( + + + + +( + = + ( + }{{} case for ( = ( + + = ( + ( + This shows that the case + is also true Betwee these two statemets this shows it is true for =,, 3, (Ie, we have show it is true for =, the by the secod part sice it is true for = it is true for =, the agai by the secod part sice it is true for = it is true for = 3, This is a eample of mathematical iductio which is a useful method of provig statemets for =,, (though we do t have to start at we ca start at ay value I geeral we eed to prove two parts: The statemet holds i the first case Assumig the statemet holds for the cases, show that the statemet also hold for + (This is what is ow as strog iductio Usually it will suffice for us to oly assume the previous case, ie, assume the case = is true ad the show + also holds (which is ow as wea iductio The idea behid proof by iductio is aalogous to the idea of climbig a ladder We first eed to get o the ladder (prove the first case, ad the we eed to be able to move from oe rug of the ladder to the et (show that if oe case is true the the et case is true It is importat that you remember to prove the first case! The most importat thig about a iductio proof is to see how to relate the previous case(s to the curret case Ofte oce that is uderstood the rest of the proof is very straightforward Eample: Prove for, + 3 + + ( ( + = ( Solutio: We first prove the case = Sice ( + = = (, the first case holds Now we assume the case correspodig to is true, ad ow we wat to prove the case correspodig to + is true That is, we assume + 3 + + ( ( + = ( ad we wat to show + 3 + + ( + ( + ( + So let us begi, we have + ( + ( + = ( + 3 + + ( +( + ( + }{{} case correspodig to ( + = ( + ( + ( + ( = ( + ( + + ( + Eample: Prove for, Solutio: + ( + ( + = ( + 3 + + ( + = + We first prove the case = Sice = = +, the first case holds Now we assume the case correspodig to is true, ad ow we wat to prove the case correspodig to + is true That is, we assume + 3 + + ( + = + ad we wat to show + 3 + + ( + + ( + ( + = + + So let us begi, we have + 3 + + + ( + ( + ( + }{{} case correspodig to = + + ( + + = ( + ( + ( + ( + = ( + ( + ( + = + +

We ow tur to recurrece relatios A recurrece relatio (sometimes also referred to as a recursio relatio is a sequece of umbers where a(, sometimes writte a, (the th umber ca be epressed usig previous a(, for < Eamples of recurrece relatios iclude the followig: bottom disc from the left pole to the right pole We ca use this to brea the operatio 0f movig all the discs ito several steps as outlied below a = 3a + a a 3 This is a eample of a costat coefficiet, homogeeous liear recurrece We will eamie these i more detail i a later lecture T moves a = a + This is a eample of a ohomogeeous recursio We will also eamie these (i some special cases i a later lecture move a + = a 0 a +a a + +a a 0 This is related to the idea of covolutio i aalysis It shows up frequetly i combiatorial problems, i particular the Catala umbers ca be foud usig this method T moves a, = a, + a, This is a eample of a multivariable recurrece That is we have that the umber that we are iterested i fidig has two parameters istead of oe We have see this particular recurrece before, amely, ( = ( ( + We are ofte iterested i solvig a recurrece which is to fid a epressio for a( that is idepedet of the previous a( I other words we wat to fid some fuctio f( so that a( = f( I order for us to do this we eed oe more thig, that is iitial coditios These iitial coditios are used to prime the pump ad get the recursio started Eample: The Tower of Haoi puzzle relates to a problem of movig a stac of differetly sized discs o oe pole to aother pole, see the followig picture So combiig we have T = T + + T = T + We have ow foud a recursio for T Usig this (alog with the first two cases we did by had we have the followig values for T 3 4 5 6 7 8 9 0 T 3 7 5 3 63 7 55 5 03 Starig at the T they loo a little familiar I particular they are very close to the umbers, 4, 8, 6, 3, which are the powers of So we ca guess that T = This right ow is a guess To show that the guess is correct we eed to do the followig two thigs: Show that the iitial coditio(s are satisfied Show that the recurrece relatioships is satisfied There are two rules: ( oly oe disc at a time ca be moved; ( at o time ca a larger disc be placed over a smaller disc Fid a recursio for T the miimal umber of moves eeded to move discs Solutio: Eperimetig we ote that T = (ie, move the disc ad we are doe, T = 3 (ie, move the small disc to the ceter pole, move the large disc to the ed pole ad the move the small disc bac We ca eep this goig, but ow let us step bac As we are movig discs we must at some poit move the (If this remids you of iductio, you are right! Showig the iitial coditio(s is satisfied establishes the base case ad showig that the recurrece relatioship is satisfied shows that if it is true to a certai case, the the et case is also true So we ow chec Our iitial coditio is that T =, ad sice = our iitial coditio is satisfied Now we chec that T = satisfies the recurrece T = T + We have T + = ( + = + = = T showig that the recurrece relatioship is satisfied This establishes that T = This is good ews

sice leged has it that there is a group of mos worig o a copy of the Tower of Haoi puzzle with 64 golde discs, whe they are the doe the world will ed We ow ow that it will tae them 64 = 8, 446, 744, 073, 709, 55, 65 moves, so the world is i o dager of edig soo! A very famous recursio is the oe related to Fiboacci umbers This recursio traces bac to a problem about rabbit populatio i Liber Abaci oe of the first mathematical tetboos about arithmetic writte i 0 by Leoardo de Pisa (also ow as Fiboacci The umbers are defied by F 0 = 0, F = ad F + = F + + F, ie, to fid the et umber add the two most recet umbers The first few Fiboacci umbers are listed below (Note: the boo defies the Fiboacci umbers by lettig F 0 = F =, this is the same set of umbers but the ide is shifted by ; the defiitio we have give here is the more commoly accepted versio 0 3 4 5 6 7 8 9 0 F 0 3 5 8 3 34 55 We will study these umbers i some detail ad fid some simple epressios for calculatig the th Fiboacci umber i later lectures The Fiboacci umbers are oe of the most studied umbers i mathematics (they eve have their ow joural dedicated to studyig them This is i part because they arise i may differet iterpretatios Eample: Cout the umber of biary sequeces with o cosecutive 0s Solutio: Let a( be the umber of biary sequeces of legth with o cosecutive 0s Calculatig the first few cases we see the followig admissible sequeces a( 0 0, 0, 0, 3 3 00, 0, 0, 0, 5 4 00, 00, 0, 00 8 0, 0, 0, The sequece a( loos lie Fiboacci umbers, i particular it loos lie a( = F + But we still have to prove that Let us tur to fidig a recursio for the a( We ca group the sequeces without cosecutive 0s of legth ito two groups The first group will be those that have a at the ed ad the secod group will have a 0 at the ed I the first group the first terms is ay sequece of legth without cosecutive 0s I the secod group, if the last term is 0 the we must have that the secod to last term be so the first terms is ay sequece of legth without cosecutive 0s I particular we have the followig two groups } {{ } legth a( such ad }{{} legth a( such So by the rule of additio it follows that a( = a( + a( 0 This is the same recurrece as the Fiboacci umbers, so we have that the umber of such sequeces are couted by the Fiboacci umbers! Eample: A compositio is a ordered partitio, so for eample the compositios of 4 are: +++, ++, ++, ++, +, +3, 3+, 4 Cout the umber of compositios of with all parts odd Solutio: Let b( be the umber of compositios of with all parts odd Calculatig the first few cases we see the followig admissible sequeces b( + 3 + +, 3 4 + + +, + 3, 3 + 3 5 + + + +, + + 3 5 + 3 +, 3 + +, 5 Agai the sequece loos lie Fiboacci umbers ad i particular it loos lie b( = F Agai we still have to prove it (After all it is possible that somethig loos true for the first few billio cases but evetually is false We ca group compositios accordig to the size of the last part There are two cases, if is odd the last part ca be ay of,, 4,, O the other had if is odd the last part ca be ay of, 3,, I particular it is ot difficult to see { + b( + b( 3 + if odd; b( = b( + b( 3 + if eve (The b( term is whe the last part is, the b( 3 is whe the last part is 3, ad so o The term for the case odd correspods to the compositio This does t loo lie the recurrece for the Fiboacci umbers at all! But perhaps we ca massage this recurrece ad get the Fiboacci recurrece to

pop out I particular we ote that for the case odd we have b( = + b( + b( 3 + b( 5 + = b( + ( + b( 3 + b( 5 + }{{} =b( For the case eve we have = b( + b( b( = b( + b( 3 + b( 5 + = b( + ( b( 3 + b( 5 + }{{} =b( = b( + b( I particular, we see that b( = b( + b(, so the sequece b( does satisfy the same recurrece property as the Fiboacci umbers, ad so we have that the b( are the Fiboacci umbers Lecture April 7 Eample: Fid the umber of compositios of with o part equal to Solutio: Let d( deote the umber of such compositios for The for the first few cases we have: admissible sequeces d( 0 3 3 4 +, 4 5 + 3, 3 +, 5 3 6 + +, + 4, 3 + 3, 4 +, 6 5 Looig at the umbers 0,,,, 3, 5 these loo familiar they loo lie Fiboacci umbers (Agai? Have t we see them eough? No, you ca ever see eough Fiboacci umbers! So ow let us tur to maig a recursio for d( We ca group compositios of accordig to the size of the last part Namely, the size of the last part ca be, 3,,, (we caot have the last part be size sice we are ot allowed parts of, for the same reaso we caot have a part of size sice the other part would be If the last part is the we have that the rest of the compositio would be some compositio of with o part of size I particular it follows that d( = d( + d( 3 + d( 4 + + d( + }{{} =d( i particular if we group all but the first term, what we have is d( ad so d( = d( + d( The same recursio for the Fiboacci umbers Sice we start with Fiboacci umbers ad the same recurrece is satisfied it follows that d( = F, ie, the umber of such compositios is couted by the Fiboacci umbers (with the ide shifted by We ow wat to loo at some importat umbers that arise i combiatorics We loo at them ow sice they ca be described usig multivariable recurreces { } Stirlig umbers of the secod id, deoted The, couts the umber of ways to partitio the set {,,, } ito disjoit oempty subsets (ie, each elemet is i oe ad oly oe subset For eample, we have the followig {, possible partitios } =4 {,, 3, 4} = =4 = =4 =3 =4 =4 {,, 3} {4}, {,, 4} {3} 7 {, 3, 4} {}, {} {, 3, 4} {, } {3, 4}, {, 3} {, 4} {, 4} {, 3} {} {} {3, 4}, {} {, 3} {4} 6 {} {, 4} {3}, {, } {3} {4} {, 3} {} {4}, {, 4} {} {3} {} {} {3} {4} The first few values of { } are show i the followig table { } { } { } { } { } { } 3 4 5 6 = = = 3 3 = 4 7 6 = 5 5 5 0 = 6 3 90 65 5 Looig at this table we see a few patters pop out { } = This is obvious sice the oly way to brea a set ito oe subset is to tae the whole set { } = This is also obvious sice the oly way to brea a set with elemets ito subsets is to have each elemet of the set i a subset by itself { } = To see this ote that if we brea our set ito two sets the it has the form of

A A (ie, A ad its complemet We may assume that is i A For each remaiig elemet it is either i A or ot, the oly coditio is that they caot all be i A (else A =, so there are ways to fill i the remaider of A { } ( = This ca be see by otig that there is oe subset with two elemets with two elemets ad the remaiig subsets are sigletos (ie, subsets of size oe So the umber of such partitios is the same as the umber of ways to pic the elemets i the subset with two elemets which ca be doe i ( ways O a side ote the row sums of this table are,, 5, 5, 5, these are also importat umbers ow as the Bell umbers We ow tur to the recursio for the Stirlig umbers of the secod id { } = { } + { (Note that this is similar to the recursio for biomial coefficiets The oly differece beig the additioal factor of To verify the recurrece we brea the partitios of {,,, } ito two groups I the first group are partitios with the set {} ad i the secod group are partitios without the set {} I the first group we have i a set by itself ad we eed to partitio the remaiig elemets ito sets which ca be doe i { } ways I the secod group we first form sets usig the first elemets, which ca be doe i { } ways, we ow eed to add ito oe of the sets, sice there are sets ad we ca put them ito ay oe of them the umber i this group is { } } The Stirlig umbers of the secod id arise i may applicatios (eve more tha the Stirlig umbers of the first id As a eample cosider the followig Eample: Show that the umber of ways to place o-attacig { roos below the diagoal of a is } Solutio: Sice we ow that { } couts the umber of partitios of {,,, } oe method is to give a oe-to-oe correspodece betwee the roo placemets ad the set partitios We will describe the positios of the chessboard as coordiates (i, j with i < j So suppose that {,,, } = A A A is a partitioig, ad suppose that A i = {a, a,, a m(i } with a < a < < a m(i The place roos at the coordiates (a, a, (a, a 3,, (a m(i, a m(i For each set we will place A i roos so altogether we will place ( Ai = roos i= Further ote, that by this covetio at most oe roo will go i each row ad i each colum so that the roos are o-attacig Coversely, give a oattacig roo placemet we ca recostruct the partitio Namely, if there is a roo at positio (p, q the put p ad q ito the same subset of the partitio It is easy to see that each placemet of roos correspods to a partitio ad each partitio correspods to a placemet of roos, givig us the desired correspodece The best way to see this is to wor through a few eamples We will illustrate oe here ad ecourage the reader to mae up their ow So suppose that our partitio is {, 3, 5} {} {4, 7, 8} {6, 9} The the correspodig roo placemet is show below 3 4 5 We also have Stirlig umbers of the first id, deoted [ ] These cout the umber of permutatios i the symmetric group S that have cycles Equivaletly, this is the umber of ways to sit people at circular tables so that o table is empty If we let (abc deote a table with persos a, b ad c seated i clocwise order (ote that (abc = (bca = (cab but (abc (acb, the we have the followig [, possible seatigs ] =4 (34, (43, (34 6 = (34, (43, (43 =4 ((34, ((43, ((34 = =4 =3 =4 =4 ((43, (3(4, (3(4 (4(3, (4(3, ((34 (3(4, (4(3 6 (((34, ((3(4, ((4(3 6 ((3(4, (3((4, (4((3 (((3(4 7 8 9

The first few values of [ ] are show i the followig table [ ] [ ] [ ] [ ] [ ] [ ] 3 4 5 6 = = = 3 3 = 4 6 6 = 5 4 50 35 0 = 6 0 74 5 85 5 Looig at this table we agai see a few patters pop out [ ] = (! This is obvious sice everyoe is sittig at oe table Fi the first perso, the there are possible people to seat i the et seat, i the followig seat ad so o [ ] = This is obvious sice the oly way that this ca happe is if everyoe is at a private table [ ] ( = As before, oe table will have a pair of people sittig ad the rest will have oe perso each We oly eed to pic the two people who will be sittig at the table together, which ca be doe i ( ways Looig at the the row sums of this table we have,, 6, 4, 0, 70,, which are the factorial umbers This is easy to see oce we ote that there is a oe-to-oe correspodece betwee permutatios ad these seatigs (Essetially the idea here is that we are refiig our cout by groupig permutatios accordig to the umber of cycles We ow tur to the recursio for the Stirlig umbers of the first id [ ] = [ ] + ( [ Agai we ote the similarity to the recursio for the biomial coefficiets as well as the Stirlig umbers of the secod id Of course a small chage ca lead to very differet behavior! To verify the recurrece we brea the seatig arragemets ito two groups I the first group we cosider the case where sits at a table by themselves ad i the secod group sits at a table with other people I the first group sice is at a table by themselves this leaves people to fill i the other tables which ca be doe i [ ] ways I the secod group first we seat everyoe besides at tables, this ca be doe i [ ] ways, ow we let sit dow, sice ca sit to the left of ay perso there are ] places that they could sit, ad so the total umber of arragemets i this group is ( [ ] Lecture 3 April 9 Previously we saw that if we ca guess the solutio to a recurrece problem the we ca prove that it is correct by verifyig the guess satisfies the iitial coditios ad satisfies the recurrece relatio But this assumes we ca guess the solutio which is ot easy For istace what is a way to epress the Fiboacci umbers without usig the recursio defiitio? We ow tur to systematically fidig solutios to some recurreces I this lecture we limit ourselves to solvig homogeeous costat coefficiet liear recursios of order This is a mouthful of adjectives, with this may assumptios we should be able to solve these recurreces! Recursios of this type have the followig form a = c a + c a + + c a, ( where the c, c,, c are costats, hece the term costat coefficiet That we oly loo bac i the previous terms to determie the et term eplais the order, that we are usig liear combiatios of the previous terms eplais the liear Fially homogeeous tells us that there is othig else besides the liear combiatio of the previous terms, a eample of somethig which is ot homogeeous would be a = c a + c a + + c a + f(, where f( is some ozero fuctio depedig o Our method, ad eve the laguage that we use, i solvig these liear recurreces is similar to the approach i solvig differetial equatios So for eample whe we had a homogeeous costat coefficiet liear differetial equatio of order, we would try to fid solutios of the form y = e r ad determie which values of r are possible Are approach will be the same, we will try to fid solutios of the form a = r ad determie which values of r are possible Puttig this ito the equatio ( we get r = c r + c r + + c r Dividig both sides of this equatio by the smallest power of r (i this case r this becomes r = c r + c r + + c, or r c r c r c = 0 Because the c i s are costats this last epressio does ot deped o, but is a th degree polyomial So we ca fid the roots of this polyomial (at least i

theory!, ad the roots are the possible values of r So suppose that we have the roots r, r,, r (for ow we will assume that they are all distict We ow have differet solutios ad so we ca combie them together i a liear combiatio (hece the importat reaso that we assumed liear So that some solutios are of the form a = D r + D r + + D r, where D, D,, D are costats Now let us bac to the origial problem Equatio ( tells us that we loo at the previous terms to determie the et term So i order for the recursio to get started we eed to have at least iitial terms (the iitial coditios I other words we have degrees of freedom, ad coveietly eough we have costats available So usig the iitial coditios we ca solve for the costats D, D,, D I fact, every solutio to this type of recurrece must be of this type! We still eed to determie what to do whe there are repeated roots, we will address this i the et lecture Eample: Solve the recurrece relatioship a 0 = 4, a = ad a = a + 3a for Solutio: First we traslate the recurrece relatioship ito a polyomial i r Sice it is a secod order recurrece this will become a quadratic, amely r = r + 3 or 0 = r r 3 = (r 3(r + So that the roots are r =, 3 So that the geeral solutios are a = C( + D3 The iitial coditios traslate ito 4 = a 0 = C + D, = a = C + 3D Addig these together we have 5 = 4D or D = 5/4, substitutig this ito the first equatio we have C = 4 5/4 = /4 So our solutio to the recurrece is a = 4 ( + 5 4 3 Eample: Recall that the Fiboacci umbers are defied by F 0 = 0, F = ad F + = F + + F for 0 Fid a epressio for the th Fiboacci umber Solutio: First we traslate the recurrece relatioship ito a polyoial i r This is agai a secod order recurrece so it becomes a quadratic, amely r = r + or r r = 0 Sice it is ot obvious how to factor we plug this ito the quadratic formula r = ± 5 So the geeral solutio to this recursio is ( ( + 5 5 F = C + D We ow plug the iitial coditios to solve for C ad D We have 0 = F 0 = C + D ( ( + 5 5 = F = C + D = 5 5 (C + D + (C D = (C D The first equatio show that C = D, puttig this ito the secod equatio we ca ow solve for C ad D, amely C = / 5 ad D = / 5 Substitutig these i we have F = ( + 5 5 5 ( 5 This seems very uusual, the Fiboacci umbers are whole umbers ad so do t have ay 5 terms i them but the above epressio is rife with them So we should chec our solutio Oe way is to plug it ito the recurrece ad verify that this wors, but that ca tae some time A quic way to chec is to plug i the et term ad verify that we get the correct aswer For eample by the recursio we have that F =, but pluggig = i the above epressio we have ( + 5 ( 5 5 5 = + 5 + 5 4 5 5 + 5 4 5 = 4 5 4 5 = Notice the 5 terms all cacel out so that we are left with whole umbers The umber that shows up i (+ 5/ is called the golde ratio, deoted by φ This umber is oe of the most celebrated costats i mathematics ad dates bac to the aciet Grees who believed that the best looig rectagle would be oe that is similar to a φ rectagle The idea beig that i such a rectagle if we cut off a square the leftover piece is similar to what we started with However, eperimetal studies idicate that whe ased to choose from a large group of rectagles that people ted ot to go with the oes proportioal to φ So perhaps the Grees were wrog about that

Fially, let us mae oe more observatio about the Fiboacci umbers We have + 5 5 = 68033988 = 068033988 I particular sice ( 5/ < whe we tae high powers of this term we have that this becomes very small From this we have that the secod term i the above epressio for F is smaller tha / for all values of 0 ad so ( + 5 F = earest iteger to 5 So that the rate of growth of the Fiboacci umbers is φ Eample: Solve the recurrece g = g g with the iitial coditios g 0 = ad g = 4 Solutio: We agai traslate this ito a polyomial i r This becomes the quadratic r = r or r r + = 0 Puttig this ito the quadratic formula we fid that the roots are r = ± 4 8 = ± i Now we have comple roots! So we might pause ad thi how do we chage our approach The aswer is ot at all, the eact same techiques wor whether the roots are real or comple So ow the geeral solutio is g = C( + i + D( i Puttig i the iitial coditios this traslates ito = g 0 = C + D 4 = g = C( + i + D( i = (C + D + i(c D = + i(c D This gives C + D = ad C D = 3i Addig together ad dividig by we have C = ( 3i/ while taig the differece ad dividig by we have D = ( + 3i/ So our solutio is ( ( 3i + 3i g = ( + i + ( i It should be oted that C ad D are comple cojugates This must happe i order to have the epressio for g to be real values (which must be true by the recurrece Lecture 4 May As metioed i the last lecture, solvig recurreces is very similar to solvig differetial equatios May of the same techiques that wored for differetial equatios will wor for recurreces As a eample whe solvig the differetial equatio y y + y = 0 we would tur this ito a polyomial r r+ = 0 ad get the roots r =,, we would the traslate this ito the geeral solutio y = Ce + De, the etra factor of comes from the fact that we have a double root, ie, we could ot use Ce + De = (C + De = C e as this does ot have eough freedom for givig geeral solutios to the differetial equatio For recurreces we will have essetially the same thig occur Suppose that we are worig with the recurrece a = c a + c a + + c a, the for fidig the geeral solutio we would loo at the roots of r c r c r c = 0 Suppose that ρ is a root of multiplicity l, the the geeral solutio has the form a = D ρ + D ρ + D 3 ρ + + D l ρ l ρ + where the + correspods to the cotributio of ay other roots Notice that we have multiplicity l ad that we have l costats, just the right amout (this should always happe! Eample: Let a 0 =, a = 6 ad a = 4a 4a for b Solve the recurrece for a Solutio: We first traslate the recurrece ito the polyomial r 4r + 4 = 0 which has a double root of So the geeral solutio will be of the form a = C + D To solve for C ad D we use our iitial coditios We have a 0 = C = ad a = C + D = 6 from which we ca deduce that D = 8 So the solutio is Eample: a = 8 Solve the recurrece b( = 3b( 3b( + b( 3 with iitial coditios b(0=, b(= ad b(=3

Solutio: We first traslate the recurrece ito the polyomial 0 = r 3 3r + 3r = (r 3 which has a triple root of So the geeral solutio will be of the form b( = C + D + E = C + D + E To solve for the costats we use our iitial coditios We have = a 0 = C, = a = C + D + E, 3 = a = C + D + 4E From the first equatio we have C = Puttig this i we have D + E = 3 ad D + 4E = Solvig these we get D = 3/ ad E = 7/ So our solutio is b( = 3 + 7 We ca occasioally tae a recurrece problem which is ot a costat coefficiet homogeeous liear recurrece of order ad rewrite it so that it is of the form, thus allowig us to use the techiques that we have discussed so far to solve Eample: Let d 0 = ad d = 3d Solve for d Solutio: This does ot have costat coefficiets so our curret techiques do ot wor Oe method to solve this is to start listig the first few terms ad loo for a patter (i this case it is ot hard to fid the patter! Istead let us do somethig that at first blush seems to mae thigs worse, let us tae the recurrece ad multiply both sides by (! givig (!d =!d = 3(!d Now let us mae a quic substitutio, amely let us set c =!d The the above recurrece becomes c = 3c which has the solutio c =!d = E3, which shows that the geeral solutio is d = E3 /! Our iitial coditio the shows that = d 0 = E so that our desired solutio is d = 3 /! The tric i the last eample was to fid a way to substitute to rewrite the recurrece as oe that we have already doe This allowed us to tae a recurrece which did ot have costat coefficiets ad treat it lie oe that did This same techique ca also tae some recurreces which are ot liear ad reduce it to oes which are liear Eample: Fid the solutio to the recurrece with a 0 =, a = ad a = (a + a (a a for Solutio: We start by rewritig this recurrece, ote that for the term iside the square root it is of the form (a + b(a b which we ca replace by a b, doig this ad squarig both sides we have a = 4a 4a There is a obvious substitutio to mae, amely b = a which relates this problem to the recurrece b = 4b 4b, with iitial coditios b 0 = a 0 = ad b = a = 4 As we saw i a previous eample this has the geeral solutio b = C + D It is easy to see that the iitial coditios traslate ito C = ad D = So we have a = b = + = ( + Taig square roots (ad seeig that we wat to go with the + square root to match our iitial coditios we have Eample: a = ( + Solve for g where g =, g = ad g = (g (g 3/4 for Eample: This is highly oliear The problem is that we have divisio ad the we also have thigs beig raised to powers We would lie to traslate this ito somethig similar to what we have already doe Thiig bac over our repertoire we recall that logarithms tur divisio ito subtractio ad also allow us to brig powers dow So let us tae the logarithm of both sides We could use ay base that we wat but let us go with log (log base The we have log g = log g 3 4 log g If we let h = log g the our problem traslates ito h = h 3 4 h with iitial coditios h 0 = log g 0 = 0 ad h = log g = (our choice of base was made precisely so that these iitial coditios would be clea To solve this recurrece we first traslate this ito the polyomial 0 = r r + 3 4 = ( r ( 3 r,

so that our roots are r = /, 3/ solutio for h is h = C ( (3 + D So the geeral Our iitial coditios give us 0 = C + D ad = (/C + (3/D or = C + 3D It is easy to solve ad fid C = ad D = So we ow have log g = h = ( (3 3 + = So ow solvig for g we have g = (3 / Fially, let us loo at how to deal with a recurrece relatio which is o-homogeeous, ie, a recurrece relatio of the form a = c a + c a + + c a + f( I differetial equatios there are several techiques to deal with this situatio We will be iterested i looig at the techique ow as the method of udetermied coefficiets, or as I lie to call it the method of good guessig This techique has defiite limitatios i that we eed to assume that f( is of a very specific form, amely f( = (polyomial ρ, ie, that f( loos lie what is possible as a homogeeous solutio (This is the same priciple whe doig the method of udetermied coefficiets i differetial equatios The outlie of how to solve a o-homogeeous equatio is as follows: Solve the homogeeous part (ie, the recurrece without the f( Solve the o-homogeeous part by settig up a solutio for a with some coefficiets to be determied by the recurrece 3 Combie the above two part to get the geeral solutio Solve for the costats usig the iitial coditios Note that the order of operatios is importat That is, we eed to solve for the homogeeous part before we ca do the o-homogeeous part ad we eed to solve both parts before we ca use iitial coditios The reaso that we eed to solve the homogeous part first is that it ca ifluece how we solve the ohomogeeous part So ow let us loo at step a little more closely So suppose that we have f( = (jth degree polyomial i ρ We loo at the homogeeous part ad see if ρ is a root, ie, part of the homogeeous solutio If it is ot a root the we guess that the o-homogeeous solutio will be of the form a = (B j j + B j j + + B 0 ρ, where B j, B j,, B 0 are costats which will be determied by puttig this ito the recursio, groupig coefficiets ad the maig sure each coefficiet is zero (See the eamples below If ρ is a root the part of the above guess actually is i the homogeeous part ad caot cotribute to the o-homogeeous part I this case we eed to getly udge our solutio To do this, suppose that ρ occurs as a root m times The we modify our guess for the o-homogeeous solutio so that it is ow of the form a = (B j m+j + B j m+j + + B 0 m ρ That is we multiply by a power of m to push the terms outside of the homogeeous solutio If f( has several parts added together we essetially do each part seperately ad combie them together We ow illustrate the approach with some eamples Eample: Solve for q where q 0 =, q = ad q = q + 3 for Solutio: The term +3 shows that this is a ohomogeeous recurrece, ad further 3 is of the form that we ca do somethig with So we first solve the homogeeous part q = q which turs ito the polyomial r = so that the roots are r = ± So the homogeeous portio has the form q = C + D( = C + D( Now either of the roots are 3 ad so we ow set up the form for the o-homogeeous part Namely q = E3, we ow eed to determie E To do this we substitute ito the recursio This gives E3 = E3 + 3 or ( E 9 E 3 = 0 The secod part comes from movig everythig to oe side ad collectig the coefficiets I order for this last statemet to hold (ie, i order for it to be a solutio to the o-homogeeous part we eed to have that the coefficiet is 0 This meas that we eed (8/9E = 0 so that we eed to choose E = 9/8 So the solutio for the o-homogeeous part is q = 9 8 3

Combiig the two parts, the geeral solutio to this recurrece is q = C + D( + 9 8 3 We ow tae care of the iitial coditios We have Rearragig this gives = q 0 = C + D + 9 8 = q + = C D + 7 8 7 8 9 8 = C + D, = C D Addig the two we get C = 36/8 = 9/ so that C = 9/4, taig the differece we get D = /8 = /4 so that D = /8 So our desired solutio is Eample: Solve for a q = 9 4 + 8 ( + 9 8 3 Let a 0 =, a = 8 ad a = 3a a + ( + Solutio: Agai we have a o-homogeeous equatio, ad it is of the form that we ca do somethig with So we first solve the homogeeous part a = 3a a This will traslate ito the polyomial r 3r + = 0 which factors as (r (r = 0 So that the roots are r =, So the solutio to the homogeeous part is a = C + D = C + D We ow tur to the o-homogeeous portio Sice ( is ot a root of the homogeeous solutio the that part of the solutio will be of the form E( Ufortuately is a root of the homogeeous solutio (with multiplicity oe ad so we will eed to modify our guess, so istead of (F +G we will use (F + G So our o-homogeeous solutio has the form a = E( + (F + G We ow substitute this i ad get E( + (F + G = 3 ( E( + (F ( + G( ( E( + (F ( + G( + ( + The et step is to epad ad collect coefficiets If we do this we get the followig: 0 = ( E 3E E + ( + ( 3 F 3 G F + G + ( G 3F + 3 G + F G + + ( F + 3 F F Each of these coefficiets must be zero i order for this to be a solutio This leads us to the followig system of equatios (ote that the last coefficiet is automatically zero ad so we will drop it: = 6E 0 = F + G = F This is a easy system to solve Givig E = /6, F = ad G = so the solutio to the o-homogeeous part is So the geeral solutios is a = 6 ( + ( a = C + D + 6 ( + ( It remais to use the iitial coditios to fid the costats C ad D Pluggig i the iitial coditios we have = a 0 = C + D + 6 8 = a = C + D 6 Givig C +D = 65/6 ad C +D = 49/6 Subtractig the secod from the first we have that D = 6/6 = 8/3 ad so C = 8/6 = 7/ So our fial solutio is a = 7 8 3 + 6 ( + ( (Usig this formula we get a 0 =, a = 8, a =, a 3 = 40, a 4 = 63 which is what the recurrece says we should get Wohoo! Lecture 5 May 4 We ca use geeratig fuctios to help solve recurreces The idea is that we are give a recurrece for a, ad we wat to solve for a This is doe by lettig g( = 0 a,

we the traslate the recurrece ito a relatioship for g( which lets us solve for g( We fially tae the fuctio g( ad epad it to fid the coefficiet for Broe ito steps we would do the followig for a recurrece with iitial coditios a 0, a,, a ad a recurrece a = f(, a, a, for Write g( = 0 a Brea off the iitial coditios ad use the recurrece to replace the remaiig terms, ie, so we have g( = a 0 + a + + a + f(, a, a, 3 (Hard step! rewrite the right had side i terms of g( ad/or other fuctios Usually doe by shiftig sums, multiplyig series, ad idetifyig commo series 4 Now solve for g(, ad the epad this ito a series to read off the coefficiet to get a For eample, this ca be doe usig geeral biomial theorem or partial fractios The best way to see this is through lots of eamples Eample: Use a geeratig fuctio to solve the recurrece a =a +a + with a 0 = ad a = Solutio: Followig the procedure for fidig g( give above we have g( = 0 a = a 0 + a + a = + + ( a + a + = ++ a + a + = + + ( g( + g( + Before cotiuig we should see how the last step happeed We have a = a + a 3 + a 3 3 + = ( a + a + a 3 3 + = ( g( a 0, ad similarly a = a 0 + a 3 + a 3 + = ( a 0 + a + a + = g( (This ca also be doe by factorig out a ad the shiftig the ide Fially sice + + + = /( the = = We ow solve for g(, doig that we get the followig ( g( = + + = Dividig we fially have the geeratig fuctio g(= ( ( = ( ( + ( We ow wat to brea this up, which we ca do usig the techiques of partial fractios, ( ( + ( = A + B + + C Clearig deomiators this becomes = A(+( +B( ( +C(+( We ca ow epad ad collect the coefficiet of powers of ad set up a system of equatios (which wors great, but before we do that let us observe that this must be true for all values of So let us choose some ice values of, amely values where most of the terms drop out So for istace we have = becomes = A givig A =, = becomes = 6B givig B = 6, = becomes = 3 4 C givig C = 4 3 The fial igrediet will be usig to get z = + z + z + z 3 +, g( = + 6 + + 4 3 = + ( + 4 ( 6 3 0 0 0 = ( + 6 ( + 43 0

So we have that a = + 6 ( + 4 3 Eample: Let f( = 0 F where F are the Fiboacci umbers (F 0 = 0, F = ad F = F + F for Fid a simple epressio for f( Solutio: f( = 0 We proceed as before We have F = F 0 + F + = + ( F + F F + = + f( + f( So we have ( f( = or f( = F or substitutig for φ ad ˆφ we get F = ( + 5 ( 5, 5 5 as we have foud previously (To be careful we should poit out that what we have doe oly maes sese if our fuctio is aalytic aroud some value of ear 0 I our case the earest pole for the fuctio f( is at = ˆφ so that ear = 0 everythig that we have doe is fie We will ot worry about such matters i our course, but if you are iterested i fidig more about this topic read Aalytic Combiatorics by Flajolet ad Sedgewic Eample: Let a be the umber of regios that lies divide the plae ito (Assume that o two lies are parallel ad o three meet at a poit Solve for a usig geeratig fuctios Solutio: Let us start by looig at a few simple cases From the pictures below we see that a 0 =, a =, a = 4 ad a 3 = 7 We ca actually use this to fid a epressio for the Fiboacci umbers (similar to what we got previously To do this we will let φ = ( + 5/ ad ˆφ = ( 5/ the it ca be checed that ( = ( φ( ˆφ We ow have = A φ + B ˆφ clearig deomiators we have = A( ˆφ + B( φ = (A + B (A ˆφ + Bφ We ca coclude that A = B ad that = A ˆφ + Bφ = B ( φ ˆφ = 5B So B = / 5 ad A = / 5, givig f( = = 5 φ 5 ˆφ = (φ ( ˆφ 5 5 0 0 = ( 5 φ ˆφ, b 0 5 I geeral whe we draw i the th lie we start drawig it i from, every time we cross oe of the lies we will create oe additioal regio, ad the as we head to we will create oe last regio So we have the recurrece a = a +, with iitial coditio a 0 = (Checig we see that this gives the right aswer for a, a, a 3 ad a 4, which is good! Now we have g( = 0 a = a 0 + = + ( a + a + = + g( +

The hard part about this is the secod part of the sum To hadle we start with = 0 foutais with cois i the bottom row Fid the geeratig fuctio for f( Taig the derivative of both sides we get ( = 0, almost what we wat, we just multiply by to get ( = 0 (Note of course that it does t matter whether we start our sum at 0 or, the result is the same So we have or ( g( = + (, g( = ( + ( 3 = ( + ( 3 From whe we started usig geeratig fuctios we saw that ( = ( +, 0 ad so we have ( + g( = 0 0 = ( ( + + 0 = ( + + 0 + 0 ( + ( + So we ca coclude that a = + + ( + So far we have looed at eamples that we could already solve usig other methods Let us try a eample that we could ot solve (or at least would be very hard! with our previous methods The followig eample is tae from the boo geeratigfuctioology Eample: A bloc foutai of cois is a arragemet of cois i rows such that each row of cois forms a sigle cotiguous bloc ad each coi i the secod or higher row touches two cois below (a eample is show below Let f( deote the umber of bloc Solutio: We let f(0 = (correspodig to the empty cofiguratio Clearly we have f( = ad f( = The case f(3 = 5 is show below Our et step is to fid a recurrece The foutai bloc either cosists oly of the sigle bottom row (oe cofiguratio or it has aother foutai bloc staced o top of the bottom row Suppose that the bottom row has legth ad the secod row has legth j, the the secod row ca go i ay of j positios Puttig it altogether we have f( = + ( jf(j j= (The correspods to the sigle row solutio, the sum correspods to whe we have multiple rows Note that whe j = the cotributio will be 0 i the sum So we have g( = f( 0 = f(0 + ( + ( jf(j j= = + + ( ( jf(j j= = + + ( ( jf(j j= The difficult step is determiig what to do with ( ( jf(j, j= looig at it the iside remids us of a 0 b + a b + + a b 0, ie, where we multiply two series together It is ot too hard to chec that ( ( jf(j j= = ( + + 3 3 + ( f( + f( + f(3 3 = ( ( g(

So combiig we have or ( g( = + + ( ( g(, ( g( = + ( Multiplyig both sides by ( ad simplifyig we have ( 3 + g( = or g( = 3 +