Introduction
Recursive Definitions and
Counting
Discrete Mathematics
Andrei Bulatov
Discrete Mathematics  Recursive Definitions and Counting
222
Previous Lecture
Strong induction
Induction and well ordering
Recursively defined functions
Discrete Mathematics – Recursive Definitions and Counting
223
Recursively Defined Functions
Induction mechanism can be used to define things.
To define a function
f:
N
→
R
we complete two steps:
Basis step:
define
f(1)
Inductive step:
For all
k
define
f(k + 1)
as a function of
f(k),
or,
more general,
as a function of
f(1), f(2), … , f(k).
Give a recursive definition of
f(n) =
Basis step:
f(0) = 1
Inductive step:
f(k + 1) = 2
⋅
f(k).
n
2
Discrete Mathematics – Recursive Definitions and Counting
224
Factorial
Another useful recursively defined function is factorial
f(n) = n!
Basis step:
0! = 1
Inductive step:
(k + 1)! = k!
⋅
(k + 1)
n
n!
0
1
2
3
4
1
1
2
6
24
n
n!
5
6
7
8
9
120
720
5040
40320
362880
Discrete Mathematics – Recursive Definitions and Counting
225
Fibonacci Numbers
Usually, Fibonacci numbers are thought of as a sequence of natural
numbers, but as we know such a sequence can also be viewed as a
function from
N
.
F(n)
Basis step:
F(1) = F(2) = 1
Inductive step:
F(k + 1) = F(k) + F(k – 1)
n
1
2
3
4
5
6
7
8
9
10
11
12
13
F(n)
1
1
2
3
5
8
13
21
34
55
89
144 233
Binet’s formula
5
)
1
(
)
(
n
n
n
F
ϕ
ϕ


=
where
ϕ
is the
golden ratio
49
6180339887
.
1
2
5
1
≈
=
ϕ
Discrete Mathematics  Recursive Definitions and Counting
226
Recursively Defined Sets and Structures
Induction can be used to define structures
We need to complete the same two steps:
Basis step:
Define the simplest structure possible
Inductive step:
A rule, how to build a bigger structure from smaller
ones.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Discrete Mathematics  Recursive Definitions and Counting
227
Well Formed Propositional Statements
What is a well formed statement?
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '10
 AndreiBulatov
 Combinatorics, Mathematical Induction, Recursion, Natural number

Click to edit the document details