You are on page 1of 6

INSTITUT TEKNIKAL JEPUN MALAYSIA

JABATAN TENAGA MANUSIA


KEMENTERIAN SUMBER MANUSIA
INSTITUT TEKNIKAL JEPUN MALAYSIA
MALAYSIA

INFORMATION SHEET
CODE AND
J12 DIPLOMA IN COMPUTER ENGINEERING TECHNOLOGY
PROGRAM
NAME
CODE AND
DKB3204 DISCRETE MATHEMATICS
COURSE NAME

TOPIC 4.0 INDUCTION AND RECURSION

Upon completion of this course students should be able to :


Describe the discrete structures and techniques which can be
COURSE CLO 1
used for solving problems in computing effectively.
LEARNING Identify problems which can be solved using discrete structures
OBJECTIVE CLO 2
and techniques.
Apply the basic of mathematical reasoning, discrete structures,
CLO 3
applications and modeling appropriately.

4.1 UNDERSTAND MATHEMATICAL INDUCTION


Suppose that we have an infinite ladder, as shown in Figure 1, and we want to know whether we
can reach every step on this ladder. We know two things:
1. We can reach the first rung of the ladder.
2. If we can reach a particular rung of the ladder, then we can reach the next rung.

Can we conclude that we can reach every rung? By (1), we


know that we can reach the first rung of the ladder.
Moreover, because we can reach the first rung, by (2), we
can also reach the second rung; it is the next rung after the
first rung. Applying (2) again, because we can reach the
second rung, we can also reach the third rung. Continuing
in this way, we can show that we can reach the fourth rung,
the fifth rung, and so on.

For example, after 100 uses of (2), we know that we can


reach the 101st rung. But can we conclude that we are able
to reach every rung of this infinite ladder? The answer is
yes, something we can verify using an important proof
technique called mathematical induction. That is, we can
show that P(n) is true for every positive integer n, where
P(n) is the statement that we can reach the nth rung of the
ladder. Mathematical induction is an extremely important
1
proof technique that can be used to prove assertions of this type. Mathematical induction is used
extensively to prove results about a large variety of discrete objects. For example, it is used to
prove results about the complexity of algorithms, the correctness of certain types of computer
programs, theorems about graphs and trees, as well as a wide range of identities and inequalities.

Mathematical Induction can be used to prove the statement that P (n) is true for all
positive integers n, where P(n) is a propositional function.

4.1.1 Describe Mathematical Induction

A proof by mathematical Induction has two steps which is ;


 Basis Steps : We shows that P(1) is true
 Inductive Steps : We shows that for all positive integers k,
If P(k) is true, then P (k+1) is true. ( P(k )  Pk  1 )

4.1.2 Use Mathematical Induction to prove propositional function

Example 1 : Show that if n is a positive integer, then


nn  1
1  2  ....  n 
2
Solution:
nn  1
Let P(n) be the proposition that the sum of the first n positive integer is
2
1 1  1
 Basis Steps : P(1) is true, because 1 
2
 Inductive Steps : Show that P(k )  Pk  1
a. Inductive Hypothesis : Assume that P(k) is true,
k k  1
1  2  ....  k  ,
2
b. Show that Pk  1 is true,

1  2  ....  k  k  1 
k  1k  1  1
2

k  1k  2
2
Under the assumption of P(k), we add (k+1) to both side
k k  1
1  2  ....  k  k  1   k  1
2
k k  1  2k  1

2

k  1k  2
2

By Mathematical Induction, we know that P(n) is true for all positive integers n. So, we
nn  1
had shown that 1  2  ....  n  for all positive integers n.
2

2
Example 2 : Show that if n is a positive integer, then

nn  12n  1
12  2 2  ....  n 2 
6

Solution:
Let P (n) be the proposition that the sum of the first n2 positive integer is

nn  12n  1
6

 Basis Steps : P(1) is true, because,


1 1  1 21  1
12 
6
11
LHS  RHS

 Inductive Steps : Show that P(k )  Pk  1


a. Inductive Hypothesis : Assume that P(k) is true,
k k  12k  1
12  2 2  ....  k 2 
6
b. Show that Pk  1 is true,

12  2 2  ....  k 2  k  1 
2 k  1k  1  1 2k  1  1
6

k  1k  22k  3
6
2
Under the assumption of P (k), add (k+1) to both side
k k  12k  1
12  2 2  ....  k 2  k  1   k  1
2 2

6
k k  12k  1  6k  1
2

6

k  1 k 2k  1  6k  1
6



k  1 2k  k  6k  6
2

6

k  1k  22k  3
6

By Mathematical Induction, we know that P(n) is true for all positive integers n.
nn  12n  1
So, we had shown that 12  2 2  ....  n 2  for all positive integers n.
6

3
Example 3 : Prove n < 2n for all positive integers n.

Solution :
Assume P(n) : n < 2n
 Basis Step: P(1) is true, because 1 < 21 = 2 (obvious)
 Inductive Step: Show that P(k )  Pk  1
a) Inductive Hypothesis: Assume that P(k) is true,

 k < 2k is true

b) Show P(k+1) is true which is ;


 k + 1 < 2 k+1
Add 1 to both sides

k+1<2k+1
< 2 k+ 2 k Note that;
= 2 1  1
k 1  2k

= 2  2k
= 2 k+1

By Mathematical Induction, we know that P(n) is true for all positive integers n.

So, we had shown that n < 2n is true for all positive integers n.

4
4.2 Understand Recursion
4.2.1 Describe the recursive definition.

 Sometimes it is difficult to define an object explicitly; however it may be easy to


define the object in terms of itself. This process is called recursion.
 We can use recursion to define sequences, function and sets.
Recursively Defined Functions
 A definition that specifies an initial set of value and a rule for obtaining the
value at integer from its values at smaller integers.
 Also called inductive definitions
 Two steps to define a function on the set of nonnegative integers :

 Basis Steps : Specify the value of the function at 0


 Recursive Steps: Give a rule for finding its value at an integer from its
values at smaller.

Example 1: Suppose that f is defined recursively by

f 0  3
f n  1  2 f n   3

Find f 1, f 2, f 3 and f 4 .

Solution:
From the recursive definition it follows that;
f 1  2 f 0   3  2  3  3  9
f 2   2 f 1  3  2  9  3  21
f 3  2 f 2   3  2  21  3  45
f 4   2 f 3  3  2  45  3  93

Example 2: Suppose that f is defined recursively by

f 0  1
f n  1  f n   f n   1
2

Find f 1, f 2, f 3 and f 4 .

Solution:
From the recursive definition it follows that;
f 1  f 0  f 0  1  1  1  1  3
2

f 2  f 1  f 1  1  9  3  1  13


2

f 3  f 2  f 2  1  169  13  1  183


2

f 4  f 3  f 3  1  33489  183  1  33673


2

5
Example 3:
The function f(n) = n! for natural numbers n can be defined recursively as follows:

Basis : f(0) = 0! = 1
Recursive : For all natural number n, f(n+1) = (n+1) f(n).

Using this definition, 3! can be found as follows:

Since 0! = 1, 1 ! = 1 * 0 ! = 1 * 1 = 1 ,
Hence 2! = 2 * 1 ! = 2 * 1 = 2 .
Hence 3! = 3 * 2 ! = 3 * 2 * 1 = 6 .

Example 4
Determine the recursive definition of the sequence a n ,n = 1, 2, 3.. if

a) a n  4n  2

b) a n  10 n

Solution:
b) a n  10 n
a) a n  4n  2 a n 1  10 n 1
 10 n  101
a n 1  4n  1  2
 4n  4  2 We know that , a n  10 n
 4n  2
a n 1  10 n  101
From an = 4n – 2
 10a n
4n = an + 2
Thus,
Therefore a n 1  10a n for n  1 and a1  10
a n 1  a n  2  2
 an  4

Therefore, a n 1  a n  4 for n  1

You might also like