• No results found

CS 207 Discrete Mathematics – 2012-2013

N/A
N/A
Protected

Academic year: 2022

Share "CS 207 Discrete Mathematics – 2012-2013"

Copied!
34
0
0

Loading.... (view fulltext now)

Full text

(1)

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

(2)

Last time

Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 2 / 6

(3)

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

(4)

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

(5)

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

(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

(7)

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

(8)

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

(9)

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 1jk1

I Forj T\(TS) 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

(10)

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 1jk1

I Forj T\(TS) 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

(11)

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 1jk1

I Forj T\(TS) 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

(12)

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 1jk1

I Forj T\(TS) 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

(13)

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 1jk1

I Forj T\(TS) 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

(14)

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 1jk1

I Forj T\(TS) 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

(15)

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 1jk1

I Forj T\(TS) 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

(16)

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 1jk1

I Forj T\(TS) 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

(17)

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 1jk1

I Forj T\(TS) 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

(18)

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 1jk1

I Forj T\(TS) 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

(19)

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 1jk1

I Forj T\(TS) 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

(20)

Today

Solving recurrences using generating functions Counting using generating functions

Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 5 / 6

(21)

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

(22)

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

(23)

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

(24)

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

(25)

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

(26)

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) = Pn=0(F(n1) +F(n2))tn

(t+t2)φ(t) = Pn=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

(27)

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

(28)

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

(29)

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

(30)

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

(31)

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

(32)

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

(33)

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

(34)

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

References

Related documents

Take back message: Counting the same quantity the number of directed edges in two different ways can be helpful!. Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 10

Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 3 /

Today we will see two theorems which prove two properties of infinite sets that they share with finite sets.. Theorem

It can be derived using another heavy hammer... It can be derived using another

An interesting game and an open problem (If time permits).. Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 4

I Sets, relations, functions, partial orders, graphs Combinatorics.. Elements of graph theory Elements of

Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 July 2012 3

Today we will see two theorems which prove two properties of infinite sets that they share with finite sets. Nutan (IITB) CS 207 Discrete Mathematics – 2012-2013 May 2011 5