Professional Documents
Culture Documents
Unit2 2022 finalmoduleforITMS-01 Withwatermark PDF
Unit2 2022 finalmoduleforITMS-01 Withwatermark PDF
Discrete Structures
UNIT II. RECURSION AND OTHER SEQUENCES
Overview
Recursive sequences such as Fibonacci numbers, Lucas numbers, Tribonacci
numbers, Bernoulli numbers and the Collatz sequence aim to provide a more sophisticated
understanding of numbers arranged in patterns. These patterns are reflected in nature.
Learning Objectives
At the end of the unit, I am able to:
1. understand recursion; and
2. apply the concept of recursion in dealing with things and experiences around me.
Setting Up
Have you ever wondered how numbers arranged in sequence can represent patterns in
nature?
Lesson Proper
Recursion
A recursive sequence is a sequence of the form
𝑎! , 𝑎! , 𝑎! , … , 𝑎! , …
and satisfies the following two conditions;
1) A number of terms of the sequence
𝑎! , 𝑎! , 𝑎! , … , 𝑎!
are given. These are the initial values.
2) A rule called recursion is given, which explains how 𝑎! is to be computed in terms
of previous terms in the sequence, if 𝑛 > 𝑟.
The terms of a recursive sequence can be numbers, graphs and other objects.
26
ITMS-01 Discrete Structures
27
ITMS-01 Discrete Structures
28
ITMS-01 Discrete Structures
29
ITMS-01 Discrete Structures
30
ITMS-01 Discrete Structures
Example
Find the Bernoulli numbers 𝐵! , 𝐵! , 𝐵! , 𝑎𝑛𝑑 𝐵! .
When 𝑛 = 1, then
𝐵! + 2𝐵! = 0
(We can also refer to the figure above and get the equation in the second row.)
By substituting 𝐵! = 1 in our equation, we have,
1 + 2𝐵! = 0
2𝐵! = −1
1
𝐵! = −
2
!
𝐵! = − corresponds to the first Bernoulli number.
!
Let us consider the equation in the third row of the figure:
𝐵! + 3𝐵! + 3𝐵! = 0
1
1 + 3 − + 3𝐵! = 0
2
3
1 + − + 3𝐵! = 0
2
2−3
+ 3𝐵! = 0
2
1
− + 3𝐵! = 0
2
1
3𝐵! =
2
1
𝐵! =
6
!
𝐵! = corresponds to the second Bernoulli number.
!
31
ITMS-01 Discrete Structures
Let us consider the equation in the fourth row of the figure:
𝐵! + 4𝐵! + 6𝐵! + 4𝐵! = 0
1 1
1 + 4 − + 6 + 4𝐵! = 0
2 6
1 + (−2) + 1 + 4𝐵! = 0
2 + (−2) + 4𝐵! = 0
0 + 4𝐵! = 0
4𝐵! = 0
𝐵! = 0
𝐵! = 0 corresponds to the third Bernoulli number.
Let us consider the equation in the fifth row of the figure:
𝐵! + 5𝐵! + 10𝐵! + 10𝐵! + 5𝐵! = 0
1 1
1 + 5 − + 10 + 10 0 + 5𝐵! = 0
2 6
5 10
1 + − + + 0 + 5𝐵! = 0
2 6
6 − 15 + 10
+ 5𝐵! = 0
6
16 − 15
+ 5𝐵! = 0
6
1
+ 5𝐵! = 0
6
1
𝐵! = −
30
!
𝐵! = − corresponds to the fourth Bernoulli number.
!"
32
ITMS-01 Discrete Structures
Lesson 5 Collatz Sequence
The Collatz sequence was created by the German mathematician named Lothar
Collatz. It is also known as the 𝟑𝒙 + 𝟏 sequence.
We need to first assume a positive integer for the initial value denoted by 𝐶 0 .
Then the Collatz sequence is recursively defined by:
3𝐶 𝑛 + 1 , 𝑖𝑓 𝐶 𝑛 𝑖𝑠 𝑜𝑑𝑑
𝐶 𝑛+1 =
𝐶 𝑛
, 𝑖𝑓 𝐶 𝑛 𝑖𝑠 𝑒𝑣𝑒𝑛
2
Note that computing terms will stop whenever the value of 𝟏 is reached.
Example
Find the Collatz sequence when 𝐶 0 = 5.
Solution:
𝐶 0 = 5 , odd
𝐶 1 = 3 5 + 1 = 15 + 1 = 16 , even
!"
𝐶 2 = = 8 , even
!
!
𝐶 3 = = 4 , even
!
!
𝐶 4 = = 2 , even
!
!
𝐶 5 = = 𝟏 , STOP!!!
!
Thus, the Collatz sequence is 5, 16, 8, 4, 2 , 1 .
33
ITMS-01 Discrete Structures
Example
Find the Collatz sequence when 𝐶 0 = 13.
Solution:
𝐶 0 = 13 , odd
𝐶 1 = 3 13 + 1 = 39 + 1 = 40 , even
!"
𝐶 2 = = 20 , even
!
!"
𝐶 3 = = 10 , even
!
!"
𝐶 4 = = 5 , odd
!
𝐶 5 = 3 5 + 1 = 15 + 1 = 16 , even
!"
𝐶 6 = = 8 , even
!
!
𝐶 7 = = 4 , even
!
!
𝐶 8 = = 2 , even
!
!
𝐶 9 = = 𝟏 , STOP!!!
!
Thus, the Collatz sequence is 13, 40, 20, 10, 5, 16, 8, 4, 2 , 1 .
But there is one question we must address before we can move further with the Collatz
sequence, and that is;
“Does the Collatz sequence always reach 1 after a finite number of steps?”
Before we answer this question, let us first define the 𝟓𝒙 + 𝟏 sequence.
We need to set a positive integer for the initial value 𝐶 0 . Then we can solve for the
succeeding numbers of the sequence recursively defined by:
5𝐶 𝑛 + 1 , 𝑖𝑓 𝐶 𝑛 𝑖𝑠 𝑜𝑑𝑑
𝐶 𝑛+1 =
𝐶 𝑛
, 𝑖𝑓 𝐶 𝑛 𝑖𝑠 𝑒𝑣𝑒𝑛
2
34
ITMS-01 Discrete Structures
Example
Let’s take 𝐶 0 = 33.
Solution:
𝐶 0 = 33 , odd
𝐶 1 = 5 33 + 1 = 165 + 1 = 166 , even
!""
𝐶 2 = = 83 , odd
!
𝐶 3 = 5 83 + 1 = 415 + 1 = 416 , even
!"#
𝐶 4 = = 208 , even
!
!"#
𝐶 5 = = 104 even
!
!"#
𝐶 6 = = 52 , even
!
!"
𝐶 7 = = 26 , even
!
!"
𝐶 8 = = 13 , odd
!
𝐶 9 = 5 13 + 1 = 65 + 1 = 66 , even
!!
𝐶 10 = = 33 ,
!
The sequence will repeat itself on the 10th term, thus the Collatz sequence is:
33, 166, 83,416, 208, 104, 52, 26, 13,66 .
Using the 5𝑥 + 1 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒, can you verify what would happen if we set 𝐶 0 = 13?
Will it be the same Collatz sequence as that of the last example?
Can you now answer our question:
“Does the Collatz sequence always reach 1 after a finite number of steps?”
35
ITMS-01 Discrete Structures
References
Cargal, J.M., Discrete Mathematics for Neophytes: Number Theory, Probability,
Algorithms, and Other Stuff
http://www.math.northwestern.edu
Lipschutz, Seymour Ph.D., Lipson, Marc Ph.D., Schaum’s Outlines DISCRETE
MATHEMATICS, Third Edition 2007.
Cruz, Rebecca J. and Tandingan, Glenda R., Simplified Discrete Mathematics, 2012 Edition.
Ymas, Sergio Jr E., Lopez, Joseph P., DISCRETE MATHEMATICS, 2009 Edition.
36
ITMS-01 Discrete Structures
Assessing Learning
Activity 1
Name: __________________________________________________ Score: ________________
Course/Year/Section: _______________________________ Date: _________________
Directions: Show complete solution. Encircle your final answer.
1) Compute the Fibonacci sequence where 9 ≤ 𝑛 ≤ 21.
2) What is the position 𝑛 of the Fibonacci number equal to 2,584?
37
ITMS-01 Discrete Structures
Activity 2
Name: __________________________________________________ Score: ________________
Course/Year/Section: _______________________________ Date: _________________
Directions: Show complete solution. Encircle your final answer.
1) Compute the Lucas sequence where 9 ≤ 𝑛 ≤ 17.
2) What is the position 𝑛 of the Lucas number equal to 5,778?
38
ITMS-01 Discrete Structures
Activity 3
Name: __________________________________________________ Score: ________________
Course/Year/Section: _______________________________ Date: _________________
Directions: Show complete solution. Encircle your final answer.
1) Compute the Tribonacci sequence where 9 ≤ 𝑛 ≤ 17.
2) What is the position 𝑛 of the Tribonacci number equal to 10,609?
39
ITMS-01 Discrete Structures
Activity 4
Name: __________________________________________________ Score: ________________
Course/Year/Section: _______________________________ Date: _________________
Directions: Show complete solution. Encircle your final answer.
1) Solve for the seventh Bernoulli number.
40
ITMS-01 Discrete Structures
41
ITMS-01 Discrete Structures
Activity 5
Name: __________________________________________________ Score: ________________
Course/Year/Section: _______________________________ Date: _________________
Directions: Show complete solution. Encircle your final answer.
1) Solve for the Collatz sequence when 𝐶 0 = 16 using the 3𝑥 + 1 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒.
42
ITMS-01 Discrete Structures
43