CS 207 Discrete Mathematics – 2012-2013
Nutan Limaye
Indian Institute of Technology, Bombay nutan@cse.iitb.ac.in
Combinatorics
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 1 / 6
Last time
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 2 / 6
Recap
e(n/e)n≤n!≤ne(n/2)n
We proved (partially) the following theorem: There are nn−2 labelled trees.
Definitions:
I Doubly rooted trees
I Skeleton
I pos(x) := distance of x fromu
I ord(x,S) := order ofx in setS.
I A map, sayφ, from doubly rooted trees to
ifuon skeletonS φ(u) = j, where ord(u,S) = pos(j) ifunot on skeleton φ(u) = parent(u)
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 / 6
Recap
e(n/e)n≤n!≤ne(n/2)n
We proved (partially) the following theorem:
There are nn−2 labelled trees.
Definitions:
I Doubly rooted trees
I Skeleton
I pos(x) := distance of x fromu
I ord(x,S) := order ofx in setS.
I A map, sayφ, from doubly rooted trees to
ifuon skeletonS φ(u) = j, where ord(u,S) = pos(j) ifunot on skeleton φ(u) = parent(u)
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 / 6
Recap
e(n/e)n≤n!≤ne(n/2)n
We proved (partially) the following theorem:
There are nn−2 labelled trees.
Definitions:
I Doubly rooted trees
I Skeleton
I pos(x) := distance of x fromu
I ord(x,S) := order ofx in setS.
I A map, sayφ, from doubly rooted trees to
ifuon skeletonS φ(u) = j, where ord(u,S) = pos(j) ifunot on skeleton φ(u) = parent(u)
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 / 6
Recap
e(n/e)n≤n!≤ne(n/2)n
We proved (partially) the following theorem:
There are nn−2 labelled trees.
Definitions:
I Doubly rooted trees
I Skeleton
I pos(x) := distance of x fromu
I ord(x,S) := order ofx in setS.
I A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifuon skeletonS φ(u) = j, where ord(u,S) = pos(j) ifunot on skeleton φ(u) = parent(u)
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 / 6
Recap
e(n/e)n≤n!≤ne(n/2)n
We proved (partially) the following theorem:
There are nn−2 labelled trees.
Definitions:
I Doubly rooted trees
I Skeleton
I pos(x) := distance of x fromu
I ord(x,S) := order ofx in setS.
I A map, sayφ, from doubly rooted trees toa set of functions from {1,2, . . . ,n} to{1,2, . . . ,n}
ifuon skeletonS φ(u) = j, where ord(u,S) = pos(j) ifunot on skeleton φ(u) = parent(u)
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 / 6
Recap
e(n/e)n≤n!≤ne(n/2)n
We proved (partially) the following theorem:
There are nn−2 labelled trees.
Definitions:
I Doubly rooted trees
I Skeleton
I pos(x) := distance of x fromu
I ord(x,S) := order ofx in setS.
I A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifuon skeletonS φ(u) = j, where ord(u,S) = pos(j) ifunot on skeleton φ(u) = parent(u)
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees. Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2 ≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2 ≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2 ≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees.
Leti1 ≤i2 ≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Note thatT ∪S\(T∩S) = [n]
Let i1≤i2 ≤. . .≤ik be the elements of S.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T Lemma ([CW])
Let A and B be two finite sets. Letφ:A→B and χ:B →A be two functions such that ∀a∈Aχ(φ(a)) =a thenφis a bijection from A to B.
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Recap
A map, sayφ, from doubly rooted trees to {f : [n]→[n]}
ifu on skeletonS φ(u) = j, where ord(u,S) = pos(j) ifu not on skeleton φ(u) = parent(u)
A map, sayχ, from{f : [n]→[n]} to doubly rooted trees.
Given a functionf : [n]→[n] consider the graph induced by the function. It gives cycles and trees.
Let S denote the vertices on the cycle. LetT denote the nodes on the trees. Leti1 ≤i2≤. . .≤ik be the elements ofS.
I Draw edges (f(ij),f(ij+1)) for 1≤j≤k−1
I Forj ∈T\(T∩S) draw edges (j,f(j))
To prove: For all doubly rooted treesT: χ(φ(T)) =T
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4 / 6
Today
Solving recurrences using generating functions Counting using generating functions
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 5 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n ≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn
(t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞n=0(F(n−1) +F(n−2))tn
(t+t2)φ(t) = P∞n=0F(n)tn
(t+t2)φ(t) = φ(t)
(t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) =√
5+1 2√
5
1+√ 5 2
n
+√
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2
= (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1
= (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b
Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b=
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b =
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b =
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .)
Equating coefficients oftn we get F(n) =aαn+bβn F(n) =
√
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b =
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6
Solving recurrences
Let F(n) denote the nth Fibonacci number. ComputeF(n).
We know that
∀n≥2 :F(n) =F(n−1) +F(n−2),andF(0) = 1,F(1) = 1.
φ(t) = P∞
n=0F(n)tn
tφ(t) = P∞
n=0F(n)tn+1 = P∞
n≥1F(n−1)tn
t2φ(t) = P∞
n=0F(n)tn+2 = P∞
n≥2F(n−2)tn (t+t2)φ(t) = P∞
n=0F(n)tn−1 (t+t2)φ(t) = φ(t)−1
φ(t) = 1−t−t1 2 = (1−αt)(1−βt)1 = (1−αt)a +(1−βt)b Solving we getα= 1+
√ 5
2 ,β = 1−
√ 5 2 ,a=
√ 5+1 2√
5 ,b =
√5−1 2√
5
φ(t) =a(1 +αt+α2t2+. . .) +b(1 +βt+β2t2+. . .) Equating coefficients oftn we get F(n) =aαn+bβn
F(n) = √
5+1 2√
5
1+√ 5 2
n
+ √
5−1 2√
5
1−√ 5 2
n
Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 6 / 6