Discrete Mathematics in Computer Science Relations Malte Helmert, - - PowerPoint PPT Presentation

discrete mathematics in computer science
SMART_READER_LITE
LIVE PREVIEW

Discrete Mathematics in Computer Science Relations Malte Helmert, - - PowerPoint PPT Presentation

Discrete Mathematics in Computer Science Relations Malte Helmert, Gabriele R oger University of Basel Relations: Informally Informally, a relation is some property that is true or false for an (ordered) collection of objects. We already


slide-1
SLIDE 1

Discrete Mathematics in Computer Science

Relations Malte Helmert, Gabriele R¨

  • ger

University of Basel

slide-2
SLIDE 2

Relations: Informally

Informally, a relation is some property that is true or false for an (ordered) collection of objects. We already know some relations, e. g.

⊆ relation for sets ≤ relation for natural numbers

These are examples of binary relations, considering pairs of objects. There are also relations of higher arity, e. g.

“x + y = z” for integers x, y, z. “The name, address and office number belong to the same person.”

Relations are for example important for relational databases, semantic networks or knowledge representation and reasoning.

slide-3
SLIDE 3

Relations: Informally

Informally, a relation is some property that is true or false for an (ordered) collection of objects. We already know some relations, e. g.

⊆ relation for sets ≤ relation for natural numbers

These are examples of binary relations, considering pairs of objects. There are also relations of higher arity, e. g.

“x + y = z” for integers x, y, z. “The name, address and office number belong to the same person.”

Relations are for example important for relational databases, semantic networks or knowledge representation and reasoning.

slide-4
SLIDE 4

Relations: Informally

Informally, a relation is some property that is true or false for an (ordered) collection of objects. We already know some relations, e. g.

⊆ relation for sets ≤ relation for natural numbers

These are examples of binary relations, considering pairs of objects. There are also relations of higher arity, e. g.

“x + y = z” for integers x, y, z. “The name, address and office number belong to the same person.”

Relations are for example important for relational databases, semantic networks or knowledge representation and reasoning.

slide-5
SLIDE 5

Relations

Definition (Relation) Let S1, . . . , Sn be sets. A relation over S1, . . . , Sn is a set R ⊆ S1 × · · · × Sn. The arity of R is n. A relation of arity n is a set of n-tuples. The set contains the tuples for which the informal property is true.

slide-6
SLIDE 6

Relations: Examples

⊆ = {(S, S′) | S and S′ are sets and for every x ∈ S it holds that x ∈ S′} ≤ = {(x, y) | x, y ∈ N0 and x < y or x = y} R = {(x, y, z) | x, y, z ∈ Z and x + y = z} R′ = {(Gabi, Spiegelgasse 1, 04.005), (Salom´ e, Spiegelgasse 1, 04.002), (Florian, Spiegelgasse 1, 04.005), (Augusto, Spiegelgasse 5, 04.001)}

slide-7
SLIDE 7

Relations: Examples

⊆ = {(S, S′) | S and S′ are sets and for every x ∈ S it holds that x ∈ S′} ≤ = {(x, y) | x, y ∈ N0 and x < y or x = y} R = {(x, y, z) | x, y, z ∈ Z and x + y = z} R′ = {(Gabi, Spiegelgasse 1, 04.005), (Salom´ e, Spiegelgasse 1, 04.002), (Florian, Spiegelgasse 1, 04.005), (Augusto, Spiegelgasse 5, 04.001)}

slide-8
SLIDE 8

Relations: Examples

⊆ = {(S, S′) | S and S′ are sets and for every x ∈ S it holds that x ∈ S′} ≤ = {(x, y) | x, y ∈ N0 and x < y or x = y} R = {(x, y, z) | x, y, z ∈ Z and x + y = z} R′ = {(Gabi, Spiegelgasse 1, 04.005), (Salom´ e, Spiegelgasse 1, 04.002), (Florian, Spiegelgasse 1, 04.005), (Augusto, Spiegelgasse 5, 04.001)}

slide-9
SLIDE 9

Relations: Examples

⊆ = {(S, S′) | S and S′ are sets and for every x ∈ S it holds that x ∈ S′} ≤ = {(x, y) | x, y ∈ N0 and x < y or x = y} R = {(x, y, z) | x, y, z ∈ Z and x + y = z} R′ = {(Gabi, Spiegelgasse 1, 04.005), (Salom´ e, Spiegelgasse 1, 04.002), (Florian, Spiegelgasse 1, 04.005), (Augusto, Spiegelgasse 5, 04.001)}

slide-10
SLIDE 10

Discrete Mathematics in Computer Science

Properties of Binary Relations Malte Helmert, Gabriele R¨

  • ger

University of Basel

slide-11
SLIDE 11

Binary Relation

A binary relation is a relation of arity 2: Definition (binary relation) A binary relation is a relation over two sets A and B. Instead of (x, y) ∈ R, we also write xRy, e. g. x ≤ y instead of (x, y) ∈ ≤ If the sets are equal, we say “R is a binary relation over A” instead of “R is a binary relation over A and A”. Such a relation over a set is also called a homogeneous relation or an endorelation.

slide-12
SLIDE 12

Binary Relation

A binary relation is a relation of arity 2: Definition (binary relation) A binary relation is a relation over two sets A and B. Instead of (x, y) ∈ R, we also write xRy, e. g. x ≤ y instead of (x, y) ∈ ≤ If the sets are equal, we say “R is a binary relation over A” instead of “R is a binary relation over A and A”. Such a relation over a set is also called a homogeneous relation or an endorelation.

slide-13
SLIDE 13

Reflexivity

A reflexive relation relates every object to itself. Definition (reflexive) A binary relation R over set A is reflexive if for all a ∈ A it holds that (a, a) ∈ R. Which of these relations are reflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-14
SLIDE 14

Reflexivity

A reflexive relation relates every object to itself. Definition (reflexive) A binary relation R over set A is reflexive if for all a ∈ A it holds that (a, a) ∈ R. Which of these relations are reflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-15
SLIDE 15

Reflexivity

A reflexive relation relates every object to itself. Definition (reflexive) A binary relation R over set A is reflexive if for all a ∈ A it holds that (a, a) ∈ R. Which of these relations are reflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-16
SLIDE 16

Reflexivity

A reflexive relation relates every object to itself. Definition (reflexive) A binary relation R over set A is reflexive if for all a ∈ A it holds that (a, a) ∈ R. Which of these relations are reflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-17
SLIDE 17

Reflexivity

A reflexive relation relates every object to itself. Definition (reflexive) A binary relation R over set A is reflexive if for all a ∈ A it holds that (a, a) ∈ R. Which of these relations are reflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-18
SLIDE 18

Reflexivity

A reflexive relation relates every object to itself. Definition (reflexive) A binary relation R over set A is reflexive if for all a ∈ A it holds that (a, a) ∈ R. Which of these relations are reflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-19
SLIDE 19

Irreflexivity

A irreflexive relation never relates an object to itself. Definition (irreflexive) A binary relation R over set A is irreflexive if for all a ∈ A it holds that (a, a) / ∈ R. Which of these relations are irreflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-20
SLIDE 20

Irreflexivity

A irreflexive relation never relates an object to itself. Definition (irreflexive) A binary relation R over set A is irreflexive if for all a ∈ A it holds that (a, a) / ∈ R. Which of these relations are irreflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-21
SLIDE 21

Irreflexivity

A irreflexive relation never relates an object to itself. Definition (irreflexive) A binary relation R over set A is irreflexive if for all a ∈ A it holds that (a, a) / ∈ R. Which of these relations are irreflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-22
SLIDE 22

Irreflexivity

A irreflexive relation never relates an object to itself. Definition (irreflexive) A binary relation R over set A is irreflexive if for all a ∈ A it holds that (a, a) / ∈ R. Which of these relations are irreflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-23
SLIDE 23

Irreflexivity

A irreflexive relation never relates an object to itself. Definition (irreflexive) A binary relation R over set A is irreflexive if for all a ∈ A it holds that (a, a) / ∈ R. Which of these relations are irreflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-24
SLIDE 24

Irreflexivity

A irreflexive relation never relates an object to itself. Definition (irreflexive) A binary relation R over set A is irreflexive if for all a ∈ A it holds that (a, a) / ∈ R. Which of these relations are irreflexive? R = {(a, a), (a, b), (a, c), (b, a), (b, c), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-25
SLIDE 25

Symmetry

Definition (symmetric) A binary relation R over set A is symmetric if for all a, b ∈ A it holds that (a, b) ∈ R iff (b, a) ∈ R. Which of these relations are symmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-26
SLIDE 26

Symmetry

Definition (symmetric) A binary relation R over set A is symmetric if for all a, b ∈ A it holds that (a, b) ∈ R iff (b, a) ∈ R. Which of these relations are symmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-27
SLIDE 27

Symmetry

Definition (symmetric) A binary relation R over set A is symmetric if for all a, b ∈ A it holds that (a, b) ∈ R iff (b, a) ∈ R. Which of these relations are symmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-28
SLIDE 28

Symmetry

Definition (symmetric) A binary relation R over set A is symmetric if for all a, b ∈ A it holds that (a, b) ∈ R iff (b, a) ∈ R. Which of these relations are symmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-29
SLIDE 29

Symmetry

Definition (symmetric) A binary relation R over set A is symmetric if for all a, b ∈ A it holds that (a, b) ∈ R iff (b, a) ∈ R. Which of these relations are symmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-30
SLIDE 30

Symmetry

Definition (symmetric) A binary relation R over set A is symmetric if for all a, b ∈ A it holds that (a, b) ∈ R iff (b, a) ∈ R. Which of these relations are symmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-31
SLIDE 31

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-32
SLIDE 32

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-33
SLIDE 33

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-34
SLIDE 34

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-35
SLIDE 35

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-36
SLIDE 36

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-37
SLIDE 37

Asymmetry and Antisymmetry

Definition (asymmetric and antisymmetric) Let R be a binary relation over set A. Relation R is asymmetric if for all a, b ∈ A it holds that if (a, b) ∈ R then (b, a) / ∈ R. Relation R is antisymmetric if for all a, b ∈ A with a = b it holds that if (a, b) ∈ R then (b, a) / ∈ R. Which of these relations are asymmetric/antisymmetric? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers How do these properties relate to irreflexivity?

slide-38
SLIDE 38

Transitivity

Definition A binary relation R over set A is transitive if it holds for all a, b, c ∈ A that if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. Which of these relations are transitive? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-39
SLIDE 39

Transitivity

Definition A binary relation R over set A is transitive if it holds for all a, b, c ∈ A that if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. Which of these relations are transitive? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-40
SLIDE 40

Transitivity

Definition A binary relation R over set A is transitive if it holds for all a, b, c ∈ A that if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. Which of these relations are transitive? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-41
SLIDE 41

Transitivity

Definition A binary relation R over set A is transitive if it holds for all a, b, c ∈ A that if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. Which of these relations are transitive? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-42
SLIDE 42

Transitivity

Definition A binary relation R over set A is transitive if it holds for all a, b, c ∈ A that if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. Which of these relations are transitive? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-43
SLIDE 43

Transitivity

Definition A binary relation R over set A is transitive if it holds for all a, b, c ∈ A that if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. Which of these relations are transitive? R = {(a, a), (a, b), (a, c), (b, a), (c, a), (c, c)} over {a, b, c} R = {(a, a), (a, b), (a, c), (b, b), (b, c), (c, c)} over {a, b, c} equality relation = on natural numbers less-than relation ≤ on natural numbers strictly-less-than relation < on natural numbers

slide-44
SLIDE 44

Special Classes of Relations

Some important classes of relations are defined in terms of these properties.

Equivalence relation: reflexive, symmetric, transitive Partial order: reflexive, antisymmetric, transitive Strict order: irreflexive, asymmetric, transitive . . .

We will consider these and other classes in detail.