Induction for The Natural Numbers, Introduction to Relations and Partial Functions
Recursive Definition for natural numbers : I
Can now
formally define operator Property i =
n(n n E I
aie IN
O
0 (0 + 1)
base
.
case
o = 0 7
2
base case a = [ * ai = a1
i=1 1
n+
n
-
Step case i = i +
i= 0
a
L
Step case = + an e
1)
nin n
= +
+
=
n2 + n + 2n + 2
2
S
= (n+ 1)(n + 2)
2
Functions given by recursive specifications
These arise when calculating the complexity of recursive algorithms.
, eg .,
Example : Find a functionf that satisfies base case fo = 2 Example : Find a functionf that satisfies
Step case fin + 1) =
2fn-1 base case fo = 1
base case fi = 4
-123
Step case f(n + 2) =
4fn +
3f(n + 1)
Guess >
-
fn = 2 + 1
1 24 81632 n O 1 2 3 4 5
Gress fr = yh
16 64256512
In 1 ↑
base case fo = 2
base 1
=
20 + 1 case fo =
40
2 fn
=
-1
Step case finall =
ind hyp! 4
=
2(2n + 1) -
1 base case fr =
=
24
+1
+ 2 -
1
= m
=
2n
+1
+ 1 Step case final =
4 fn + 3 f(n 1) +
= 4(yn) + 3)yn
+
1) -
ind . hyp!
+1
1)
+
= yn + 3(yn
yn 1(1 3)
+
= +
*2
=
yn
Relations
Relations are a
way of connecting elements of sets
. Example : Consider the relation R from [W ,
X
,
Y , 2) to [10 , 15 , 203 that relates
Relations between two or more sets are used in databases
w
· to 10 , 13 and 20
Crolational databases) for example to capture student records
· I to 10 and
,
with entries such as
2 to 10 and 20
(name , id number degree type degree name).
·
, ,
W 10
Notation
A relation R from a set S to set T is a subset of
Z 15
SxT , i . e . RESxT Y 20
This is sometime written as 2
R : S 1 > T
We say
in fix notation ! R is a subset
of pairs from CW ,
K
, y, 23 x 410 ,
15 , 203
(s t) E R -
Rt &(w y
or
,
R = ,
10) ,
(2 , 15) , (W , 20) , (X, 10) , (2 , 10) , (2 , 20)
or S ~t
↑
symbol to
denote relation