320 03 More Induction
320 03 More Induction
320 03 More Induction
CSC 320
is done at
11:30 so I
did NOT
fill in the
box for
11:30 for
our class.
1
CSC 320: Proof of the Day
Definition: for functions f and g which map
the natural numbers to real values, the function
f(n) is in O(g(n)) if there exists constants c 0
and no ≥ 0 such that for all
n ≥ n 0, f(n) ≤ c ۰g(n).
2
You will learn a lot more if you try the problems and get them
wrong than if you do not try. Also, it helps me know where the
class is in terms of understanding.
3
Announcements
Note: you don’t have to wait until the tutorial if you have
questions. Ask me or send me e-mail.
4
Meaning of notation (translation to code):
sum= 0;
for (i=c; i ≤ n; i++)
sum= sum + f(i);
The value of the expression is sum at the
termination of this loop.
5
Some students did not include limits and others omitted
the name of the summation variable on the summations.
This means that what you wrote is not properly defined.
(a) (c)
(b) (d)
6
Natural Numbers
= { 0, 1, 2, 3, 4, … }
Inductive Definition:
[Basis] 0 is in the set
[Inductive step]:
If k is in
then k+1 is in
7
The idea behind the simplest form of an induction proof:
If we prove:
8
k
Theorem S(k): Σ 2i =
2 k+1 - 1
i=0
Proof:
[Basis] When k=0, Σi=0 to k 2i = 20 = 1 and
2k+1 – 1 = 20+1 -1 =1 so this formula is correct for k=0.
Note: the induction hypothesis which I will use for
this proof is the statement (hypothesis since we have
not finished proving it yet) S(k):
k
Σ 2i = 2k+1 - 1. We are trying to prove S(k+1).
i=0
k+1
9
S(k+1): Σ 2i =
2 (k+1)+1 - 1
[Induction step] Assume S(k) is true.
We want to prove S(k+1). Separating the sum into two
parts gives
k+1
Σ 2i = IMPORTANT: always
i=0
indicate to your reader
k where you apply the
induction hypothesis.
Σ 2i + 2k+1.
i=0
Σ 2i =
i=0
11
Common problem in solutions submitted:
Many students applied the induction hypothesis without
explaining to the reader what you were doing. You will
lose marks on the assignment if you do not explain where
you are applying the induction hypothesis.
A proof is intended for someone to read. It will be easier
for someone to understand and believe in your proof if
you explain what you are doing algebraically at every
step.
Your proof will be more elegant if you don’t change the
variable names (for this problem, stick to k instead of
switching to j or n or m or l).
12
Standard approach to an induction proof that
for all n ≥ 0, f(n)= g(n):
Proof:
[Basis] When k=0, Σi=0 to k 2i = 20 = 1 and
2k+1 – 1 = 20+1 -1 =1 so this formula is correct for k=0.
Assume that
k
Σ 2i = 2k+1 - 1. We want to prove that
i=0
k+1
Σ 2i =
2 (k+1)+1 - 1 = 2k+2 -1.
i=0
15
[Induction step] Separating the sum into two parts gives
k+1
Σ 2i =
i=0
Σ 2i + 2k+1.
i=0
By induction,
k
16
k+1
Σ 2i =
i=0
17
Induction:
I want you to:
1. Understand why it works as a proof technique.
2. Write proofs that explain clearly what you are
doing at every step (except for very simple
algebra). Be sure to mention where it is that you
apply the induction hypothesis. Everything you
write should be mathematically valid.
3. Be able to use it on novel applications (requires
understanding).
4. If you try to prove a hypothesis that is not
correct, I want you to indicate where and why
the induction proof fails. You will get zero marks
for “proofs” for incorrect statements.
5. Elegance is good (e.g. don’t put more in the base
case than you really need). 18
What is wrong with my induction proof?
In a drunken haze I decided that the solution to the
recurrence T(1)=1, T(n)= 1 + T(n-1) is
1 + 2 + 3 + … + n.
Theorem: The solution to the recurrence is n(n+1)/2.
Proof. [Basis] T(1)=1 and 1 *(1+1)/2 = 1 as required.
[Induction step] Assume that 1 + 2 + … + n-1 + n = n(n+1)/2.
We want to prove that 1 + 2 + … + n-1 + n + (n+1) = (n+1)
(n+2)/2 = (n2 +3n +2)/2.
By induction, 1 + 2 + … + n= n(n+1)/2.
So 1 + 2 + .. + n + (n+1)= n(n+1)/2 + (n+1).
Simplifying: (n2 + n + 2n + 2)/2= (n2 +3n +2)/2 as required.
19