Discrete Mathematics in Computer Science
- B8. Functions
Malte Helmert, Gabriele R¨
- ger
University of Basel
October 19, 2020
Malte Helmert, Gabriele R¨
- ger (University of Basel)
Discrete Mathematics in Computer Science October 19, 2020 1 / 34
Discrete Mathematics in Computer Science B8. Functions Malte - - PowerPoint PPT Presentation
Discrete Mathematics in Computer Science B8. Functions Malte Helmert, Gabriele R oger University of Basel October 19, 2020 Malte Helmert, Gabriele R oger (University of Basel) Discrete Mathematics in Computer Science October 19, 2020 1
University of Basel
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 1 / 34
October 19, 2020 — B8. Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 2 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 3 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 4 / 34
Partial and Total Functions
a b c d e 1 2 3 4
functional
A B a b c d e 1 2 3 4
not functional
A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 5 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 6 / 34
Partial and Total Functions
d
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 7 / 34
Partial and Total Functions
d
d ) | n ∈ Z, d ∈ Z \ {0}} ⊆ Z2 × Q.
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 8 / 34
Partial and Total Functions
a b c d e 1 2 3 4 A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 9 / 34
Partial and Total Functions
a b c d e 1 2 3 4 A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 10 / 34
Partial and Total Functions
a b c d e 1 2 3 4 A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 11 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 12 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 13 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 14 / 34
Partial and Total Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 15 / 34
Operations on Partial Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 16 / 34
Operations on Partial Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 17 / 34
Operations on Partial Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 18 / 34
Operations on Partial Functions
◮ f : N0 → N0 with f (x) = x2 ◮ g : N0 → N0 with g(x) = x + 3 ◮ (g ◦ f )(x) = x2 + 3 ◮ (f ◦ g)(x) = (x + 3)2
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 19 / 34
Operations on Partial Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 20 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 21 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 22 / 34
Properties of Functions
a b c d 1 2 3 4 5
injective
A B a b c d 1 2 3 4 5
not injective
A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 23 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 24 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 25 / 34
Properties of Functions
a b c d e 1 2 3 4
surjective
A B a b c d e 1 2 3 4
not surjective
A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 26 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 27 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 28 / 34
Properties of Functions
a b c d 1 2 3 4
bijection
A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 29 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 30 / 34
Properties of Functions
a b c d 1 2 3 4
f
A B a b c d 1 2 3 4
f −1
A B
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 31 / 34
Properties of Functions
1 For all x ∈ A it holds that f −1(f (x)) = x. 2 For all y ∈ B it holds that f (f −1(y)) = y. 3 (f −1)−1 = f
1 For x ∈ A let y = f (x). Then f −1(f (x)) = f −1(y) = x 2 For y ∈ B there is exactly one x with y = f (x). With this x
3 Def. of inverse: (f −1)−1(x) = y iff f −1(y) = x iff f (x) = y. Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 32 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 33 / 34
Properties of Functions
Malte Helmert, Gabriele R¨
Discrete Mathematics in Computer Science October 19, 2020 34 / 34