SlideShare a Scribd company logo
1 of 18
Download to read offline
Counting
Recurrence Relations
 Sequences are ordered lists of elements.
• 1, 2, 3, 5, 8
• 1, 3, 9, 27, 81, …
 Sequences arise throughout mathematics, computer
science, and in many other disciplines, ranging from
botany to music.
 We will introduce the terminology to represent
sequences.
© S. Turaev, CSC 1700 Discrete Mathematics 2
Recurrence Relations
Definition: A sequence is a function from a subset of the
integers (usually either the set 0, 1, 2, 3, 4, … or
1, 2, 3, 4, … ) to a set 𝑆𝑆.
 The notation 𝑎𝑎𝑛𝑛 is used to denote the image of the
integer 𝑛𝑛. We can think of 𝑎𝑎𝑛𝑛 as the equivalent of
𝑓𝑓 𝑛𝑛 where 𝑓𝑓 is a function from 0,1,2, … to 𝑆𝑆. We
call 𝑎𝑎𝑛𝑛 a term of the sequence.
Example: Consider the sequence 𝑎𝑎𝑛𝑛 where 𝑎𝑎𝑛𝑛 = 1/𝑛𝑛.
Then
1,
1
2
,
1
3
,
1
4
, …
© S. Turaev, CSC 1700 Discrete Mathematics 3
Recurrence Relations
Definition: A recurrence relation for the sequence 𝑎𝑎𝑛𝑛 is
an equation that expresses 𝑎𝑎𝑛𝑛 in terms of one or more of
the previous terms of the sequence, namely,
𝑎𝑎0, 𝑎𝑎1, … , 𝑎𝑎𝑛𝑛−1, for all integers 𝑛𝑛 with 𝑛𝑛 ≥ 𝑛𝑛0, where 𝑛𝑛0
is a nonnegative integer.
 A sequence is called a solution of a recurrence relation
if its terms satisfy the recurrence relation.
 The initial conditions for a sequence specify the terms
that precede the first term where the recurrence
relation takes effect.
© S. Turaev, CSC 1700 Discrete Mathematics 4
Recurrence Relations
Example: Let 𝑎𝑎𝑛𝑛 be a sequence that satisfies the
recurrence relation 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 3 for 𝑛𝑛 = 1, 2, 3, 4, …
and suppose that 𝑎𝑎0 = 2. What are 𝑎𝑎1, 𝑎𝑎2 and 𝑎𝑎3?
[Here the initial condition is 𝑎𝑎0 = 2.]
Example: Let 𝑎𝑎𝑛𝑛 be a sequence that satisfies the
recurrence relation 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 − 𝑎𝑎𝑛𝑛−2 for 𝑛𝑛 = 2, 3, 4, …
and suppose that 𝑎𝑎0 = 3 and 𝑎𝑎1 = 5. What are 𝑎𝑎2 and
𝑎𝑎3?
[Here the initial conditions are 𝑎𝑎0 = 3 and 𝑎𝑎1 = 5.]
© S. Turaev, CSC 1700 Discrete Mathematics 5
Fibonacci Numbers
Definition: the Fibonacci sequence, 𝑓𝑓0, 𝑓𝑓1, 𝑓𝑓2, … , is
defined by:
 Initial Conditions: 𝑓𝑓0 = 0, 𝑓𝑓1 = 1
 Recurrence Relation: 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2
Example: Find 𝑓𝑓4, 𝑓𝑓5, 𝑓𝑓6, 𝑓𝑓7 and 𝑓𝑓8.
© S. Turaev, CSC 1700 Discrete Mathematics 6
Recurrence Relations
 Finding a formula for the 𝑛𝑛th term of the sequence
generated by a recurrence relation is called solving the
recurrence relation.
 Such a formula is called a explicit (closed) formula.
 One technique for finding an explicit formula for the
sequence defined by a recurrence relation is
backtracking.
© S. Turaev, CSC 1700 Discrete Mathematics 7
Recurrence Relations
Example: Let 𝑎𝑎𝑛𝑛 be a sequence that satisfies the
recurrence relation 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 3 for 𝑛𝑛 = 2, 3, 4, … and
suppose that 𝑎𝑎1 = 2. Find an explicit formula for the
sequence.
𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 3
= 𝑎𝑎𝑛𝑛−2 + 3 + 3 = 𝑎𝑎𝑛𝑛−2 + 2 ⋅ 3
= 𝑎𝑎𝑛𝑛−3 + 3 + 2 ⋅ 3 = 𝑎𝑎𝑛𝑛−3 + 3 ⋅ 3
⋯
= 𝑎𝑎2 + 𝑛𝑛 − 2 ⋅ 3 = 𝑎𝑎1 + 3 + 𝑛𝑛 − 2 ⋅ 3
= 𝑎𝑎1 + 𝑛𝑛 − 1 ⋅ 3 = 2 + 𝑛𝑛 − 1 ⋅ 3
= 3 ⋅ 𝑛𝑛 − 1
© S. Turaev, CSC 1700 Discrete Mathematics 8
Recurrence Relations : Backtracking
Example 1: 𝑏𝑏𝑛𝑛 = 5𝑏𝑏𝑛𝑛−1 + 3, 𝑏𝑏1 = 3.
Example 2: 𝑐𝑐𝑛𝑛 = 𝑐𝑐𝑛𝑛−1 + 𝑛𝑛, 𝑏𝑏1 = 4.
Example 3: 𝑑𝑑𝑛𝑛 = 𝑛𝑛 ⋅ 𝑑𝑑𝑛𝑛−1, 𝑑𝑑1 = 6.
© S. Turaev, CSC 1700 Discrete Mathematics 9
Fibonacci Numbers
Definition: the Fibonacci sequence, 𝑓𝑓0, 𝑓𝑓1, 𝑓𝑓2, … , is
defined by:
 Initial Conditions: 𝑓𝑓0 = 0, 𝑓𝑓1 = 1
 Recurrence Relation: 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2
Example: Find 𝑓𝑓4, 𝑓𝑓5, 𝑓𝑓6, 𝑓𝑓7 and 𝑓𝑓8.
© S. Turaev, CSC 1700 Discrete Mathematics 10
Linear Homogeneous Recurrence Relations
Definition: A linear homogeneous recurrence relation of
degree 𝑘𝑘 with constant coefficients is a recurrence
relation of the form
𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 + ⋯ + 𝑟𝑟𝑘𝑘 𝑎𝑎𝑛𝑛−𝑘𝑘
where 𝑟𝑟1, 𝑟𝑟2, … , 𝑟𝑟𝑘𝑘 are real numbers, and 𝑟𝑟𝑘𝑘 ≠ 0.
© S. Turaev, CSC 1700 Discrete Mathematics
• it is linear because the right-hand side is a sum of the previous
terms of the sequence each multiplied by a function of 𝑛𝑛.
• it is homogeneous because no terms occur that are not
multiples of the 𝑎𝑎𝑗𝑗s. Each coefficient is a constant.
• the degree is 𝑘𝑘 because 𝑎𝑎𝑛𝑛 is expressed in terms of the
previous 𝑘𝑘 terms of the sequence.
11
Linear Homogeneous Recurrence Relations
 𝑝𝑝𝑛𝑛 = 1.11 𝑝𝑝𝑛𝑛−1
 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2
 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 𝑎𝑎𝑛𝑛−2
2
 ℎ𝑛𝑛 = 2ℎ𝑛𝑛−1 + 1
 𝑏𝑏𝑛𝑛 = 𝑛𝑛𝑏𝑏𝑛𝑛−1
© S. Turaev, CSC 1700 Discrete Mathematics 12
Linear Homogeneous Recurrence Relations
 𝑝𝑝𝑛𝑛 = 1.11 𝑝𝑝𝑛𝑛−1
 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2
 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 𝑎𝑎𝑛𝑛−2
2
 ℎ𝑛𝑛 = 2ℎ𝑛𝑛−1 + 1
 𝑏𝑏𝑛𝑛 = 𝑛𝑛𝑏𝑏𝑛𝑛−1
© S. Turaev, CSC 1700 Discrete Mathematics
linear homogeneous recurrence
relation of degree 1
linear homogeneous recurrence
relation of degree 2
not linear
not homogeneous
coefficients are not constants
13
Linear Homogeneous Recurrence Relations
 The basic approach is to look for solutions of the form
𝑎𝑎𝑛𝑛 = 𝑥𝑥 𝑛𝑛
, where 𝑥𝑥 is a constant.
 Note that 𝑎𝑎𝑛𝑛 = 𝑥𝑥 𝑛𝑛
is a solution to the recurrence
relation
𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 + ⋯ + 𝑟𝑟𝑘𝑘 𝑎𝑎𝑛𝑛−𝑘𝑘
if and only if
𝑥𝑥 𝑛𝑛
= 𝑟𝑟1 𝑥𝑥 𝑛𝑛−1
+ 𝑟𝑟2 𝑥𝑥 𝑛𝑛−2
+ ⋯ + 𝑟𝑟𝑘𝑘 𝑥𝑥 𝑛𝑛−𝑘𝑘
.
© S. Turaev, CSC 1700 Discrete Mathematics 14
Linear Homogeneous Recurrence Relations
 Algebraic manipulation yields the characteristic
equation:
𝑥𝑥 𝑘𝑘
− 𝑟𝑟1 𝑥𝑥 𝑘𝑘−1
− 𝑟𝑟2 𝑥𝑥 𝑘𝑘−2
− ⋯ − 𝑟𝑟𝑘𝑘 = 0
 The sequence 𝑎𝑎𝑛𝑛 with 𝑎𝑎𝑛𝑛 = 𝑥𝑥 𝑛𝑛
is a solution if and
only if 𝑥𝑥 is a solution to the characteristic equation.
© S. Turaev, CSC 1700 Discrete Mathematics 15
Linear Homogeneous Recurrence Relations
Theorem: If the characteristic equation
𝑥𝑥2
− 𝑟𝑟1 𝑥𝑥 − 𝑟𝑟2 = 0
of the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 has two
distinct roots, 𝑥𝑥1 and 𝑥𝑥2, then
𝑎𝑎𝑛𝑛 = 𝑝𝑝𝑥𝑥1
𝑛𝑛
+ 𝑞𝑞𝑥𝑥2
𝑛𝑛
where 𝑝𝑝 and 𝑞𝑞 depend on the initial conditions, is the
explicit formula for the sequence.
© S. Turaev, CSC 1700 Discrete Mathematics 16
Linear Homogeneous Recurrence Relations
Theorem: If the characteristic equation
𝑥𝑥2
− 𝑟𝑟1 𝑥𝑥 − 𝑟𝑟2 = 0
of the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 has a
single root, 𝑥𝑥, then
𝑎𝑎𝑛𝑛 = 𝑝𝑝𝑥𝑥 𝑛𝑛
+ 𝑞𝑞𝑞𝑞𝑥𝑥 𝑛𝑛
where 𝑝𝑝 and 𝑞𝑞 depend on the initial conditions, is the
explicit formula for the sequence.
© S. Turaev, CSC 1700 Discrete Mathematics 17
Linear Homogeneous Recurrence Relations
Example 1: Find an explicit formula for the sequence
defined by 𝑎𝑎𝑛𝑛 = 4𝑎𝑎𝑛𝑛−1 + 5𝑎𝑎𝑛𝑛−2 with the initial
conditions 𝑎𝑎1 = 2 and 𝑎𝑎2 = 6.
Example 2: Find an explicit formula for the sequence
defined by 𝑏𝑏𝑛𝑛 = −6𝑏𝑏𝑛𝑛−1 − 9𝑏𝑏𝑛𝑛−2 with the initial
conditions 𝑏𝑏1 = 2.5 and 𝑏𝑏2 = 4.7.
Example 3 (Fibonacci sequence): Find an explicit formula
for the sequence defined by 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2 with the
initial conditions 𝑓𝑓0 = 0 and 𝑓𝑓1 = 1.
© S. Turaev, CSC 1700 Discrete Mathematics 18

More Related Content

What's hot

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
Ankit Katiyar
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
Dhaval Kaneria
 
Linear differential equation with constant coefficient
Linear differential equation with constant coefficientLinear differential equation with constant coefficient
Linear differential equation with constant coefficient
Sanjay Singh
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
Nahid Hasan
 

What's hot (20)

Integral calculus
Integral calculusIntegral calculus
Integral calculus
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
 
Recursion
RecursionRecursion
Recursion
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relations
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
recurence solutions
recurence solutionsrecurence solutions
recurence solutions
 
numerical methods
numerical methodsnumerical methods
numerical methods
 
Application of discrete math in real life
Application of discrete math in real lifeApplication of discrete math in real life
Application of discrete math in real life
 
Solving linear homogeneous recurrence relations
Solving linear homogeneous recurrence relationsSolving linear homogeneous recurrence relations
Solving linear homogeneous recurrence relations
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Linear differential equation with constant coefficient
Linear differential equation with constant coefficientLinear differential equation with constant coefficient
Linear differential equation with constant coefficient
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
 

Similar to Recurrence relations

Integers and matrices (slides)
Integers and matrices (slides)Integers and matrices (slides)
Integers and matrices (slides)
IIUM
 
Semana 13 ecuaciones polinomiales ii álgebra-uni ccesa007
Semana 13   ecuaciones polinomiales ii  álgebra-uni ccesa007Semana 13   ecuaciones polinomiales ii  álgebra-uni ccesa007
Semana 13 ecuaciones polinomiales ii álgebra-uni ccesa007
Demetrio Ccesa Rayme
 
Arithmetic sequences and arithmetic means
Arithmetic sequences and arithmetic meansArithmetic sequences and arithmetic means
Arithmetic sequences and arithmetic means
Denmar Marasigan
 
ePortfolio- Mathematics
ePortfolio- MathematicsePortfolio- Mathematics
ePortfolio- Mathematics
readsw346
 

Similar to Recurrence relations (20)

Relations digraphs
Relations  digraphsRelations  digraphs
Relations digraphs
 
Integers and matrices (slides)
Integers and matrices (slides)Integers and matrices (slides)
Integers and matrices (slides)
 
Relations and Functions.pdf
Relations and Functions.pdfRelations and Functions.pdf
Relations and Functions.pdf
 
P2-Chp3-SequencesAndSeries from pure maths 2.pptx
P2-Chp3-SequencesAndSeries from pure maths 2.pptxP2-Chp3-SequencesAndSeries from pure maths 2.pptx
P2-Chp3-SequencesAndSeries from pure maths 2.pptx
 
sequence and series.docx
sequence and series.docxsequence and series.docx
sequence and series.docx
 
Semana 13 ecuaciones polinomiales ii álgebra-uni ccesa007
Semana 13   ecuaciones polinomiales ii  álgebra-uni ccesa007Semana 13   ecuaciones polinomiales ii  álgebra-uni ccesa007
Semana 13 ecuaciones polinomiales ii álgebra-uni ccesa007
 
11.3 Geometric Sequences and Series
11.3 Geometric Sequences and Series11.3 Geometric Sequences and Series
11.3 Geometric Sequences and Series
 
Counting i (slides)
Counting i (slides)Counting i (slides)
Counting i (slides)
 
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
 
Lesson 1a_Sequence.pptx
Lesson 1a_Sequence.pptxLesson 1a_Sequence.pptx
Lesson 1a_Sequence.pptx
 
MT102 Лекц 10
MT102 Лекц 10MT102 Лекц 10
MT102 Лекц 10
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Arithmetic sequences and arithmetic means
Arithmetic sequences and arithmetic meansArithmetic sequences and arithmetic means
Arithmetic sequences and arithmetic means
 
Sistemas de ecuaciones lineales
Sistemas de ecuaciones linealesSistemas de ecuaciones lineales
Sistemas de ecuaciones lineales
 
Semana 29 sucesiones reales álgebra uni ccesa007
Semana 29 sucesiones reales  álgebra uni ccesa007Semana 29 sucesiones reales  álgebra uni ccesa007
Semana 29 sucesiones reales álgebra uni ccesa007
 
Binary Operations.pptx
Binary Operations.pptxBinary Operations.pptx
Binary Operations.pptx
 
ePortfolio- Mathematics
ePortfolio- MathematicsePortfolio- Mathematics
ePortfolio- Mathematics
 
Section 9: Equivalence Relations & Cosets
Section 9: Equivalence Relations & CosetsSection 9: Equivalence Relations & Cosets
Section 9: Equivalence Relations & Cosets
 
MAT-314 Relations and Functions
MAT-314 Relations and FunctionsMAT-314 Relations and Functions
MAT-314 Relations and Functions
 

More from IIUM (20)

How to use_000webhost
How to use_000webhostHow to use_000webhost
How to use_000webhost
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Kreydle internship-multimedia
Kreydle internship-multimediaKreydle internship-multimedia
Kreydle internship-multimedia
 
03phpbldgblock
03phpbldgblock03phpbldgblock
03phpbldgblock
 
Chap2 practice key
Chap2 practice keyChap2 practice key
Chap2 practice key
 
Group p1
Group p1Group p1
Group p1
 
Tutorial import n auto pilot blogspot friendly seo
Tutorial import n auto pilot blogspot friendly seoTutorial import n auto pilot blogspot friendly seo
Tutorial import n auto pilot blogspot friendly seo
 
Visual sceneperception encycloperception-sage-oliva2009
Visual sceneperception encycloperception-sage-oliva2009Visual sceneperception encycloperception-sage-oliva2009
Visual sceneperception encycloperception-sage-oliva2009
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lforms
 
Exercise on algo analysis answer
Exercise on algo analysis   answerExercise on algo analysis   answer
Exercise on algo analysis answer
 
Redo midterm
Redo midtermRedo midterm
Redo midterm
 
Heaps
HeapsHeaps
Heaps
 
Report format
Report formatReport format
Report format
 
Edpuzzle guidelines
Edpuzzle guidelinesEdpuzzle guidelines
Edpuzzle guidelines
 
Final Exam Paper
Final Exam PaperFinal Exam Paper
Final Exam Paper
 
Final Exam Paper
Final Exam PaperFinal Exam Paper
Final Exam Paper
 
Group assignment 1 s21516
Group assignment 1 s21516Group assignment 1 s21516
Group assignment 1 s21516
 
Avl tree-rotations
Avl tree-rotationsAvl tree-rotations
Avl tree-rotations
 
Week12 graph
Week12   graph Week12   graph
Week12 graph
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Recurrence relations

  • 2. Recurrence Relations  Sequences are ordered lists of elements. • 1, 2, 3, 5, 8 • 1, 3, 9, 27, 81, …  Sequences arise throughout mathematics, computer science, and in many other disciplines, ranging from botany to music.  We will introduce the terminology to represent sequences. © S. Turaev, CSC 1700 Discrete Mathematics 2
  • 3. Recurrence Relations Definition: A sequence is a function from a subset of the integers (usually either the set 0, 1, 2, 3, 4, … or 1, 2, 3, 4, … ) to a set 𝑆𝑆.  The notation 𝑎𝑎𝑛𝑛 is used to denote the image of the integer 𝑛𝑛. We can think of 𝑎𝑎𝑛𝑛 as the equivalent of 𝑓𝑓 𝑛𝑛 where 𝑓𝑓 is a function from 0,1,2, … to 𝑆𝑆. We call 𝑎𝑎𝑛𝑛 a term of the sequence. Example: Consider the sequence 𝑎𝑎𝑛𝑛 where 𝑎𝑎𝑛𝑛 = 1/𝑛𝑛. Then 1, 1 2 , 1 3 , 1 4 , … © S. Turaev, CSC 1700 Discrete Mathematics 3
  • 4. Recurrence Relations Definition: A recurrence relation for the sequence 𝑎𝑎𝑛𝑛 is an equation that expresses 𝑎𝑎𝑛𝑛 in terms of one or more of the previous terms of the sequence, namely, 𝑎𝑎0, 𝑎𝑎1, … , 𝑎𝑎𝑛𝑛−1, for all integers 𝑛𝑛 with 𝑛𝑛 ≥ 𝑛𝑛0, where 𝑛𝑛0 is a nonnegative integer.  A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.  The initial conditions for a sequence specify the terms that precede the first term where the recurrence relation takes effect. © S. Turaev, CSC 1700 Discrete Mathematics 4
  • 5. Recurrence Relations Example: Let 𝑎𝑎𝑛𝑛 be a sequence that satisfies the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 3 for 𝑛𝑛 = 1, 2, 3, 4, … and suppose that 𝑎𝑎0 = 2. What are 𝑎𝑎1, 𝑎𝑎2 and 𝑎𝑎3? [Here the initial condition is 𝑎𝑎0 = 2.] Example: Let 𝑎𝑎𝑛𝑛 be a sequence that satisfies the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 − 𝑎𝑎𝑛𝑛−2 for 𝑛𝑛 = 2, 3, 4, … and suppose that 𝑎𝑎0 = 3 and 𝑎𝑎1 = 5. What are 𝑎𝑎2 and 𝑎𝑎3? [Here the initial conditions are 𝑎𝑎0 = 3 and 𝑎𝑎1 = 5.] © S. Turaev, CSC 1700 Discrete Mathematics 5
  • 6. Fibonacci Numbers Definition: the Fibonacci sequence, 𝑓𝑓0, 𝑓𝑓1, 𝑓𝑓2, … , is defined by:  Initial Conditions: 𝑓𝑓0 = 0, 𝑓𝑓1 = 1  Recurrence Relation: 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2 Example: Find 𝑓𝑓4, 𝑓𝑓5, 𝑓𝑓6, 𝑓𝑓7 and 𝑓𝑓8. © S. Turaev, CSC 1700 Discrete Mathematics 6
  • 7. Recurrence Relations  Finding a formula for the 𝑛𝑛th term of the sequence generated by a recurrence relation is called solving the recurrence relation.  Such a formula is called a explicit (closed) formula.  One technique for finding an explicit formula for the sequence defined by a recurrence relation is backtracking. © S. Turaev, CSC 1700 Discrete Mathematics 7
  • 8. Recurrence Relations Example: Let 𝑎𝑎𝑛𝑛 be a sequence that satisfies the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 3 for 𝑛𝑛 = 2, 3, 4, … and suppose that 𝑎𝑎1 = 2. Find an explicit formula for the sequence. 𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 3 = 𝑎𝑎𝑛𝑛−2 + 3 + 3 = 𝑎𝑎𝑛𝑛−2 + 2 ⋅ 3 = 𝑎𝑎𝑛𝑛−3 + 3 + 2 ⋅ 3 = 𝑎𝑎𝑛𝑛−3 + 3 ⋅ 3 ⋯ = 𝑎𝑎2 + 𝑛𝑛 − 2 ⋅ 3 = 𝑎𝑎1 + 3 + 𝑛𝑛 − 2 ⋅ 3 = 𝑎𝑎1 + 𝑛𝑛 − 1 ⋅ 3 = 2 + 𝑛𝑛 − 1 ⋅ 3 = 3 ⋅ 𝑛𝑛 − 1 © S. Turaev, CSC 1700 Discrete Mathematics 8
  • 9. Recurrence Relations : Backtracking Example 1: 𝑏𝑏𝑛𝑛 = 5𝑏𝑏𝑛𝑛−1 + 3, 𝑏𝑏1 = 3. Example 2: 𝑐𝑐𝑛𝑛 = 𝑐𝑐𝑛𝑛−1 + 𝑛𝑛, 𝑏𝑏1 = 4. Example 3: 𝑑𝑑𝑛𝑛 = 𝑛𝑛 ⋅ 𝑑𝑑𝑛𝑛−1, 𝑑𝑑1 = 6. © S. Turaev, CSC 1700 Discrete Mathematics 9
  • 10. Fibonacci Numbers Definition: the Fibonacci sequence, 𝑓𝑓0, 𝑓𝑓1, 𝑓𝑓2, … , is defined by:  Initial Conditions: 𝑓𝑓0 = 0, 𝑓𝑓1 = 1  Recurrence Relation: 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2 Example: Find 𝑓𝑓4, 𝑓𝑓5, 𝑓𝑓6, 𝑓𝑓7 and 𝑓𝑓8. © S. Turaev, CSC 1700 Discrete Mathematics 10
  • 11. Linear Homogeneous Recurrence Relations Definition: A linear homogeneous recurrence relation of degree 𝑘𝑘 with constant coefficients is a recurrence relation of the form 𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 + ⋯ + 𝑟𝑟𝑘𝑘 𝑎𝑎𝑛𝑛−𝑘𝑘 where 𝑟𝑟1, 𝑟𝑟2, … , 𝑟𝑟𝑘𝑘 are real numbers, and 𝑟𝑟𝑘𝑘 ≠ 0. © S. Turaev, CSC 1700 Discrete Mathematics • it is linear because the right-hand side is a sum of the previous terms of the sequence each multiplied by a function of 𝑛𝑛. • it is homogeneous because no terms occur that are not multiples of the 𝑎𝑎𝑗𝑗s. Each coefficient is a constant. • the degree is 𝑘𝑘 because 𝑎𝑎𝑛𝑛 is expressed in terms of the previous 𝑘𝑘 terms of the sequence. 11
  • 12. Linear Homogeneous Recurrence Relations  𝑝𝑝𝑛𝑛 = 1.11 𝑝𝑝𝑛𝑛−1  𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2  𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 𝑎𝑎𝑛𝑛−2 2  ℎ𝑛𝑛 = 2ℎ𝑛𝑛−1 + 1  𝑏𝑏𝑛𝑛 = 𝑛𝑛𝑏𝑏𝑛𝑛−1 © S. Turaev, CSC 1700 Discrete Mathematics 12
  • 13. Linear Homogeneous Recurrence Relations  𝑝𝑝𝑛𝑛 = 1.11 𝑝𝑝𝑛𝑛−1  𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2  𝑎𝑎𝑛𝑛 = 𝑎𝑎𝑛𝑛−1 + 𝑎𝑎𝑛𝑛−2 2  ℎ𝑛𝑛 = 2ℎ𝑛𝑛−1 + 1  𝑏𝑏𝑛𝑛 = 𝑛𝑛𝑏𝑏𝑛𝑛−1 © S. Turaev, CSC 1700 Discrete Mathematics linear homogeneous recurrence relation of degree 1 linear homogeneous recurrence relation of degree 2 not linear not homogeneous coefficients are not constants 13
  • 14. Linear Homogeneous Recurrence Relations  The basic approach is to look for solutions of the form 𝑎𝑎𝑛𝑛 = 𝑥𝑥 𝑛𝑛 , where 𝑥𝑥 is a constant.  Note that 𝑎𝑎𝑛𝑛 = 𝑥𝑥 𝑛𝑛 is a solution to the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 + ⋯ + 𝑟𝑟𝑘𝑘 𝑎𝑎𝑛𝑛−𝑘𝑘 if and only if 𝑥𝑥 𝑛𝑛 = 𝑟𝑟1 𝑥𝑥 𝑛𝑛−1 + 𝑟𝑟2 𝑥𝑥 𝑛𝑛−2 + ⋯ + 𝑟𝑟𝑘𝑘 𝑥𝑥 𝑛𝑛−𝑘𝑘 . © S. Turaev, CSC 1700 Discrete Mathematics 14
  • 15. Linear Homogeneous Recurrence Relations  Algebraic manipulation yields the characteristic equation: 𝑥𝑥 𝑘𝑘 − 𝑟𝑟1 𝑥𝑥 𝑘𝑘−1 − 𝑟𝑟2 𝑥𝑥 𝑘𝑘−2 − ⋯ − 𝑟𝑟𝑘𝑘 = 0  The sequence 𝑎𝑎𝑛𝑛 with 𝑎𝑎𝑛𝑛 = 𝑥𝑥 𝑛𝑛 is a solution if and only if 𝑥𝑥 is a solution to the characteristic equation. © S. Turaev, CSC 1700 Discrete Mathematics 15
  • 16. Linear Homogeneous Recurrence Relations Theorem: If the characteristic equation 𝑥𝑥2 − 𝑟𝑟1 𝑥𝑥 − 𝑟𝑟2 = 0 of the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 has two distinct roots, 𝑥𝑥1 and 𝑥𝑥2, then 𝑎𝑎𝑛𝑛 = 𝑝𝑝𝑥𝑥1 𝑛𝑛 + 𝑞𝑞𝑥𝑥2 𝑛𝑛 where 𝑝𝑝 and 𝑞𝑞 depend on the initial conditions, is the explicit formula for the sequence. © S. Turaev, CSC 1700 Discrete Mathematics 16
  • 17. Linear Homogeneous Recurrence Relations Theorem: If the characteristic equation 𝑥𝑥2 − 𝑟𝑟1 𝑥𝑥 − 𝑟𝑟2 = 0 of the recurrence relation 𝑎𝑎𝑛𝑛 = 𝑟𝑟1 𝑎𝑎𝑛𝑛−1 + 𝑟𝑟2 𝑎𝑎𝑛𝑛−2 has a single root, 𝑥𝑥, then 𝑎𝑎𝑛𝑛 = 𝑝𝑝𝑥𝑥 𝑛𝑛 + 𝑞𝑞𝑞𝑞𝑥𝑥 𝑛𝑛 where 𝑝𝑝 and 𝑞𝑞 depend on the initial conditions, is the explicit formula for the sequence. © S. Turaev, CSC 1700 Discrete Mathematics 17
  • 18. Linear Homogeneous Recurrence Relations Example 1: Find an explicit formula for the sequence defined by 𝑎𝑎𝑛𝑛 = 4𝑎𝑎𝑛𝑛−1 + 5𝑎𝑎𝑛𝑛−2 with the initial conditions 𝑎𝑎1 = 2 and 𝑎𝑎2 = 6. Example 2: Find an explicit formula for the sequence defined by 𝑏𝑏𝑛𝑛 = −6𝑏𝑏𝑛𝑛−1 − 9𝑏𝑏𝑛𝑛−2 with the initial conditions 𝑏𝑏1 = 2.5 and 𝑏𝑏2 = 4.7. Example 3 (Fibonacci sequence): Find an explicit formula for the sequence defined by 𝑓𝑓𝑛𝑛 = 𝑓𝑓𝑛𝑛−1 + 𝑓𝑓𝑛𝑛−2 with the initial conditions 𝑓𝑓0 = 0 and 𝑓𝑓1 = 1. © S. Turaev, CSC 1700 Discrete Mathematics 18