7/28/2019 04 Relations Functions 110317075641 Phpapp02
1/223
Discrete Mathematics
Relations and Functions
H. Turgut Uyar Aysegul Gencata Yayml Emre Harmanc
2001-2013
7/28/2019 04 Relations Functions 110317075641 Phpapp02
2/223
License
c2001-2013 T. Uyar, A. Yayml, E. Harmanc
You are free:
to Share to copy, distribute and transmit the work
to Remix to adapt the work
Under the following conditions:
Attribution You must attribute the work in the manner specified by the author or licensor (but not in anyway that suggests that they endorse you or your use of the work).
Noncommercial You may not use this work for commercial purposes.
Share Alike If you alter, transform, or build upon this work, you may distribute the resulting work onlyunder the same or similar license to this one.
Legal code (the full license):http://creativecommons.org/licenses/by-nc-sa/3.0/
http://creativecommons.org/licenses/by-nc-sa/3.0/http://creativecommons.org/licenses/by-nc-sa/3.0/7/28/2019 04 Relations Functions 110317075641 Phpapp02
3/223
Topics
1 RelationsIntroduction
Relation PropertiesEquivalence Relations
2 FunctionsIntroductionPigeonhole PrincipleRecursion
7/28/2019 04 Relations Functions 110317075641 Phpapp02
4/223
Topics
1 RelationsIntroduction
Relation PropertiesEquivalence Relations
2 FunctionsIntroductionPigeonhole PrincipleRecursion
7/28/2019 04 Relations Functions 110317075641 Phpapp02
5/223
Relation
Definition
relation: A B C N
tuple: an element of a relation
A B: binary relation
ab is the same as (a, b)
representations:by drawingby matrix
7/28/2019 04 Relations Functions 110317075641 Phpapp02
6/223
Relation
Definition
relation: A B C N
tuple: an element of a relation
A B: binary relation
ab is the same as (a, b)
representations:by drawingby matrix
7/28/2019 04 Relations Functions 110317075641 Phpapp02
7/223
Relation
Definition
relation: A B C N
tuple: an element of a relation
A B: binary relation
ab is the same as (a, b)
representations:by drawingby matrix
7/28/2019 04 Relations Functions 110317075641 Phpapp02
8/223
Relation
Definition
relation: A B C N
tuple: an element of a relation
A B: binary relation
ab is the same as (a, b)
representations:by drawingby matrix
7/28/2019 04 Relations Functions 110317075641 Phpapp02
9/223
Relation Example
Example
A = {a1, a2, a3, a4},B = {b1, b2, b3}
= {(a1, b1), (a1, b3), (a2, b2), (a2, b3), (a3, b1), (a3, b3), (a4, b1)}
b1 b2 b3a1 1 0 1a2 0 1 1
a3 1 0 1a4 1 0 0
M =
1 0 10 1 1
1 0 11 0 0
7/28/2019 04 Relations Functions 110317075641 Phpapp02
10/223
Relation Example
Example
A = {a1, a2, a3, a4},B = {b1, b2, b3}
= {(a1, b1), (a1, b3), (a2, b2), (a2, b3), (a3, b1), (a3, b3), (a4, b1)}
b1 b2 b3a1 1 0 1a2 0 1 1
a3 1 0 1a4 1 0 0
M =
1 0 10 1 1
1 0 11 0 0
7/28/2019 04 Relations Functions 110317075641 Phpapp02
11/223
Relation Composition
Definition
relation composition:
let A B, B C= {(a, c) | a A, c C, b B [ab bc]}
M = M Musing logical operations:1 : T, 0 : F, : ,+ :
7/28/2019 04 Relations Functions 110317075641 Phpapp02
12/223
Relation Composition Example
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
13/223
Relation Composition Matrix Example
Example
M =
1 0 00 0 10 1 10 1 0
1 0 1
M =1 1 0 00 0 1 10 1 1 0
M =
1 1 0 00 1 1 00 1 1 10 0 1 1
1 1 1 0
7/28/2019 04 Relations Functions 110317075641 Phpapp02
14/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
15/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
16/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
17/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
18/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
19/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
20/223
Relation Composition Associativity
relation composition is associative
()= ().
(a, d) ()
c [(a, c) (c, d) ]
c [b [(a, b) (b, c) ] (c, d) ]
b [(a, b) c [(b, c) (c, d) ]] b [(a, b) (b, d) ]
(a, d) ()
7/28/2019 04 Relations Functions 110317075641 Phpapp02
21/223
Relation Composition Theorems
let , A B, andlet , B C
( ) =
( )
( )=
( )
( )
7/28/2019 04 Relations Functions 110317075641 Phpapp02
22/223
Relation Composition Theorems
( ) = .
(a, c) ( )
b [(a, b) (b, c) ( )]
b [(a, b) ((b, c) (b, c) )]
b [((a, b) (b, c) )
((a, b) (b, c) )]
(a, c) (a, c)
(a, c)
7/28/2019 04 Relations Functions 110317075641 Phpapp02
23/223
Relation Composition Theorems
( ) = .
(a, c) ( )
b [(a, b) (b, c) ( )]
b [(a, b) ((b, c) (b, c) )]
b [((a, b) (b, c) )
((a, b) (b, c) )]
(a, c) (a, c)
(a, c)
C
7/28/2019 04 Relations Functions 110317075641 Phpapp02
24/223
Relation Composition Theorems
( ) = .
(a, c) ( )
b [(a, b) (b, c) ( )]
b [(a, b) ((b, c) (b, c) )]
b [((a, b) (b, c) )
((a, b) (b, c) )]
(a, c) (a, c)
(a, c)
R l i C i i Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
25/223
Relation Composition Theorems
( ) = .
(a, c) ( )
b [(a, b) (b, c) ( )]
b [(a, b) ((b, c) (b, c) )]
b [((a, b) (b, c) )
((a, b) (b, c) )]
(a, c) (a, c)
(a, c)
R l i C i i Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
26/223
Relation Composition Theorems
( ) = .
(a, c) ( )
b [(a, b) (b, c) ( )]
b [(a, b) ((b, c) (b, c) )]
b [((a, b) (b, c) )
((a, b) (b, c) )]
(a, c) (a, c)
(a, c)
R l ti C iti Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
27/223
Relation Composition Theorems
( ) = .
(a, c) ( )
b [(a, b) (b, c) ( )]
b [(a, b) ((b, c) (b, c) )]
b [((a, b) (b, c) )
((a, b) (b, c) )]
(a, c) (a, c)
(a, c)
C R l ti
7/28/2019 04 Relations Functions 110317075641 Phpapp02
28/223
Converse Relation
Definition
1 = {(b, a) | (a, b) }
M1 = MT
C s R l ti Th s
7/28/2019 04 Relations Functions 110317075641 Phpapp02
29/223
Converse Relation Theorems
(1)1 =
( )1 = 1 1
( )1 = 1 1
1 = 1
( )1 = 1 1
1
1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
30/223
Converse Relation Theorems
1 = 1.
(b, a) 1
(a, b)
(a, b) /
(b, a) / 1
(b, a) 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
31/223
Converse Relation Theorems
1 = 1.
(b, a) 1
(a, b)
(a, b) /
(b, a) / 1
(b, a) 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
32/223
Converse Relation Theorems
1 = 1.
(b, a) 1
(a, b)
(a, b) /
(b, a) / 1
(b, a) 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
33/223
Converse Relation Theorems
1 = 1.
(b, a) 1
(a, b)
(a, b) /
(b, a) / 1
(b, a) 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
34/223
Converse Relation Theorems
1 = 1.
(b, a) 1
(a, b)
(a, b) /
(b, a) / 1
(b, a) 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
35/223
Converse Relation Theorems
( )1 = 1 1.
(b, a) ( )1
(a, b) ( )
(a, b) (a, b)
(b, a) 1 (b, a) 1
(b, a) 1 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
36/223
Converse Relation Theorems
( )1 = 1 1.
(b, a) ( )1
(a, b) ( )
(a, b) (a, b)
(b, a) 1 (b, a) 1
(b, a) 1 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
37/223
Converse Relation Theorems
( )1 = 1 1.
(b, a) ( )1
(a, b) ( )
(a, b) (a, b)
(b, a) 1 (b, a) 1
(b, a)
1
1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
38/223
Converse Relation Theorems
( )1 = 1 1.
(b, a) ( )1
(a, b) ( )
(a, b) (a, b)
(b, a) 1 (b, a) 1
(b, a)
1
1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
39/223
Co e se e at o eo e s
( )1 = 1 1.
(b, a) ( )1
(a, b) ( )
(a, b) (a, b)
(b, a) 1 (b, a) 1
(b, a)
1
1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
40/223
( )1 = 1 1.
( )1 = ( )1
= 1 1
= 1 1
= 1 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
41/223
( )1 = 1 1.
( )1 = ( )1
= 1 1
= 1 1
= 1 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
42/223
( )1 = 1 1.
( )1 = ( )1
= 1 1
= 1 1
= 1 1
Converse Relation Theorems
7/28/2019 04 Relations Functions 110317075641 Phpapp02
43/223
( )1 = 1 1.
( )1 = ( )1
= 1 1
= 1 1
= 1 1
Relation Composition Converse
7/28/2019 04 Relations Functions 110317075641 Phpapp02
44/223
Theorem()1 = 11
Proof.
(c, a) ()1
(a, c)
b [(a, b) (b, c) ]
b [(b, a) 1 (c, b) 1]
(c, a) 11
Relation Composition Converse
7/28/2019 04 Relations Functions 110317075641 Phpapp02
45/223
Theorem()1 = 11
Proof.
(c, a) ()1
(a, c)
b [(a, b) (b, c) ]
b [(b, a) 1 (c, b) 1]
(c, a) 11
Relation Composition Converse
7/28/2019 04 Relations Functions 110317075641 Phpapp02
46/223
Theorem()1 = 11
Proof.
(c, a) ()1
(a, c)
b [(a, b) (b, c) ]
b [(b, a) 1 (c, b) 1]
(c, a) 11
Relation Composition Converse
7/28/2019 04 Relations Functions 110317075641 Phpapp02
47/223
Theorem()1 = 11
Proof.
(c, a) ()1
(a, c)
b [(a, b) (b, c) ]
b [(b, a) 1 (c, b) 1]
(c, a) 11
Relation Composition Converse
7/28/2019 04 Relations Functions 110317075641 Phpapp02
48/223
Theorem()1 = 11
Proof.
(c, a) ()1
(a, c)
b [(a, b) (b, c) ]
b [(b, a) 1 (c, b) 1]
(c, a) 11
Relation Composition Converse
7/28/2019 04 Relations Functions 110317075641 Phpapp02
49/223
Theorem()1 = 11
Proof.
(c, a) ()1
(a, c)
b [(a, b) (b, c) ]
b [(b, a) 1 (c, b) 1]
(c, a) 11
Topics
7/28/2019 04 Relations Functions 110317075641 Phpapp02
50/223
1 RelationsIntroductionRelation Properties
Equivalence Relations
2 FunctionsIntroduction
Pigeonhole PrincipleRecursion
Relation Properties
7/28/2019 04 Relations Functions 110317075641 Phpapp02
51/223
A A
binary relation on A
let n mean
identity relation: E = {(x, x) | x A}
Relation Properties
7/28/2019 04 Relations Functions 110317075641 Phpapp02
52/223
A A
binary relation on A
let n mean
identity relation: E = {(x, x) | x A}
Relation Properties
7/28/2019 04 Relations Functions 110317075641 Phpapp02
53/223
A A
binary relation on A
let n mean
identity relation: E = {(x, x) | x A}
Reflexivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
54/223
reflexive
A Aa [aa]
E
nonreflexive:a [(aa)]
irreflexive:a [(aa)]
Reflexivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
55/223
reflexive
A Aa [aa]
E
nonreflexive:a [(aa)]
irreflexive:a [(aa)]
Reflexivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
56/223
reflexive
A Aa [aa]
E
nonreflexive:a [(aa)]
irreflexive:a [(aa)]
Reflexivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
57/223
reflexive
A Aa [aa]
E
nonreflexive:a [(aa)]
irreflexive:a [(aa)]
Reflexivity Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
58/223
Example
R1 {1, 2} {1, 2}R1 = {(1, 1), (1, 2), (2, 2)}
R1 is reflexive
Example
R2 {1, 2, 3} {1, 2, 3}R2 = {(1, 1), (1, 2), (2, 2)}
R2 is nonreflexive
Reflexivity Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
59/223
Example
R1 {1, 2} {1, 2}R1 = {(1, 1), (1, 2), (2, 2)}
R1 is reflexive
Example
R2 {1, 2, 3} {1, 2, 3}R2 = {(1, 1), (1, 2), (2, 2)}
R2 is nonreflexive
Reflexivity Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
60/223
Example
R {1, 2, 3} {1, 2, 3}R = {(1, 2), (2, 1), (2, 3)}
R is irreflexive
Reflexivity Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
61/223
Example
R Z ZR = {(a, b) | ab 0}
R is reflexive
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
62/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 =
asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
63/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
64/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
65/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
66/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
67/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
68/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry
7/28/2019 04 Relations Functions 110317075641 Phpapp02
69/223
symmetric
A Aa, b [(a = b) (ab ba) ((ab) (ba))]a, b [(a = b) (ab ba)]
1 = asymmetric:a, b [(a = b) (ab (ba)) ((ab) ba))]
antisymmetric:
a, b [(a = b) (ab (ba))] a, b [(a = b) (ab) (ba)]
a, b [(ab ba) (a = b)]
a, b [(ab ba) (a = b)]
Symmetry Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
70/223
Example
R {1, 2, 3} {1, 2, 3}R = {(1, 2), (2, 1), (2, 3)}
R is asymmetric
Symmetry Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
71/223
Example
R Z ZR = {(a, b) | ab 0}
R is symmetric
Symmetry Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
72/223
Example
R {1, 2, 3} {1, 2, 3}R = {(1, 1), (2, 2)}
R is symmetric and antisymmetric
Transitivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
73/223
transitive
A Aa, b, c [(ab bc) (ac)]
2
nontransitive:a, b, c [(ab bc) (ac)]
antitransitive:a, b, c [(ab bc) (ac)]
Transitivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
74/223
transitive
A Aa, b, c [(ab bc) (ac)]
2
nontransitive:a, b, c [(ab bc) (ac)]
antitransitive:a, b, c [(ab bc) (ac)]
Transitivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
75/223
transitive
A Aa, b, c [(ab bc) (ac)]
2
nontransitive:a, b, c [(ab bc) (ac)]
antitransitive:a, b, c [(ab bc) (ac)]
Transitivity
7/28/2019 04 Relations Functions 110317075641 Phpapp02
76/223
transitive
A Aa, b, c [(ab bc) (ac)]
2
nontransitive:a, b, c [(ab bc) (ac)]
antitransitive:a, b, c [(ab bc) (ac)]
Transitivity Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
77/223
Example
R {1, 2, 3} {1, 2, 3}R = {(1, 2), (2, 1), (2, 3)}
R is antitransitive
Transitivity Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
78/223
Example
R Z ZR = {(a, b) | ab 0}
R is nontransitive
Converse Relation Properties
7/28/2019 04 Relations Functions 110317075641 Phpapp02
79/223
Theorem
The reflexivity, symmetry and transitivity properties
are preserved in the converse relation.
Closures
7/28/2019 04 Relations Functions 110317075641 Phpapp02
80/223
reflexive closure:r = E
symmetric closure:s =
1
transitive closure:t = i=1,2,3,...
i = 2 3
Closures
7/28/2019 04 Relations Functions 110317075641 Phpapp02
81/223
reflexive closure:r = E
symmetric closure:s =
1
transitive closure:t = i=1,2,3,...
i = 2 3
Closures
7/28/2019 04 Relations Functions 110317075641 Phpapp02
82/223
reflexive closure:r = E
symmetric closure:s =
1
transitive closure:t = i=1,2,3,...
i = 2 3
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
83/223
predecessor - successor
R Z ZR = {(a, b) | a b = 1}
irreflexive
antisymmetric
antitransitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
84/223
adjacency
R Z ZR = {(a, b) | |a b| = 1}
irreflexive
symmetric
antitransitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
85/223
strict order
R Z ZR = {(a, b) | a < b}
irreflexive
antisymmetric
transitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
86/223
partial order
R Z ZR = {(a, b) | a b}
reflexive
antisymmetric
transitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
87/223
preorder
R Z ZR = {(a, b) | |a| |b|}
reflexive
asymmetric
transitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
88/223
limited difference
R Z Z,m Z+
R = {(a, b) | |a b| m}
reflexive
symmetric
nontransitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
89/223
comparability
R U UR = {(a, b) | (a b) (b a)}
reflexive
symmetric
nontransitive
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
90/223
sibling
irreflexive
symmetrictransitive
how can a relation be symmetric, transitive and nonreflexive?
Special Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
91/223
sibling
irreflexive
symmetrictransitive
how can a relation be symmetric, transitive and nonreflexive?
Topics
7/28/2019 04 Relations Functions 110317075641 Phpapp02
92/223
1 RelationsIntroductionRelation PropertiesEquivalence Relations
2 FunctionsIntroductionPigeonhole PrincipleRecursion
Compatibility Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
93/223
Definition
compatibility relation:
reflexive
symmetric
when drawing, lines instead of arrows
matrix representation as a triangle matrix
1 is a compatibility relation
Compatibility Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
94/223
Definition
compatibility relation:
reflexive
symmetric
when drawing, lines instead of arrows
matrix representation as a triangle matrix
1 is a compatibility relation
Compatibility Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
95/223
Definition
compatibility relation:
reflexive
symmetric
when drawing, lines instead of arrows
matrix representation as a triangle matrix
1 is a compatibility relation
Compatibility Relation Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
96/223
Example
A = {a1, a2, a3, a4}
R = {(a1, a1), (a2, a2),
(a3, a3), (a4, a4),
(a1, a2), (a2, a1),
(a2, a4), (a4, a2),
(a3, a4), (a4, a3)}
1 1 0 0
1 1 0 10 0 1 10 1 1 1
10 00 1 1
Compatibility Relation Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
97/223
Example
A = {a1, a2, a3, a4}
R = {(a1, a1), (a2, a2),
(a3, a3), (a4, a4),
(a1, a2), (a2, a1),
(a2, a4), (a4, a2),
(a3, a4), (a4, a3)}
1 1 0 0
1 1 0 10 0 1 10 1 1 1
10 00 1 1
7/28/2019 04 Relations Functions 110317075641 Phpapp02
98/223
Compatibility Relation Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
99/223
Example (1
)P: persons, L: languagesP = {p1, p2, p3, p4, p5, p6}L = {l1, l2, l3, l4, l5}
P L
M =
1 1 0 0 01 1 0 0 00 0 1 0 1
1 0 1 1 00 0 0 1 00 1 1 0 0
M1
=
1 1 0 1 0 01 1 0 0 0 1
0 0 1 1 0 10 0 0 1 1 00 0 1 0 0 0
Compatibility Relation Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
100/223
Example (1)
1 P P
M1 =
1 1 0 1 0 11 1 0 1 0 10 0 1 1 0 11 1 1 1 1 10 0 0 1 1 0
1 1 1 1 0 1
Compatibility Block
7/28/2019 04 Relations Functions 110317075641 Phpapp02
101/223
Definition
compatibility block: C Aa, b [a C b C ab]
maximal compatibility block:not a subset of another compatibility block
an element can be a member of more than one MCB
complete cover: Cset of all MCBs
Compatibility Block
7/28/2019 04 Relations Functions 110317075641 Phpapp02
102/223
Definition
compatibility block: C Aa, b [a C b C ab]
maximal compatibility block:not a subset of another compatibility block
an element can be a member of more than one MCB
complete cover: Cset of all MCBs
Compatibility Block
7/28/2019 04 Relations Functions 110317075641 Phpapp02
103/223
Definition
compatibility block: C Aa, b [a C b C ab]
maximal compatibility block:not a subset of another compatibility block
an element can be a member of more than one MCB
complete cover: Cset of all MCBs
Compatibility Block Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
104/223
Example (1)
C1 = {a4, a6}
C2 = {a2, a4, a6}
C3 = {a1, a2, a4, a6} (MCB)
C(A) = {{a1, a2, a4, a6},
{a3, a4, a6},{a4, a5}}
Compatibility Block Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
105/223
Example (1)
C1 = {a4, a6}
C2 = {a2, a4, a6}
C3 = {a1, a2, a4, a6} (MCB)
C(A) = {{a1, a2, a4, a6},
{a3, a4, a6},{a4, a5}}
Compatibility Block Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
106/223
Example (1)
C1 = {a4, a6}
C2 = {a2, a4, a6}
C3 = {a1, a2, a4, a6} (MCB)
C(A) = {{a1, a2, a4, a6},
{a3, a4, a6},{a4, a5}}
Equivalence Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
107/223
Definition
equivalence relation:
reflexive
symmetric
transitive
equivalence classes (partitions)
every element is a member of exactly one equivalence class
complete cover: C
Equivalence Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
108/223
Definition
equivalence relation:
reflexive
symmetric
transitive
equivalence classes (partitions)
every element is a member of exactly one equivalence class
complete cover: C
Equivalence Relation Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
109/223
Example
R Z Z
R = {(a, b) | m Z [a b = 5m]}
R partitions Z into 5 equivalence classes
References
7/28/2019 04 Relations Functions 110317075641 Phpapp02
110/223
Required Reading: Grimaldi
Chapter 5: Relations and Functions
5.1. Cartesian Products and Relations
Chapter 7: Relations: The Second Time Around
7.1. Relations Revisited: Properties of Relations7.4. Equivalence Relations and Partitions
Supplementary Reading: ODonnell, Hall, Page
Chapter 10: Relations
Topics
7/28/2019 04 Relations Functions 110317075641 Phpapp02
111/223
1 RelationsIntroductionRelation PropertiesEquivalence Relations
2 FunctionsIntroductionPigeonhole Principle
Recursion
Functions
7/28/2019 04 Relations Functions 110317075641 Phpapp02
112/223
Definition
function: f : X Yx X y1, y2 Y (x, y1), (x, y2) f y1 = y2
X: domain, Y: codomain (or range)
y = f(x) is the same as (x, y) f
y is the image of x under f
let f : X Y, and X1 Xsubset image: f(X1) = {f(x) | x X1}
Functions
7/28/2019 04 Relations Functions 110317075641 Phpapp02
113/223
Definition
function: f : X Yx X y1, y2 Y (x, y1), (x, y2) f y1 = y2
X: domain, Y: codomain (or range)
y = f(x) is the same as (x, y) f
y is the image of x under f
let f : X Y, and X1 Xsubset image: f(X1) = {f(x) | x X1}
Functions
7/28/2019 04 Relations Functions 110317075641 Phpapp02
114/223
Definition
function: f : X Yx X y1, y2 Y (x, y1), (x, y2) f y1 = y2
X: domain, Y: codomain (or range)
y = f(x) is the same as (x, y) f
y is the image of x under f
let f : X Y, and X1 Xsubset image: f(X1) = {f(x) | x X1}
Subset Image Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
115/223
Example
f : R R
f(x) = x2
f(Z) = {0, 1, 4, 9, 16, . . . }
f({2, 1}) = {1, 4}
Subset Image Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
116/223
Example
f : R R
f(x) = x2
f(Z) = {0, 1, 4, 9, 16, . . . }
f({2, 1}) = {1, 4}
Function Properties
Definition
7/28/2019 04 Relations Functions 110317075641 Phpapp02
117/223
f : X Y is one-to-one (or injective):x1, x2 X f(x1) = f(x2) x1 = x2
Definition
f : X Y is onto (or surjective):y Y x X f(x) = y
f(X) = Y
Definition
f : X Y is bijective:f is one-to-one and onto
Function Properties
Definition
7/28/2019 04 Relations Functions 110317075641 Phpapp02
118/223
f : X Y is one-to-one (or injective):x1, x2 X f(x1) = f(x2) x1 = x2
Definition
f : X Y is onto (or surjective):y Y x X f(x) = y
f(X) = Y
Definition
f : X Y is bijective:f is one-to-one and onto
Function Properties
Definition
7/28/2019 04 Relations Functions 110317075641 Phpapp02
119/223
f : X Y is one-to-one (or injective):x1, x2 X f(x1) = f(x2) x1 = x2
Definition
f : X Y is onto (or surjective):y Y x X f(x) = y
f(X) = Y
Definition
f : X Y is bijective:f is one-to-one and onto
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
120/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
121/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
122/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
123/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
124/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
7/28/2019 04 Relations Functions 110317075641 Phpapp02
125/223
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
126/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
One-to-one Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
127/223
Example
f : R Rf(x) = 3x + 7
f(x1) = f(x2) 3x1 + 7 = 3x2 + 7 3x1 = 3x2
x1 = x2
Counterexample
g : Z Zg(x) = x4 x
g(0) = 04 0 = 0g(1) = 14 1 = 0
Onto Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
128/223
Example
f : R Rf(x) = x3
Counterexample
f : Z Zf(x) = 3x + 1
Onto Function Examples
7/28/2019 04 Relations Functions 110317075641 Phpapp02
129/223
Example
f : R Rf(x) = x3
Counterexample
f : Z Zf(x) = 3x + 1
Function Composition
7/28/2019 04 Relations Functions 110317075641 Phpapp02
130/223
Definition
let f : X Y, g : Y Z
g f : X Z
(g f)(x) = g(f(x))
function composition is not commutative
function composition is associative:f (g h) = (f g) h
Function Composition
7/28/2019 04 Relations Functions 110317075641 Phpapp02
131/223
Definition
let f : X Y, g : Y Z
g f : X Z
(g f)(x) = g(f(x))
function composition is not commutative
function composition is associative:f (g h) = (f g) h
Function Composition Examples
Example (commutativity)
7/28/2019 04 Relations Functions 110317075641 Phpapp02
132/223
Example (commutativity)
f : R Rf(x) = x2
g : R R
g(x) = x + 5
g f : R R(g f)(x) = x2 + 5
f g : R R(f g)(x) = (x + 5)2
Function Composition Examples
Example (commutativity)
7/28/2019 04 Relations Functions 110317075641 Phpapp02
133/223
Example (commutativity)
f : R Rf(x) = x2
g : R R
g(x) = x + 5
g f : R R(g f)(x) = x2 + 5
f g : R R(f g)(x) = (x + 5)2
Function Composition Examples
Example (commutativity)
7/28/2019 04 Relations Functions 110317075641 Phpapp02
134/223
Example (commutativity)
f : R Rf(x) = x2
g : R R
g(x) = x + 5
g f : R R(g f)(x) = x2 + 5
f g : R R(f g)(x) = (x + 5)2
Composite Function Theorems
Theorem
7/28/2019 04 Relations Functions 110317075641 Phpapp02
135/223
Theoremlet f : X Y, g : Y Zf is one-to-one g is one-to-one g f is one-to-one
Proof.
(g f)(a1) = (g f)(a2) g(f(a1)) = g(f(a2)) f(a1) = f(a2)
a1 = a2
Composite Function Theorems
Theorem
7/28/2019 04 Relations Functions 110317075641 Phpapp02
136/223
Theoremlet f : X Y, g : Y Zf is one-to-one g is one-to-one g f is one-to-one
Proof.
(g f)(a1) = (g f)(a2) g(f(a1)) = g(f(a2)) f(a1) = f(a2)
a1 = a2
Composite Function Theorems
Theorem
7/28/2019 04 Relations Functions 110317075641 Phpapp02
137/223
Theoremlet f : X Y, g : Y Zf is one-to-one g is one-to-one g f is one-to-one
Proof.
(g f)(a1) = (g f)(a2) g(f(a1)) = g(f(a2)) f(a1) = f(a2)
a1 = a2
Composite Function Theorems
Theorem
7/28/2019 04 Relations Functions 110317075641 Phpapp02
138/223
Theoremlet f : X Y, g : Y Zf is one-to-one g is one-to-one g f is one-to-one
Proof.
(g f)(a1) = (g f)(a2) g(f(a1)) = g(f(a2)) f(a1) = f(a2)
a1 = a2
Composite Function Theorems
Theorem
7/28/2019 04 Relations Functions 110317075641 Phpapp02
139/223
let f : X Y, g : Y Zf is one-to-one g is one-to-one g f is one-to-one
Proof.
(g f)(a1) = (g f)(a2) g(f(a1)) = g(f(a2)) f(a1) = f(a2)
a1 = a2
Composite Function Theorems
h
7/28/2019 04 Relations Functions 110317075641 Phpapp02
140/223
Theorem
let f : X Y, g : Y Zf is onto g is onto g f is onto
Proof.
z Z y Y g(y) = zy Y x X f(x) = y z Z x X g(f(x)) = z
Composite Function Theorems
Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
141/223
Theorem
let f : X Y, g : Y Zf is onto g is onto g f is onto
Proof.
z Z y Y g(y) = zy Y x X f(x) = y z Z x X g(f(x)) = z
Composite Function Theorems
Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
142/223
Theorem
let f : X Y, g : Y Zf is onto g is onto g f is onto
Proof.
z Z y Y g(y) = zy Y x X f(x) = y z Z x X g(f(x)) = z
Composite Function Theorems
Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
143/223
Theorem
let f : X Y, g : Y Zf is onto g is onto g f is onto
Proof.
z Z y Y g(y) = zy Y x X f(x) = y z Z x X g(f(x)) = z
Identity Function
7/28/2019 04 Relations Functions 110317075641 Phpapp02
144/223
Definition
identity function: 1X
1X : X X1X(x) = x
Inverse Function
7/28/2019 04 Relations Functions 110317075641 Phpapp02
145/223
Definition
f : X Y is invertible:
f1
: Y X [f1
f = 1X f f1
= 1Y]f1: inverse of function f
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
146/223
f : R Rf(x) = 2x + 5
f
1 : R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(x5
2 ) = 2x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
147/223
f : R Rf(x) = 2x + 5
f
1 : R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(x5
2 ) = 2x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
148/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(x5
2 ) = 2x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
149/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(x5
2 ) = 2x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
150/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(x5
2 ) = 2x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
151/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(
x5
2 ) = 2
x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
152/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(
x5
2 ) = 2
x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
153/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(
x5
2 ) = 2
x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
154/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(
x5
2 ) = 2
x5
2 + 5 = (x 5) + 5 = x
Inverse Function Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
155/223
f : R Rf(x) = 2x + 5
f1
: R Rf1(x) = x52
(f1 f)(x) = f1(f(x)) = f1(2x + 5) = (2x+5)52 =2x2 = x
(f f1
)(x) = f(f1
(x)) = f(
x5
2 ) = 2
x5
2 + 5 = (x 5) + 5 = x
Inverse Function
TheoremIf a function is invertible its inverse is unique
7/28/2019 04 Relations Functions 110317075641 Phpapp02
156/223
If a function is invertible, its inverse is unique.
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible its inverse is unique
7/28/2019 04 Relations Functions 110317075641 Phpapp02
157/223
If a function is invertible, its inverse is unique.
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible its inverse is unique
7/28/2019 04 Relations Functions 110317075641 Phpapp02
158/223
If a function is invertible, its inverse is unique.
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible its inverse is unique
7/28/2019 04 Relations Functions 110317075641 Phpapp02
159/223
If a function is invertible, its inverse is unique.
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible, its inverse is unique.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
160/223
If a function is invertible, its inverse is unique.
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible, its inverse is unique.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
161/223
, q
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible, its inverse is unique.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
162/223
, q
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Inverse Function
TheoremIf a function is invertible, its inverse is unique.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
163/223
q
Proof.
let f : X Ylet g, h : Y X such that:g f = 1X f g = 1Yh f = 1X f h = 1Y
h = h 1Y = h (f g) = (h f) g = 1X g = g
Invertible Function
7/28/2019 04 Relations Functions 110317075641 Phpapp02
164/223
Theorem
A function is invertible if and only if it is one-to-one and onto.
Invertible Function
If invertible then one-to-one.
f A B
If invertible then onto.
f A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
165/223
f : A B
f(a1) = f(a2)
f1(f(a1)) = f1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
166/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
167/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
168/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
169/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
170/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
171/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
172/223
f : A B
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
f : A B
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If invertible then one-to-one.
f : A B
If invertible then onto.
f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
173/223
f(a1) = f(a2)
f
1(f(a1)) = f
1(f(a2)) (f1 f)(a1) = (f
1 f)(a2)
1A(a1) = 1A(a2)
a1 = a2
b
= 1B(b)= (f f1)(b)
= f(f1(b))
Invertible Function
If bijective then invertible.f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
174/223
f is onto b B a A f(a) = b
let g : B A be defined by a = g(b)
is it possible that g(b) = a1 = a2 = g(b) ?
this would mean: f(a1) = b = f(a2)
but f is one-to-one
Invertible Function
If bijective then invertible.f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
175/223
f is onto b B a A f(a) = b
let g : B A be defined by a = g(b)
is it possible that g(b) = a1 = a2 = g(b) ?
this would mean: f(a1) = b = f(a2)
but f is one-to-one
Invertible Function
If bijective then invertible.f : A B
7/28/2019 04 Relations Functions 110317075641 Phpapp02
176/223
f is onto b B a A f(a) = b
let g : B A be defined by a = g(b)
is it possible that g(b) = a1 = a2 = g(b) ?
this would mean: f(a1) = b = f(a2)
but f is one-to-one
Topics
1 RelationsIntroductionRelatio P o e ties
7/28/2019 04 Relations Functions 110317075641 Phpapp02
177/223
Relation PropertiesEquivalence Relations
2 FunctionsIntroductionPigeonhole PrincipleRecursion
Pigeonhole Principle
Definition
Pigeonhole Principle (Dirichlet drawers):
7/28/2019 04 Relations Functions 110317075641 Phpapp02
178/223
g ( )If m pigeons go into n holes and m > n,then at least one hole contains more than one pigeon.
let f : X Yif |X| > |Y| then f cannot be one-to-one
x1, x2 X [x1 = x2 f(x1) = f(x2)]
Pigeonhole Principle
Definition
Pigeonhole Principle (Dirichlet drawers):
7/28/2019 04 Relations Functions 110317075641 Phpapp02
179/223
If m pigeons go into n holes and m > n,then at least one hole contains more than one pigeon.
let f : X Yif |X| > |Y| then f cannot be one-to-one
x1, x2 X [x1 = x2 f(x1) = f(x2)]
Pigeonhole Principle Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
180/223
Among 367 people, at least two have the same birthday.
In an exam where the grades integers between 0 and 100,how many students have to take the exam to make sure thatat least two students will have the same grade?
Pigeonhole Principle Examples
Example
7/28/2019 04 Relations Functions 110317075641 Phpapp02
181/223
Among 367 people, at least two have the same birthday.
In an exam where the grades integers between 0 and 100,how many students have to take the exam to make sure thatat least two students will have the same grade?
Generalized Pigeonhole Principle
Definition
Generalized Pigeonhole Principle:
7/28/2019 04 Relations Functions 110317075641 Phpapp02
182/223
If m objects are distributed to n drawers,then at least one of the drawers contains m/n objects.
Example
Among 100 people, at least 9 (100/12) were bornin the same month.
Generalized Pigeonhole Principle
Definition
Generalized Pigeonhole Principle:
7/28/2019 04 Relations Functions 110317075641 Phpapp02
183/223
If m objects are distributed to n drawers,then at least one of the drawers contains m/n objects.
Example
Among 100 people, at least 9 (100/12) were bornin the same month.
Pigeonhole Principle Example
Th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
184/223
Theorem
In any subset of cardinality 6 of the set S = {1,2,3,...,9},
there are two elements which total 10.
Pigeonhole Principle Example
Theorem
Let S be a set of positive integers smaller than or equal to 14,
with cardinality 6. The sums of the elements
in all nonempty subsets of S cannot be all different.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
185/223
Proof TrialA SsA : sum of the elements of A
holes:
1 sA 9 + + 14 = 69pigeons: 26 1 = 63
Proof.look at the subsets for which|A| 5
holes:
1 sA 10 + + 14 = 60pigeons: 26 2 = 62
Pigeonhole Principle Example
Theorem
Let S be a set of positive integers smaller than or equal to 14,
with cardinality 6. The sums of the elements
in all nonempty subsets of S cannot be all different.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
186/223
Proof TrialA SsA : sum of the elements of A
holes:
1 sA 9 + + 14 = 69pigeons: 26 1 = 63
Proof.look at the subsets for which|A| 5
holes:
1 sA 10 + + 14 = 60pigeons: 26 2 = 62
Pigeonhole Principle Example
Theorem
Let S be a set of positive integers smaller than or equal to 14,
with cardinality 6. The sums of the elements
in all nonempty subsets of S cannot be all different.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
187/223
Proof TrialA SsA : sum of the elements of A
holes:
1 sA
9 + + 14 = 69pigeons: 26 1 = 63
Proof.look at the subsets for which|A| 5
holes:
1 sA
10 + + 14 = 60pigeons: 26 2 = 62
Pigeonhole Principle Example
Theorem
Let S be a set of positive integers smaller than or equal to 14,
with cardinality 6. The sums of the elements
in all nonempty subsets of S cannot be all different.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
188/223
Proof TrialA SsA : sum of the elements of A
holes:
1 sA
9 + + 14 = 69pigeons: 26 1 = 63
Proof.look at the subsets for which|A| 5
holes:
1 sA
10 + + 14 = 60pigeons: 26 2 = 62
Pigeonhole Principle Example
Theorem
Let S be a set of positive integers smaller than or equal to 14,
with cardinality 6. The sums of the elements
in all nonempty subsets of S cannot be all different.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
189/223
Proof TrialA SsA : sum of the elements of A
holes:
1 sA
9 + + 14 = 69pigeons: 26 1 = 63
Proof.look at the subsets for which|A| 5
holes:
1 sA
10 + + 14 = 60pigeons: 26 2 = 62
Pigeonhole Principle Example
TheoremThere is at least one pair of elements among 101 elements
chosen from set S = {1, 2, 3, . . . , 200},th t f th l t f th i di id th th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
190/223
so that one of the elements of the pair divides the other.
Proof Method
we first show thatn !p [n = 2rp r N t Z [p = 2t + 1]]
then, by using this theorem we prove the main theorem
Pigeonhole Principle Example
Theorem
There is at least one pair of elements among 101 elements
chosen from set S = {1, 2, 3, . . . , 200},th t f th l t f th i di id th th
7/28/2019 04 Relations Functions 110317075641 Phpapp02
191/223
so that one of the elements of the pair divides the other.
Proof Method
we first show thatn !p [n = 2rp r N t Z [p = 2t + 1]]
then, by using this theorem we prove the main theorem
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
192/223
n = 1: r = 0, p = 1
n k: assume n = 2
r
pn = k + 1:n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r
1 p1 2r
2 p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
193/223
n = 1: r = 0, p = 1
n k: assume n = 2
r
pn = k + 1:n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r
1 p1 2r
2 p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
194/223
n = 1: r = 0, p = 1
n k: assume n = 2
r
pn = k + 1:n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r
1 p1 2r
2 p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
195/223
n = 1: r = 0, p = 1n
k
: assumen
= 2
rp
n = k + 1:n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r
1 p1 2r
2 p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
196/223
n = 1: r = 0, p = 1n
k
: assumen
= 2
rp
n = k + 1:n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r
1 p1 2r
2 p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
197/223
n = 1: r = 0, p = 1n
k: assume n = 2rp
n = k + 1:n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence. Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
198/223
n = 1: r = 0, p = 1n k: assume n = 2rpn = k + 1:
n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence.
1 0 1
Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
199/223
n = 1: r = 0, p = 1n k: assume n = 2rpn = k + 1:
n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence.
1 0 1
Proof of uniqueness.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
200/223
n = 1: r = 0, p = 1n k: assume n = 2rpn = k + 1:
n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence.
1 0 1
Proof of uniqueness.
f
7/28/2019 04 Relations Functions 110317075641 Phpapp02
201/223
n = 1: r = 0, p = 1n k: assume n = 2rpn = k + 1:
n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence.
n 1 r 0 p 1
Proof of uniqueness.
if i
7/28/2019 04 Relations Functions 110317075641 Phpapp02
202/223
n = 1: r = 0, p = 1n k: assume n = 2rpn = k + 1:
n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
n !p [n = 2rp r N t Z [p = 2t + 1]]
Proof of existence.
n 1: r 0 p 1
Proof of uniqueness.
if i
7/28/2019 04 Relations Functions 110317075641 Phpapp02
203/223
n = 1: r = 0, p = 1n k: assume n = 2rpn = k + 1:
n = 2 : r = 1, p = 1n prime (n > 2) : r = 0, p = n(n prime) : n = n1n2
n = 2r1
p1 2r2
p2n = 2r1+r2 p1p2
if not unique:
n = 2r1 p1 = 2r2 p2
2r1r2 p1 = p2 2|p2
Pigeonhole Principle Example
Theorem
There is at least one pair of elements among 101 elements
chosen from set S = {1, 2, 3, . . . , 200}so that one of the elements of the pair divides the other.
Proof.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
204/223
T = {t | t S,i Z [t = 2i + 1]}, |T| = 100f : S T, r N olsuns = 2rt f(s) = t
if 101 elements are chosen from S, at least two of themwill have the same image in T: f(s1) = f(s2) 2
m1 t = 2m2 t
s1
s2=
2m1 t
2m2 t= 2m1m2
Pigeonhole Principle Example
Theorem
There is at least one pair of elements among 101 elements
chosen from set S = {1, 2, 3, . . . , 200}so that one of the elements of the pair divides the other.
Proof.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
205/223
T = {t | t S,i Z [t = 2i + 1]}, |T| = 100f : S T, r N olsuns = 2rt f(s) = t
if 101 elements are chosen from S, at least two of themwill have the same image in T: f(s1) = f(s2) 2
m1 t = 2m2 t
s1
s2=
2m1 t
2m2 t= 2m1m2
Pigeonhole Principle Example
Theorem
There is at least one pair of elements among 101 elements
chosen from set S = {1, 2, 3, . . . , 200}so that one of the elements of the pair divides the other.
Proof.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
206/223
T = {t | t S,i Z [t = 2i + 1]}, |T| = 100f : S T, r N olsuns = 2rt f(s) = t
if 101 elements are chosen from S, at least two of themwill have the same image in T: f(s1) = f(s2) 2
m1 t = 2m2 t
s1
s2=
2m1 t
2m2 t= 2m1m2
Pigeonhole Principle Example
Theorem
There is at least one pair of elements among 101 elements
chosen from set S = {1, 2, 3, . . . , 200}so that one of the elements of the pair divides the other.
Proof.
7/28/2019 04 Relations Functions 110317075641 Phpapp02
207/223
T= {
t|
t
S,
i Z [
t= 2
i+ 1]}, |
T| = 100
f : S T, r N olsuns = 2rt f(s) = t
if 101 elements are chosen from S, at least two of themwill have the same image in T: f(s1) = f(s2) 2
m1 t = 2m2 t
s1
s2=
2m1 t
2m2 t= 2m1m2
Topics
1 RelationsIntroductionRelation PropertiesEquivalence Relations
7/28/2019 04 Relations Functions 110317075641 Phpapp02
208/223
2 FunctionsIntroductionPigeonhole PrincipleRecursion
Recursive Functions
Definitionrecursive function: a function defined in terms of itself
f(n) = h(f(m))
7/28/2019 04 Relations Functions 110317075641 Phpapp02
209/223
inductively defined function: a recursive functionwhere the size is reduced at every step
f(n) =
k n = 0h(f(n 1)) n > 0
Recursion Examples
Example
f91(n) =
n 10 n > 100f91(f91(n + 11)) n 100
7/28/2019 04 Relations Functions 110317075641 Phpapp02
210/223
Example (factorial)
f(n) =
1 n = 0n f(n 1) n > 0
Recursion Examples
Example
f91(n) =
n 10 n > 100f91(f91(n + 11)) n 100
7/28/2019 04 Relations Functions 110317075641 Phpapp02
211/223
Example (factorial)
f(n) =
1 n = 0n f(n 1) n > 0
Euclid Algorithm
Example (greatest common divisor)
gcd(a, b) =
b b|agcd(b, a mod b) b a
7/28/2019 04 Relations Functions 110317075641 Phpapp02
212/223
gcd(333, 84) = gcd(84, 333 mod 84)
= gcd(84, 81)
= gcd(81, 84 mod 81)
= gcd(81, 3)
= 3
Euclid Algorithm
Example (greatest common divisor)
gcd(a, b) =
b b|agcd(b, a mod b) b a
7/28/2019 04 Relations Functions 110317075641 Phpapp02
213/223
gcd(333, 84) = gcd(84, 333 mod 84)
= gcd(84, 81)
= gcd(81, 84 mod 81)
= gcd(81, 3)
= 3
Fibonacci Series
Fibonacci series
Fn = fib(n) =
1 n = 11 n = 2fib(n 1) + fib(n 2) n > 2
7/28/2019 04 Relations Functions 110317075641 Phpapp02
214/223
fib(n 1) + fib(n 2) n > 2
F1 F2 F3 F4 F5 F6 F7 F8 . . .1 1 2 3 5 8 13 21 . . .
Fibonacci Series
Theorem
ni=1 F
i2
= Fn
Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
7/28/2019 04 Relations Functions 110317075641 Phpapp02
215/223
n = k : ki=1
Fi2 = Fk Fk
+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Fibonacci Series
Theorem
ni=1
Fi2
=Fn
Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
7/28/2019 04 Relations Functions 110317075641 Phpapp02
216/223
n = k : ki=1
Fi2 = Fk Fk
+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Fibonacci Series
Theorem
ni=1
Fi2
=Fn
Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
7/28/2019 04 Relations Functions 110317075641 Phpapp02
217/223
n = k : ki=1
Fi2 = Fk Fk
+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Fibonacci Series
Theorem
ni=1
Fi2
=Fn
Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
k
7/28/2019 04 Relations Functions 110317075641 Phpapp02
218/223
n = k : ki=1
Fi2 = Fk Fk
+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Fibonacci Series
Theorem
ni=1
Fi2 = Fn Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
k 2
7/28/2019 04 Relations Functions 110317075641 Phpapp02
219/223
n = k : ki=1
Fi2 = Fk Fk
+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Fibonacci Series
Theorem
ni=1
Fi2 = Fn Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
k 2
7/28/2019 04 Relations Functions 110317075641 Phpapp02
220/223
n = k : ki=1
Fi2 = Fk Fk+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Fibonacci Series
Theorem
ni=1
Fi2 = Fn Fn
+1
Proof.
n = 2 :2
i=1 Fi2 = F1
2 + F22 = 1 + 1 = 1 2 = F2 F3
k 2
7/28/2019 04 Relations Functions 110317075641 Phpapp02
221/223
n = k : ki=1
Fi2 = Fk Fk+1
n = k + 1 :
k+1i=1 Fi
2 =
k
i=1 Fi2 + Fk+1
2
= Fk Fk+1 + Fk+12
= Fk+1 (Fk + Fk+1)
= Fk+1 Fk+2
Ackermann Function
Ackermann function
ack(x y ) =
y + 1 x = 0ack(x 1 1) y = 0
7/28/2019 04 Relations Functions 110317075641 Phpapp02
222/223
ack(x, y) = ack(x 1, 1) y = 0ack(x 1, ack(x, y 1)) x > 0 y > 0
References
Required Reading: Grimaldi
Chapter 5: Relations and Functions
5.2. Functions: Plain and One-to-One5.3. Onto Functions: Stirling Numbers of the Second Kind5.5. The Pigeonhole Principle
7/28/2019 04 Relations Functions 110317075641 Phpapp02
223/223
5.6. Function Composition and Inverse Functions
Supplementary Reading: ODonnell, Hall, Page
Chapter 11: Functions
Top Related