You are on page 1of 18

ITMS-01

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

Lesson 1 Fibonacci Numbers



- named after Leonardo Fibonacci or Leonardo of Pisa.

The Fibonacci numbers 𝑭𝒏 has the following initial values

𝐹! = 0
𝐹! = 1

and the recursion of the sequence of numbers as

𝐹! = 𝐹!!! + 𝐹!!!
whenever 𝑛 ≥ 2.

Example

Compute the Fibonacci numbers 𝐹! when 3 ≤ 𝑛 ≤ 8.

𝐹! = 0
𝐹! = 1

𝐹! = 𝐹! + 𝐹! = 1 + 0 = 1

𝐹! = 𝐹! + 𝐹! = 1 + 1 = 2

𝐹! = 𝐹! + 𝐹! = 2 + 1 = 3

𝐹! = 𝐹! + 𝐹! = 3 + 2 = 5

𝐹! = 𝐹! + 𝐹! = 5 + 3 = 8

𝐹! = 𝐹! + 𝐹! = 8 + 5 = 13

𝐹! = 𝐹! + 𝐹! = 13 + 8 = 21

Thus, the first 9 numbers of the Fibonacci sequence are 0, 1, 1, 2, 3, 5, 8, 13, 21 .

Therefore, the Fibonacci numbers 𝐹! when 3 ≤ 𝑛 ≤ 8 are 2, 3, 5, 8, 13, 21











27
ITMS-01 Discrete Structures

Lesson 2 Lucas Numbers



The Lucas numbers 𝑳𝒏 has the following initial values

𝐿! = 2
𝐿! = 1

and the recursion of the sequence of numbers as

𝐿! = 𝐿!!! + 𝐿!!!

whenever 𝑛 ≥ 2.


Example

Compute the Lucas numbers 𝐿! when 3 ≤ 𝑛 ≤ 8.

𝐿! = 2
𝐿! = 1

𝐿! = 𝐿! + 𝐿! = 1 + 2 = 3

𝐿! = 𝐿! + 𝐿! = 3 + 1 = 4

𝐿! = 𝐿! + 𝐿! = 4 + 3 = 7

𝐿! = 𝐿! + 𝐿! = 7 + 4 = 11

𝐿! = 𝐿! + 𝐿! = 11 + 7 = 18

𝐿! = 𝐿! + 𝐿! = 18 + 11 = 29

𝐿! = 𝐿! + 𝐿! = 29 + 18 = 47

Thus, the first 9 numbers of the Lucas sequence are

2, 1, 3, 4, 7, 11, 18, 29, 47 .

Therefore, the Lucas numbers 𝐿! when 2 ≤ 𝑛 ≤ 8 are

4, 7, 11, 18, 29, 47 .







28
ITMS-01 Discrete Structures

Lesson 3 Tribonnacci Numbers



The Tribonacci numbers 𝑻𝒏 has the following initial values

𝑇! = 0
𝑇! = 0
𝑇! = 1

and the recursion of the sequence of numbers as

𝑇! = 𝑇!!! + 𝑇!!! + 𝑇!!!

whenever 𝑛 ≥ 3.


Example

Compute the Tribonacci numbers 𝑇! when 3 ≤ 𝑛 ≤ 8.

𝑇! = 0
𝑇! = 0
𝑇! = 1

𝑇! = 𝑇! + 𝑇! + 𝑇! = 1 + 0 + 0 = 1

𝑇! = 𝑇! + 𝑇! + 𝑇! = 1 + 1 + 0 = 2

𝑇! = 𝑇! + 𝑇! + 𝑇! = 2 + 1 + 1 = 4

𝑇! = 𝑇! + 𝑇! + 𝑇! = 4 + 2 + 1 = 7

𝑇! = 𝑇! + 𝑇! + 𝑇! = 7 + 4 + 2 = 13

𝑇! = 𝑇! + 𝑇! + 𝑇! = 13 + 7 + 4 = 24

Thus, the first 9 numbers of the Tribonacci sequence are

0, 0, 1, 1, 2, 4, 7, 13, 24 .

Therefore, the Tribonacci numbers 𝑇! when 3 ≤ 𝑛 ≤ 8 are

1, 2, 4, 7, 13, 24 .







29
ITMS-01 Discrete Structures

Lesson 4 Bernoulli Numbers



The BERNOULLI numbers 𝑩𝒏 were named after its creator Jakob Bernoulli.

The initial value of the Bernoulli numbers is 𝐵! = 1 and the recursion of the
sequence of numbers is

𝑛+1 𝑛+1 𝑛+1
𝐵! + 𝐵! + ⋯ + 𝐵!
0 1 𝑛

When 𝑛 = 1, then

2 2
𝐵 + 𝐵 = 0
0 ! 1 !

𝐵! + 2𝐵! = 0

When 𝑛 = 2, then

3 3 3
𝐵 + 𝐵 + 𝐵 = 0
0 ! 1 ! 2 !

𝐵! + 3𝐵! + 3𝐵! = 0



When 𝑛 = 3, then

4 4 4 4
𝐵! + 𝐵! + 𝐵! + 𝐵 = 0
0 1 2 3 !

𝐵! + 4𝐵! + 6𝐵! + 4𝐵! = 0


Continuous computation in this manner, we will arrive at some sort of Pascal’s
triangle as seen in the following figure:


𝐵! = 1

𝐵! + 2𝐵! = 0

𝐵! + 3𝐵! + 3𝐵! = 0

𝐵! + 4𝐵! + 6𝐵! + 4𝐵! = 0

𝐵! + 5𝐵! + 10𝐵! + 10𝐵! + 5𝐵! = 0



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

2) Solve for the ninth Bernoulli number.


















































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

2) Solve for the Collatz sequence when 𝐶 0 = 19 using the 5𝑥 + 1 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒.


















































43

You might also like