Discrete Mathematics & Mathematical Reasoning Basic Structures: - - PowerPoint PPT Presentation

discrete mathematics mathematical reasoning basic
SMART_READER_LITE
LIVE PREVIEW

Discrete Mathematics & Mathematical Reasoning Basic Structures: - - PowerPoint PPT Presentation

Discrete Mathematics & Mathematical Reasoning Basic Structures: Sets, Functions and Relations Colin Stirling Informatics Some slides based on ones by Myrto Arapinis Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today


slide-1
SLIDE 1

Discrete Mathematics & Mathematical Reasoning Basic Structures: Sets, Functions and Relations

Colin Stirling

Informatics

Some slides based on ones by Myrto Arapinis

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 1 / 24

slide-2
SLIDE 2

Some important sets

B = {true, false} Boolean values N = {0, 1, 2, 3, . . . } Natural numbers Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . . } Integers Z+ = {1, 2, 3, . . . } Positive integers R Real numbers R+ Positive real numbers Q Rational numbers C Complex numbers ∅ Empty set

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 2 / 24

slide-3
SLIDE 3

Sets defined using comprehension

S = {x | P(x) } where P(x) is a predicate

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 3 / 24

slide-4
SLIDE 4

Sets defined using comprehension

S = {x | P(x) } where P(x) is a predicate Example Subsets of sets upon which an order is defined [a, b] = {x | a ≤ x ≤ b} closed interval [a, b) = {x | a ≤ x < b} (a, b] = {x | a < x ≤ b} (a, b) = {x | a < x < b}

  • pen interval

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 3 / 24

slide-5
SLIDE 5

Notation

x ∈ S membership

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-6
SLIDE 6

Notation

x ∈ S membership A ∪ B union; A ∩ B intersection; A − B difference

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-7
SLIDE 7

Notation

x ∈ S membership A ∪ B union; A ∩ B intersection; A − B difference A ⊆ B subset; A ⊇ B superset

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-8
SLIDE 8

Notation

x ∈ S membership A ∪ B union; A ∩ B intersection; A − B difference A ⊆ B subset; A ⊇ B superset A = B set equality

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-9
SLIDE 9

Notation

x ∈ S membership A ∪ B union; A ∩ B intersection; A − B difference A ⊆ B subset; A ⊇ B superset A = B set equality P(A) powerset (set of all subsets of A); also 2A

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-10
SLIDE 10

Notation

x ∈ S membership A ∪ B union; A ∩ B intersection; A − B difference A ⊆ B subset; A ⊇ B superset A = B set equality P(A) powerset (set of all subsets of A); also 2A |A| cardinality

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-11
SLIDE 11

Notation

x ∈ S membership A ∪ B union; A ∩ B intersection; A − B difference A ⊆ B subset; A ⊇ B superset A = B set equality P(A) powerset (set of all subsets of A); also 2A |A| cardinality A × B cartesian product (tuple sets)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 4 / 24

slide-12
SLIDE 12

A proper mathematical definition of set is complicated (Russell’s paradox)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-13
SLIDE 13

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-14
SLIDE 14

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself The set of non-cats (all things that are not cats) is a member of itself

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-15
SLIDE 15

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-16
SLIDE 16

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = {x | x ∈ x} (using naive comprehension)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-17
SLIDE 17

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = {x | x ∈ x} (using naive comprehension) Question: is S a member of itself (S ∈ S) ?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-18
SLIDE 18

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = {x | x ∈ x} (using naive comprehension) Question: is S a member of itself (S ∈ S) ? S ∈ S provided that S ∈ S; S ∈ S provided that S ∈ S

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-19
SLIDE 19

A proper mathematical definition of set is complicated (Russell’s paradox)

The set of cats is not a member of itself The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = {x | x ∈ x} (using naive comprehension) Question: is S a member of itself (S ∈ S) ? S ∈ S provided that S ∈ S; S ∈ S provided that S ∈ S Modern formulations (such as Zermelo-Fraenkel set theory) restrict comprehension. (However, it is impossible to prove in ZF that ZF is consistent unless ZF is inconsistent.)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 5 / 24

slide-20
SLIDE 20

Functions

Assume A and B are non-empty sets

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 6 / 24

slide-21
SLIDE 21

Functions

Assume A and B are non-empty sets A function f from A to B is an assignment of exactly one element

  • f B to each element of A

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 6 / 24

slide-22
SLIDE 22

Functions

Assume A and B are non-empty sets A function f from A to B is an assignment of exactly one element

  • f B to each element of A

f(a) = b if f assigns b to a

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 6 / 24

slide-23
SLIDE 23

Functions

Assume A and B are non-empty sets A function f from A to B is an assignment of exactly one element

  • f B to each element of A

f(a) = b if f assigns b to a f : A → B if f is a function from A to B

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 6 / 24

slide-24
SLIDE 24

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-25
SLIDE 25

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-26
SLIDE 26

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-27
SLIDE 27

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-28
SLIDE 28

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-29
SLIDE 29

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES Is the squaring function ·2 : Z → Z injective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-30
SLIDE 30

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES Is the squaring function ·2 : Z → Z injective? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-31
SLIDE 31

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES Is the squaring function ·2 : Z → Z injective? NO Is the function | · | : R → R injective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-32
SLIDE 32

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES Is the squaring function ·2 : Z → Z injective? NO Is the function | · | : R → R injective? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-33
SLIDE 33

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES Is the squaring function ·2 : Z → Z injective? NO Is the function | · | : R → R injective? NO Assume m > 1. Is mod m : Z → {0, . . . , m − 1} injective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-34
SLIDE 34

One-to-one or injective functions

Definition

f : A → B is injective iff ∀a, c ∈ A (if f(a) = f(c) then a = c) Is the identity function ιA : A → A injective? YES Is the function √· : Z+ → R+ injective? YES Is the squaring function ·2 : Z → Z injective? NO Is the function | · | : R → R injective? NO Assume m > 1. Is mod m : Z → {0, . . . , m − 1} injective? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 24

slide-35
SLIDE 35

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-36
SLIDE 36

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-37
SLIDE 37

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-38
SLIDE 38

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-39
SLIDE 39

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-40
SLIDE 40

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO Is the function ·2 : Z → Z surjective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-41
SLIDE 41

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO Is the function ·2 : Z → Z surjective? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-42
SLIDE 42

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO Is the function ·2 : Z → Z surjective? NO Is the function | · | : R → R surjective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-43
SLIDE 43

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO Is the function ·2 : Z → Z surjective? NO Is the function | · | : R → R surjective? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-44
SLIDE 44

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO Is the function ·2 : Z → Z surjective? NO Is the function | · | : R → R surjective? NO Assume m > 1. Is mod m : Z → {0, . . . , m − 1} surjective?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-45
SLIDE 45

Onto or surjective functions

Definition

f : A → B is surjective iff ∀b ∈ B ∃a ∈ A (f(a) = b) Is the identity function ιA : A → A surjective? YES Is the function √· : Z+ → R+ surjective? NO Is the function ·2 : Z → Z surjective? NO Is the function | · | : R → R surjective? NO Assume m > 1. Is mod m : Z → {0, . . . , m − 1} surjective? YES

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 24

slide-46
SLIDE 46

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-47
SLIDE 47

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-48
SLIDE 48

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-49
SLIDE 49

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES Is the function √· : R+ → R+ a bijection?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-50
SLIDE 50

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES Is the function √· : R+ → R+ a bijection? YES

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-51
SLIDE 51

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES Is the function √· : R+ → R+ a bijection? YES Is the function ·2 : R → R a bijection?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-52
SLIDE 52

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES Is the function √· : R+ → R+ a bijection? YES Is the function ·2 : R → R a bijection? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-53
SLIDE 53

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES Is the function √· : R+ → R+ a bijection? YES Is the function ·2 : R → R a bijection? NO Is the function | · | : R → R a bijection?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-54
SLIDE 54

One-to-one correspondence or bijection

Definition

f : A → B is a bijection iff it is both injective and surjective Is the identity function ιA : A → A a bijection? YES Is the function √· : R+ → R+ a bijection? YES Is the function ·2 : R → R a bijection? NO Is the function | · | : R → R a bijection? NO

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 24

slide-55
SLIDE 55

Function composition

Definition

Let f : B → C and g : A → B. The composition function f ◦ g : A → C is (f ◦ g)(a) = f(g(a))

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 24

slide-56
SLIDE 56

Results about function composition

Theorem

The composition of two functions is a function

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 24

slide-57
SLIDE 57

Results about function composition

Theorem

The composition of two functions is a function

Theorem

The composition of two injective functions is an injective function

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 24

slide-58
SLIDE 58

Results about function composition

Theorem

The composition of two functions is a function

Theorem

The composition of two injective functions is an injective function

Theorem

The composition of two surjective functions is a surjective function

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 24

slide-59
SLIDE 59

Results about function composition

Theorem

The composition of two functions is a function

Theorem

The composition of two injective functions is an injective function

Theorem

The composition of two surjective functions is a surjective function

Corollary

The composition of two bijections is a bijection

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 24

slide-60
SLIDE 60

Inverse function

Definition

If f : A → B is a bijection, then the inverse of f, written f −1 : B → A is f −1(b) = a iff f(a) = b

f A B a = f –1(b) b = f(a) f(a) f –1(b) f –1 1 Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 24

slide-61
SLIDE 61

Inverse function

Definition

If f : A → B is a bijection, then the inverse of f, written f −1 : B → A is f −1(b) = a iff f(a) = b

f A B a = f –1(b) b = f(a) f(a) f –1(b) f –1 1

What is the inverse of ιA : A → A?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 24

slide-62
SLIDE 62

Inverse function

Definition

If f : A → B is a bijection, then the inverse of f, written f −1 : B → A is f −1(b) = a iff f(a) = b

f A B a = f –1(b) b = f(a) f(a) f –1(b) f –1 1

What is the inverse of ιA : A → A? What is the inverse of √:R+ → R+?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 24

slide-63
SLIDE 63

Inverse function

Definition

If f : A → B is a bijection, then the inverse of f, written f −1 : B → A is f −1(b) = a iff f(a) = b

f A B a = f –1(b) b = f(a) f(a) f –1(b) f –1 1

What is the inverse of ιA : A → A? What is the inverse of √:R+ → R+? What is f −1 ◦ f? and f ◦ f −1?

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 24

slide-64
SLIDE 64

The floor and ceiling functions

Definition

The floor function ⌊ ⌋ : R → Z is ⌊x⌋ equals the largest integer less than or equal to x

Definition

The ceiling function ⌈ ⌉ : R → Z is ⌈x⌉ equals the smallest integer greater than or equal to x

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 13 / 24

slide-65
SLIDE 65

The floor and ceiling functions

Definition

The floor function ⌊ ⌋ : R → Z is ⌊x⌋ equals the largest integer less than or equal to x

Definition

The ceiling function ⌈ ⌉ : R → Z is ⌈x⌉ equals the smallest integer greater than or equal to x 1 2

  • =
  • −1

2

  • = ⌊0⌋ = ⌈0⌉ = 0

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 13 / 24

slide-66
SLIDE 66

The floor and ceiling functions

Definition

The floor function ⌊ ⌋ : R → Z is ⌊x⌋ equals the largest integer less than or equal to x

Definition

The ceiling function ⌈ ⌉ : R → Z is ⌈x⌉ equals the smallest integer greater than or equal to x 1 2

  • =
  • −1

2

  • = ⌊0⌋ = ⌈0⌉ = 0

⌊−6.1⌋ = −7 ⌈6.1⌉ = 7

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 13 / 24

slide-67
SLIDE 67

Useful tips about floors and ceilings

When showing properties of floors is to let x = n + ǫ if ⌊x⌋ = n where 0 ≤ ǫ < 1 Similarly, for ceilings let x = n − ǫ if ⌈x⌉ = n where 0 ≤ ǫ < 1

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 24

slide-68
SLIDE 68

Useful tips about floors and ceilings

When showing properties of floors is to let x = n + ǫ if ⌊x⌋ = n where 0 ≤ ǫ < 1 Similarly, for ceilings let x = n − ǫ if ⌈x⌉ = n where 0 ≤ ǫ < 1 Prove ∀x ∈ R (⌊2x⌋ = ⌊x⌋ + ⌊x + 1/2⌋)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 24

slide-69
SLIDE 69

Useful tips about floors and ceilings

When showing properties of floors is to let x = n + ǫ if ⌊x⌋ = n where 0 ≤ ǫ < 1 Similarly, for ceilings let x = n − ǫ if ⌈x⌉ = n where 0 ≤ ǫ < 1 Prove ∀x ∈ R (⌊2x⌋ = ⌊x⌋ + ⌊x + 1/2⌋) Proof in book

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 24

slide-70
SLIDE 70

Prove ⌈x⌉ + ⌈y⌉ = ⌈x + y⌉

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 24

slide-71
SLIDE 71

Prove ⌈x⌉ + ⌈y⌉ = ⌈x + y⌉

False; counterexample x = 1/2 and y = 1/2

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 24

slide-72
SLIDE 72

The factorial function

Definition

The factorial function f : N → N, denoted as f(n) = n! assigns to n the product of the first n positive integers f(0) = 0! = 1 and f(n) = n! = 1 · 2 · · · · · (n − 1) · n

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 24

slide-73
SLIDE 73

Relations

Definition

A binary relation R on sets A and B is a subset R ⊆ A × B

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 17 / 24

slide-74
SLIDE 74

Relations

Definition

A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples (a, b) with a ∈ A and b ∈ B

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 17 / 24

slide-75
SLIDE 75

Relations

Definition

A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples (a, b) with a ∈ A and b ∈ B Often we write a R b for (a, b) ∈ R

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 17 / 24

slide-76
SLIDE 76

Relations

Definition

A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples (a, b) with a ∈ A and b ∈ B Often we write a R b for (a, b) ∈ R R is a relation on A if B = A

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 17 / 24

slide-77
SLIDE 77

Relations

Definition

A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples (a, b) with a ∈ A and b ∈ B Often we write a R b for (a, b) ∈ R R is a relation on A if B = A

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 17 / 24

slide-78
SLIDE 78

Relations

Definition

A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples (a, b) with a ∈ A and b ∈ B Often we write a R b for (a, b) ∈ R R is a relation on A if B = A

Definition

Given sets A1, . . . , An, a subset R ⊆ A1 × · · · × An is an n-ary relation

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 17 / 24

slide-79
SLIDE 79

Examples

Divides | : Z+ × Z+ is {(n, m) | ∃k ∈ Z+ (m = kn)}

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 18 / 24

slide-80
SLIDE 80

Examples

Divides | : Z+ × Z+ is {(n, m) | ∃k ∈ Z+ (m = kn)} Let m > 1 be an integer. R = {(a, b) | a mod m = b mod m}

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 18 / 24

slide-81
SLIDE 81

Examples

Divides | : Z+ × Z+ is {(n, m) | ∃k ∈ Z+ (m = kn)} Let m > 1 be an integer. R = {(a, b) | a mod m = b mod m} Written as a ≡ b (mod m)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 18 / 24

slide-82
SLIDE 82

Properties of binary relations

A binary relation R on A is called reflexive iff ∀x ∈ A (x, x) ∈ R

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 19 / 24

slide-83
SLIDE 83

Properties of binary relations

A binary relation R on A is called reflexive iff ∀x ∈ A (x, x) ∈ R ≤, =, and | are reflexive, but < is not

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 19 / 24

slide-84
SLIDE 84

Properties of binary relations

A binary relation R on A is called reflexive iff ∀x ∈ A (x, x) ∈ R ≤, =, and | are reflexive, but < is not symmetric iff ∀x, y ∈ A ((x, y) ∈ R → (y, x) ∈ R) = is symmetric, but ≤, <, and | are not

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 19 / 24

slide-85
SLIDE 85

Properties of binary relations

A binary relation R on A is called reflexive iff ∀x ∈ A (x, x) ∈ R ≤, =, and | are reflexive, but < is not symmetric iff ∀x, y ∈ A ((x, y) ∈ R → (y, x) ∈ R) = is symmetric, but ≤, <, and | are not antisymmetric iff ∀x, y ∈ A (((x, y) ∈ R ∧ (y, x) ∈ R) → x = y)

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 19 / 24

slide-86
SLIDE 86

Properties of binary relations

A binary relation R on A is called reflexive iff ∀x ∈ A (x, x) ∈ R ≤, =, and | are reflexive, but < is not symmetric iff ∀x, y ∈ A ((x, y) ∈ R → (y, x) ∈ R) = is symmetric, but ≤, <, and | are not antisymmetric iff ∀x, y ∈ A (((x, y) ∈ R ∧ (y, x) ∈ R) → x = y) ≤, =, <, and | are antisymmetric

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 19 / 24

slide-87
SLIDE 87

Properties of binary relations

A binary relation R on A is called reflexive iff ∀x ∈ A (x, x) ∈ R ≤, =, and | are reflexive, but < is not symmetric iff ∀x, y ∈ A ((x, y) ∈ R → (y, x) ∈ R) = is symmetric, but ≤, <, and | are not antisymmetric iff ∀x, y ∈ A (((x, y) ∈ R ∧ (y, x) ∈ R) → x = y) ≤, =, <, and | are antisymmetric transitive iff ∀x, y, z ∈ A (((x, y) ∈ R ∧ (y, z) ∈ R) → (x, z) ∈ R) ≤, =, <, and | are transitive

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 19 / 24

slide-88
SLIDE 88

Equivalence relations

Definition

A relation R on a set A is an equivalence relation iff it is reflexive, symmetric and transitive

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 20 / 24

slide-89
SLIDE 89

Equivalence relations

Definition

A relation R on a set A is an equivalence relation iff it is reflexive, symmetric and transitive Let Σ∗ be the set of strings over alphabet Σ. The relation {(s, t) ∈ Σ∗ × Σ∗ | |s| = |t|} is an equivalence relation

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 20 / 24

slide-90
SLIDE 90

Equivalence relations

Definition

A relation R on a set A is an equivalence relation iff it is reflexive, symmetric and transitive Let Σ∗ be the set of strings over alphabet Σ. The relation {(s, t) ∈ Σ∗ × Σ∗ | |s| = |t|} is an equivalence relation | on integers is not an equivalence relation.

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 20 / 24

slide-91
SLIDE 91

Equivalence relations

Definition

A relation R on a set A is an equivalence relation iff it is reflexive, symmetric and transitive Let Σ∗ be the set of strings over alphabet Σ. The relation {(s, t) ∈ Σ∗ × Σ∗ | |s| = |t|} is an equivalence relation | on integers is not an equivalence relation. For m > 1 be an integer the relation ≡ (mod m) is an equivalence relation on integers

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 20 / 24

slide-92
SLIDE 92

Equivalence classes

Definition

Let R be an equivalence relation on a set A and a ∈ A. Let [a]R = {s | (a, s) ∈ R} be the equivalence class of a w.r.t. R If b ∈ [a]R then b is called a representative of the equivalence class. Every member of the class can be a representative

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 21 / 24

slide-93
SLIDE 93

Theorem

Result

Let R be an equivalence on A and a, b ∈ A. The following three statements are equivalent

1

aRb

2

[a]R = [b]R

3

[a]R ∩ [b]R = ∅

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 22 / 24

slide-94
SLIDE 94

Theorem

Result

Let R be an equivalence on A and a, b ∈ A. The following three statements are equivalent

1

aRb

2

[a]R = [b]R

3

[a]R ∩ [b]R = ∅ Proof in book

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 22 / 24

slide-95
SLIDE 95

Partitions of a set

Definition

A partition of a set A is a collection of disjoint, nonempty subsets that have A as their union. In other words, the collection of subsets Ai ⊆ A with i ∈ I (where I is an index set) forms a partition of A iff

1

Ai = ∅ for all i ∈ I

2

Ai ∩ Aj = ∅ for all i = j ∈ I

3

  • i∈I Ai = A

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 23 / 24

slide-96
SLIDE 96

Result

Theorem

1

If R is an equivalence on A, then the equivalence classes of R form a partition of A

2

Conversely, given a partition {Ai | i ∈ I} of A there exists an equivalence relation R that has exactly the sets Ai, i ∈ I, as its equivalence classes

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 24 / 24

slide-97
SLIDE 97

Result

Theorem

1

If R is an equivalence on A, then the equivalence classes of R form a partition of A

2

Conversely, given a partition {Ai | i ∈ I} of A there exists an equivalence relation R that has exactly the sets Ai, i ∈ I, as its equivalence classes Proof in book

Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 24 / 24