chapter 4 dis 2011

16
Page | 1 COURSE LEARNING OUTCOMES: apply mathematical knowledge in choosing the appropriate solutions in mathematics. (C3)

Upload: noraidawati

Post on 27-Jun-2015

365 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Chapter 4 dis 2011

Page | 1

COURSE LEARNING OUTCOMES:

apply mathematical knowledge in choosing the appropriate solutions in mathematics. (C3)

Page 2: Chapter 4 dis 2011

Induction

– A mathematical strategy for proving statements about large sets of things

Recursion

– a programming strategy for solving large problems

– Think “divide and conquer”

– Solve large problem by splitting into smaller problems of same kind

Page | 2

INDUCTION AND RECURSION

4.1 Understand mathematical induction4.1.1 Describe the mathematical induction.4.1.2 Use the mathematical induction to prove the propositional

functions.

4.2 Understand recursion4.2.1 Describe the recursive definition.4.2.2 Solve problem by using the recursive definition.4.2.3 Apply the mathematical induction to prove the recursive

function

Page 3: Chapter 4 dis 2011

INDUCTION

Mathematical induction is a method of mathematical proof typically used to establish that a given statement is true of all natural

numbers (positive integers). It is done by proving that the first statement in the infinite sequence of statements is true, and then proving that if any one statement in the infinite sequence of statements is true, then so is the next one.

The simplest and most common form of mathematical induction proves that a statement involving a natural number n holds for all values of n. The proof consists of two steps:

1. The basis (base case): showing that the statement holds when n is equal to the lowest value that n is given in the question. Usually, n = 0 or n = 1.

2. The inductive step: showing that if the statement holds for some n, then the statement also holds when n + 1 is substituted for n.

The assumption in the inductive step that the statement holds for some n is called the induction hypothesis (or inductive hypothesis). To perform the inductive step, one assumes the induction hypothesis and then uses this assumption to prove the statement for n + 1. (Wikipedia)

This method works by first proving the statement is true for a starting value, and then proving that the process used to go from one value to the next is valid. If these are both proven, then any value can be obtained by performing the process repeatedly. It may be helpful to think of the domino effect; if one is presented with a long row of dominoes standing on end, one can be sure that:

1. The first domino will fall2. Whenever a domino falls, its next neighbor will also fall,

so it is concluded that all of the dominoes will fall, and that this fact is inevitable.

Page | 3

A method of proof

It does not generate answers: it only can prove them

Page 4: Chapter 4 dis 2011

THE PRINCIPLE OF MATHEMATICAL INDUCTION

Consider the following series

1 = 12

1 + 3 = 22

1 + 3 + 5 = 32

1 + 3 + 5 + 7 = 42

1 + 3 + 5 + 7 + …. + (2n-1) = n2

Note : Mathematical induction cannot be used to prove whose variables are not positive integers.For instance : it is a serious mistakes to prove the identityx3 – 1 = (x - 1)(x2 + x + 1), for all xÎR.

Page | 4

Page 5: Chapter 4 dis 2011

Examples of Proofs by Mathematical Induction

EXAMPLE 1

Show that if n is a positive integer, then

SOLUTION:

1) BASIS STEP: P(1) is true, because 1 =

2) INDUCTIVE STEP:

For the inductive hypothesis, assume that P(k) is true for any positive (+ve) integer k.

Under this assumption, it must be shown that P(k+1) is true, i.e.:

When we add k+1 to both sides of the equation in P(k), we obtain

This shows that P(k+1) is true under the assumption that P(k) is true. This complete the inductive step.

Page | 5

Page 6: Chapter 4 dis 2011

PROVING A DIVISIBILITY PROPERTY BY MATHEMATICAL INDUCTION

a) Use mathematical induction to prove that n3 – n is divisible by 3 whenever n is a positive integer.

P(n) = n3 – n is divisible by 3

SOLUTION:

1) BASIS STEP: P(1): 13 – 1 = 0 is divisible by 3 is true 2) INDUCTIVE STEP:

Assume that P(k) is true(inductive hypothesis); that is k3 – k is divisible by 3. Show the statement (k+1)3 – (k+1) is also divisible by 3.

If P (n) is true then P (n+1) is true for each positive integer

(k+1)3 – (k+1) = (k3 + 3k2 + 3k + 1) – (k + 1) = (k3 + 3k2 + 3k + 1 – k – 1) = (k3 – k) + 3(k2 + k)

divisible by 3 divisible by 3

By inductive hypothesis, we know that (k3 – k) is divisible by 3; and the second term is also divisible by 3. This completes the inductive step.

b) Prove by mathematical induction that 8n - 3n is divisible by 5 for all positive integers n.

SOLUTION:Let P(n) be the proposition 8n - 3n is divisible by 5 .

1) BASIS STEP: When n = 1; P(1): 81 - 31 = 5 which is divisible by 5. ∴ P(1) is true.

2) INDUCTIVE STEP: Assume P(k) is true for any positive integer k.

i.e. 8k - 3k = 5N, where N is an integer.

When n = k + 1

8k+1 - 3k+1

=8×8k-3×3k

=8×8k-3×3k-5×3k + 5×3k

=8×8k-8×3k + 5×3k

=8(8k-3k) + 5×3k

Page | 6

Page 7: Chapter 4 dis 2011

=8(5N) + 5×3k

=5(8N + 3k) which is divisible by 5

∴ P(n) is true for n = k + 1 if n = k is true . By M.I., P(n) is true for all +ve integer.

Page | 7

Page 8: Chapter 4 dis 2011

PROVING INEQUALITIES BY MATHEMATICAL INDUCTION

a) Prove that n < 2n for all positive integer n. Let P(n)=(n<2n)

1) Base case: P(0)=(0<20)=(0<1)=T.2) Inductive step: if P(n) is true then P(n+1) is true for each n

• Assuming n<2n is true, prove n+1 < 2n+1is also truen + 1 < 2n + 1 (by inductive hypothesis) < 2n + 2n (because 1<2=2×20≤≤2×2n-1= 2n) = 2n+1

So n + 1 < 2n+1

b) For all integers n≥4, prove that2n < n! . (P(n))

Proof (by induction):

Page | 8

Page 9: Chapter 4 dis 2011

1) Basis step: The statement is true for n=4: (P(4))

24 = 16 < 24 = 4! .2) Inductive step:

Assume the statement is true for some k≥4 ; (P(k))show that it is true for k+1 . (P(k+1))

We are given that P(k): 2k < k! (1) We need to show:

P(k+1): 2k+1 < (k+1)! (2) 2k+1 = 2·2k

< 2·k! (based on (1)) < (k+1)·k! (since k≥4)

= (k+1)!Thus, P(n) is true by induction

EXAMPLE 4

Show that the sum of the first n odd integers is n2

SOLUTION

Example: If n = 5, 1+3+5+7+9 = 25 = 52

Formally, show:

1) Base case: Show that P(1) is true

Page | 9

11

11)(21

1

2

i

i)1P(

n

i

ni1

212 )P( where)P( nnn

Page 10: Chapter 4 dis 2011

2) Inductive hypothesis: assume true for k. Thus, we assume that P(k) is true,

– Note: we don’t yet know if this is true or not!3) Inductive step: show true for k+1.

o Recall the inductive hypothesis:

o Proof of inductive step:

EXAMPLE 5

Show

1) Base case: n = 1 ; Show that P(1) is true

2) Inductive hypothesis: assume that P(k) is true

3) Inductive step: show that P(k+1) is truePage | 10

12121)1(2 2

1

kkikk

i

121)1(2 22 kkkk

1212 22 kkkk

21

1

)1(12

kik

i

Page 11: Chapter 4 dis 2011

Exercise:

Page | 11

Page 12: Chapter 4 dis 2011

RECURSION

We can use recursion to define: functions, sequences, sets.

Find f(1), f(2), f(3), and f(4), where f(0) = 1

a) Let f(n+1) = f(n) + 2f(1) = f(0) + 2 = 1 + 2 = 3f(2) = f(1) + 2 = 3 + 2 = 5f(3) = f(2) + 2 = 5 + 2 = 7

Page | 12

Page 13: Chapter 4 dis 2011

f(4) = f(3) + 2 = 7 + 2 = 9

b) Let f(n+1) = 3f(n)f(1) = 3 * f(0) = 3*1 = 3f(2) = 3 * f(1) = 3*3 = 9f(3) = 3 * f(2) = 3*9 = 27f(4) = 3 * f(3) = 3*27 = 81

c) Let f(n+1) = 2f(n)

f(1) = 2f(0) = 21 = 2f(2) = 2f(1) = 22 = 4f(3) = 2f(2) = 24 = 16f(4) = 2f(3) = 216 = 65536

d) Let f(n+1) = f(n)2 + f(n) + 1f(1) = f(0)2 + f(0) + 1 = 12 + 1 + 1 = 3f(2) = f(1)2 + f(0) + 1 = 32 + 3 + 1 = 13f(3) = f(2)2 + f(0) + 1 = 132 + 13 + 1 = 183f(4) = f(3)2 + f(0) + 1 = 1832 + 183 + 1 = 33673

FIBONACCI SEQUENCE

Exercise

Page | 13