Induction and
Recursion
1

2
Sequences
A
sequence
is a function whose domain is either all integers
greater than or equal to a given integer, or all integers
between two given integers.
…
, …
1, 2, 4, 8, 16
0,5,8,17,24,37…
s
1
,
s
2
,
s
3
s
0
,
s
1
,
s
2
s
1
,
s
2
,
s
3
, …,
s
n
−
1
,
s
n
…
1/2,1/3,1/4,1/5,1/6,…
i
2
+ (
−
1)
i
Sequences in mathematics

3
Summation Notation
the index
the lower limit
the upper limit
n
∑
k
=
m
a
k
=
a
m
+
a
m
+1
+ … +
a
n
k
m
n
4
∑
i
=0
2
i
= 2
0
+ 2
1
+ 2
2
+ 2
3
+ 2
4
= 1 + 2 + 4 + 8 + 16 = 31
Summation Notation

4
Summation Properties
Exercise: (once we define summation recursively) Prove
these.
n
∑
k
=
m
a
k
+
n
∑
k
=
m
b
k
=
n
∑
k
=
m
(
a
k
+
b
k
)
n
∑
k
=
m
c
⋅
a
k
=
c
n
∑
k
=
m
a
k
Summation Properties

5
Recursive Definition of Summation
and
Pay attention! We will use this identity a lot.
Exercise: write recursive and non recursive code to
compute the summation.
a
∑
i
=
a
s
i
=
s
a
n
∑
i
=
a
s
i
=
n
−
1
∑
k
=
m
s
i
+
s
n
Recursive Definition of Summation

6
Change of Variables
From
Change variable to where
.
5
∑
k
=1
(
k
−
1)
j
j
=
k
−
1
4
∑
j
=0
j
.
Manipulation of Variables

7
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut

8
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut
The first and last sum to
n
+ 1

9
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut
The first and last sum to
n
+ 1
The second and second last sum
to
n
+ 1

10
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut
The first and last sum to
n
+ 1
The second and second last sum
to
n
+ 1
The third and third last sum to
n
+ 1

11
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut
The first and last sum to
n
+ 1
The second and second last sum
to
n
+ 1
The third and third last sum to
n
+ 1
The fourth and fourth last
sum to
n
+ 1

12
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut
The first and last sum to
n
+ 1
The second and second last sum
to
n
+ 1
The third and third last sum to
n
+ 1
The fourth and fourth last
sum to
n
+ 1
If
is even, you
can do this
times,
giving a sum of
n
n
/2
n
⋅
(
n
+ 1)
2

13
The sum of the numbers from 1 to n
Write out the first few and last few terms of the summation
as follows
1 + 2 + 3 + 4 + … + (
n
−
3) + (
n
−
2) + (
n
−
1) +
n
An old chestnut
The first and last sum to
n
+ 1
The second and second last sum
to
n
+ 1
The third and third last sum to
n
+ 1
The fourth and fourth last
sum to
n
+ 1
If
is even, you
can do this
times,
giving a sum of
n
n
/2
n
⋅
(
n
+ 1)
2
If
is odd, you can do
this
times,
and the number
remaining in the middle

#### You've reached the end of your free preview.

Want to read all 62 pages?

- Spring '14