Docsity

Solved Exercise for Algorithms | CSCD 320, Assignments of Algorithms and Programming

Toggle sidebar
bg1
Exercise on Mathematical Induction Timothy Rolfe
Solution
DUE: Tuesday, 16 January 2007
Suggested by Ian Parberry and William Gasarch, Problems in Algorithms; Second Edition
(2002), p. 8 (Section 2.1, Problem 4 — revised):
Prove by induction: S(n) =
n
j
nnn
jj
1
3
21
1
This can be represented as the following recurrence:
For n = 0, S(n) = 0
For n > 0, S(n) = S(n–1) + n ( n + 1 )
Note that
3
11
)1(
nnn
nS
(1) Basis: S(0) = 0 · 1 ·2 / 6 = 0 / 6 = 0
(2) Induction:
Hint: You may find it convenient to drive your induction by assuming the formula for S(n-1),
and then proving S(n).
)(nS
1)1( nnnS
Recurrence
1
3
3
3
11
nn
nnn
Substitute the inductive
hypothesis
31
3
)1(
n
nn
Factor out
3
1nn
3
21
nnn
Simplify — and QED
Printed 2020-12 月-05 at 21:29

Partial preview of the text

Download Solved Exercise for Algorithms | CSCD 320 and more Assignments Algorithms and Programming in PDF only on Docsity!

Exercise on Mathematical Induction Timothy Rolfe

Solution

DUE: Tuesday, 16 January 2007 Suggested by Ian Parberry and William Gasarch, Problems in Algorithms ; Second Edition (2002), p. 8 (Section 2.1, Problem 4 — revised):

Prove by induction: S(n) = ^ ^

n j n n n 1 j^ j 3

This can be represented as the following recurrence:  For n = 0, S(n) = 0  For n > 0, S(n) = S( n –1) + n ( n + 1 ) Note that

n n n S n (1) Basis: S(0) = 0 · 1 ·2 / 6 = 0 / 6 = 0 (2) Induction: Hint: You may find it convenient to drive your induction by assuming the formula for S( n -1 ) , and then proving S( n ).

S ( n )  S ( n  1 )  n  n  1  Recurrence

n n n n n Substitute the inductive hypothesis

3 ( 1 )     n n n Factor out

n n  1

n n n Simplify — and QED Printed 2020-12 月-05 at 21: