Relations Slides by Christopher M. Bourke Instructor: Berthe Y. - - PowerPoint PPT Presentation

relations
SMART_READER_LITE
LIVE PREVIEW

Relations Slides by Christopher M. Bourke Instructor: Berthe Y. - - PowerPoint PPT Presentation

Relations CSE235 Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 7.1, 7.37.5 of Rosen 1 / 1 cse235@cse.unl.edu


slide-1
SLIDE 1

Relations CSE235

Relations

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics

Sections 7.1, 7.3–7.5 of Rosen cse235@cse.unl.edu

1 / 1

slide-2
SLIDE 2

Relations CSE235

Introduction

Recall that a relation between elements of two sets is a subset

  • f their Cartesian product (of ordered pairs).

Definition

A binary relation from a set A to a set B is a subset R ⊆ A × B = {(a, b) | a ∈ A, b ∈ B} Note the difference between a relation and a function: in a relation, each a ∈ A can map to multiple elements in B. Thus, relations are generalizations of functions. If an ordered pair (a, b) ∈ R then we say that a is related to b. We may also use the notation aRb and aRb.

2 / 1

slide-3
SLIDE 3

Relations CSE235

Relations

To represent a relation, you can enumerate every element in R.

Example

Let A = {a1, a2, a3, a4, a5} and B = {b1, b2, b3} let R be a relation from A to B as follows: R = {(a1, b1), (a1, b2), (a1, b3), (a2, b1), (a3, b1), (a3, b2), (a3, b3), (a5, b1)} You can also represent this relation graphically.

3 / 1

slide-4
SLIDE 4

Relations CSE235

Relations

Graphical View

A B a1 a2 a3 a4 a5 b1 b2 b3

Figure: Graphical Representation of a Relation

4 / 1

slide-5
SLIDE 5

Relations CSE235

Relations

On a Set

Definition

A relation on the set A is a relation from A to A. I.e. a subset

  • f A × A.

Example

The following are binary relations on N: R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a, b ∈ N, a b ∈ Z} R3 = {(a, b) | a, b ∈ N, a − b = 2} Exercise: Give some examples of ordered pairs (a, b) ∈ N2 that are not in each of these relations.

5 / 1

slide-6
SLIDE 6

Relations CSE235

Reflexivity

Definition

There are several properties of relations that we will look at. If the ordered pairs (a, a) appear in a relation on a set A for every a ∈ A then it is called reflexive.

Definition

A relation R on a set A is called reflexive if ∀a ∈ A

  • (a, a) ∈ R
  • 6 / 1
slide-7
SLIDE 7

Relations CSE235

Reflexivity

Example

Example

Recall the following relations; which is reflexive? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a, b ∈ N, a

b ∈ Z}

R3 = {(a, b) | a, b ∈ N, a − b = 2}

7 / 1

slide-8
SLIDE 8

Relations CSE235

Reflexivity

Example

Example

Recall the following relations; which is reflexive? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a, b ∈ N, a

b ∈ Z}

R3 = {(a, b) | a, b ∈ N, a − b = 2} R1 is reflexive since for every a ∈ N, a ≤ a.

8 / 1

slide-9
SLIDE 9

Relations CSE235

Reflexivity

Example

Example

Recall the following relations; which is reflexive? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a, b ∈ N, a

b ∈ Z}

R3 = {(a, b) | a, b ∈ N, a − b = 2} R1 is reflexive since for every a ∈ N, a ≤ a. R2 is also reflexive since a

a = 1 is an integer.

9 / 1

slide-10
SLIDE 10

Relations CSE235

Reflexivity

Example

Example

Recall the following relations; which is reflexive? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a, b ∈ N, a

b ∈ Z}

R3 = {(a, b) | a, b ∈ N, a − b = 2} R1 is reflexive since for every a ∈ N, a ≤ a. R2 is also reflexive since a

a = 1 is an integer.

R3 is not reflexive since a − a = 0 for every a ∈ N.

10 / 1

slide-11
SLIDE 11

Relations CSE235

Symmetry I

Definition

Definition

A relation R on a set A is called symmetric if (b, a) ∈ R ⇐ ⇒ (a, b) ∈ R for all a, b ∈ A. A relation R on a set A is called antisymmetric if ∀a, b,

  • (a, b) ∈ R ∧ (b, a) ∈ R
  • → a = b
  • for all a, b ∈ A.

11 / 1

slide-12
SLIDE 12

Relations CSE235

Symmetry II

Definition

Some things to note: A symmetric relationship is one in which if a is related to b then b must be related to a. An antisymmetric relationship is similar, but such relations hold only when a = b. An antisymmetric relationship is not a reflexive relationship. A relation can be both symmetric and antisymmetric or neither or have one property but not the other! A relation that is not symmetric is not necessarily asymmetric.

12 / 1

slide-13
SLIDE 13

Relations CSE235

Symmetric Relations

Example

Example

Let R = {(x, y) ∈ R2 | x2 + y2 = 1}. Is R reflexive? Symmetric? Antisymmetric?

13 / 1

slide-14
SLIDE 14

Relations CSE235

Symmetric Relations

Example

Example

Let R = {(x, y) ∈ R2 | x2 + y2 = 1}. Is R reflexive? Symmetric? Antisymmetric? It is clearly not reflexive since for example (2, 2) ∈ R.

14 / 1

slide-15
SLIDE 15

Relations CSE235

Symmetric Relations

Example

Example

Let R = {(x, y) ∈ R2 | x2 + y2 = 1}. Is R reflexive? Symmetric? Antisymmetric? It is clearly not reflexive since for example (2, 2) ∈ R. It is symmetric since x2 + y2 = y2 + x2 (i.e. addition is commutative).

15 / 1

slide-16
SLIDE 16

Relations CSE235

Symmetric Relations

Example

Example

Let R = {(x, y) ∈ R2 | x2 + y2 = 1}. Is R reflexive? Symmetric? Antisymmetric? It is clearly not reflexive since for example (2, 2) ∈ R. It is symmetric since x2 + y2 = y2 + x2 (i.e. addition is commutative). It is not antisymmetric since (1

3, √ 8 3 ) ∈ R and ( √ 8 3 , 1 3) ∈ R

but 1

3 = √ 8 3

16 / 1

slide-17
SLIDE 17

Relations CSE235

Transitivity

Definition

Definition

A relation R on a set A is called transitive if whenever (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R for all a, b, c ∈ R. Equivalently, ∀a, b, c ∈ A

  • (aRb ∧ bRc) → aRc
  • 17 / 1
slide-18
SLIDE 18

Relations CSE235

Transitivity

Examples

Example

Is the relation R = {(x, y) ∈ R2 | x ≤ y} transitive?

Example

Is the relation R = {(a, b), (b, a), (a, a)} transitive?

18 / 1

slide-19
SLIDE 19

Relations CSE235

Transitivity

Examples

Example

Is the relation R = {(x, y) ∈ R2 | x ≤ y} transitive? Yes it is transitive since (x ≤ y) ∧ (y ≤ z) ⇒ x ≤ z.

Example

Is the relation R = {(a, b), (b, a), (a, a)} transitive?

19 / 1

slide-20
SLIDE 20

Relations CSE235

Transitivity

Examples

Example

Is the relation R = {(x, y) ∈ R2 | x ≤ y} transitive? Yes it is transitive since (x ≤ y) ∧ (y ≤ z) ⇒ x ≤ z.

Example

Is the relation R = {(a, b), (b, a), (a, a)} transitive? No since bRa and aRb but bRb.

20 / 1

slide-21
SLIDE 21

Relations CSE235

Transitivity

Examples

Example

Is the relation {(a, b) | a is an ancestor of b} transitive?

Example

Is the relation {(x, y) | x2 ≥ y} transitive?

21 / 1

slide-22
SLIDE 22

Relations CSE235

Transitivity

Examples

Example

Is the relation {(a, b) | a is an ancestor of b} transitive? Yes, if a is an ancestor of b and b is an ancestor of c then a is also an ancestor of b (who is the youngest here?).

Example

Is the relation {(x, y) | x2 ≥ y} transitive?

22 / 1

slide-23
SLIDE 23

Relations CSE235

Transitivity

Examples

Example

Is the relation {(a, b) | a is an ancestor of b} transitive? Yes, if a is an ancestor of b and b is an ancestor of c then a is also an ancestor of b (who is the youngest here?).

Example

Is the relation {(x, y) | x2 ≥ y} transitive?

  • No. For example, (2, 4) ∈ R and (4, 10) ∈ R (i.e. 22 ≥ 4 and

42 = 16 ≥ 10) but 22 < 10 thus (2, 10) ∈ R.

23 / 1

slide-24
SLIDE 24

Relations CSE235

Other Properties

Definition

A relation is irreflexive if ∀a

  • (a, a) ∈ R
  • A relation is asymmetric if

∀a, b

  • (a, b) ∈ R → (b, a) ∈ R
  • Lemma

A relation R on a set A is asymmetric if and only if R is irreflexive and R is antisymmetric.

24 / 1

slide-25
SLIDE 25

Relations CSE235

Combining Relations

Relations are simply sets, that is subsets of ordered pairs of the Cartesian product of a set. It therefore makes sense to use the usual set operations, intersection ∩, union ∪ and set difference A \ B to combine relations to create new relations. Sometimes combining relations endows them with the properties previously discussed. For example, two relations may not be transitive alone, but their union may be.

25 / 1

slide-26
SLIDE 26

Relations CSE235

Combining Relations

Example

Let A = {1, 2, 3, 4} B = {1, 2, 3} R1 = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 4), (4, 1), (4, 2)} R2 = {(1, 1), (1, 2), (1, 3), (2, 3)} Then

26 / 1

slide-27
SLIDE 27

Relations CSE235

Combining Relations

Example

Let A = {1, 2, 3, 4} B = {1, 2, 3} R1 = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 4), (4, 1), (4, 2)} R2 = {(1, 1), (1, 2), (1, 3), (2, 3)} Then R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (3, 4), (4, 1), (4, 2)}

27 / 1

slide-28
SLIDE 28

Relations CSE235

Combining Relations

Example

Let A = {1, 2, 3, 4} B = {1, 2, 3} R1 = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 4), (4, 1), (4, 2)} R2 = {(1, 1), (1, 2), (1, 3), (2, 3)} Then R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (3, 4), (4, 1), (4, 2)} R1 ∩ R2 = {(1, 2), (1, 3)}

28 / 1

slide-29
SLIDE 29

Relations CSE235

Combining Relations

Example

Let A = {1, 2, 3, 4} B = {1, 2, 3} R1 = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 4), (4, 1), (4, 2)} R2 = {(1, 1), (1, 2), (1, 3), (2, 3)} Then R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (3, 4), (4, 1), (4, 2)} R1 ∩ R2 = {(1, 2), (1, 3)} R1 \ R2 = {(1, 4), (2, 2), (3, 4), (4, 1), (4, 2)}

29 / 1

slide-30
SLIDE 30

Relations CSE235

Combining Relations

Example

Let A = {1, 2, 3, 4} B = {1, 2, 3} R1 = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 4), (4, 1), (4, 2)} R2 = {(1, 1), (1, 2), (1, 3), (2, 3)} Then R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (3, 4), (4, 1), (4, 2)} R1 ∩ R2 = {(1, 2), (1, 3)} R1 \ R2 = {(1, 4), (2, 2), (3, 4), (4, 1), (4, 2)} R2 \ R1 = {(1, 1), (2, 3}

30 / 1

slide-31
SLIDE 31

Relations CSE235

Definition

Let R1 be a relation from the set A to B and R2 be a relation from B to C. I.e. R1 ⊆ A × B, R2 ⊆ B × C. The composite

  • f R1 and R2 is the relation consisting of ordered pairs (a, c)

where a ∈ A, c ∈ C and for which there exists and element b ∈ B such that (a, b) ∈ R1 and (b, c) ∈ R2. We denote the composite of R1 and R2 by R1 ◦ R2

31 / 1

slide-32
SLIDE 32

Relations CSE235

Powers of Relations

Using this composite way of combining relations (similar to function composition) allows us to recursively define powers of a relation R.

Definition

Let R be a relation on A. The powers, Rn, n = 1, 2, 3, . . ., are defined recursively by R1 = R Rn+1 = Rn ◦ R

32 / 1

slide-33
SLIDE 33

Relations CSE235

Powers of Relations

Example

Consider R = {(1), (2, 1), (3, 2), (4, 3)} R2= R3: R4: Notice that Rn = R3 for n=4, 5, 6, . . .

33 / 1

slide-34
SLIDE 34

Relations CSE235

Powers of Relations

The powers of relations give us a nice characterization of transitivity.

Theorem

A relation R is transitive if and only if Rn ⊆ R for n = 1, 2, 3, . . ..

34 / 1

slide-35
SLIDE 35

Relations CSE235

Equivalence Relations

Consider the set of every person in the world. Now consider a relation such that (a, b) ∈ R if a and b are siblings. Clearly, this relation is: reflexive, symmetric, and transitive. Such a unique relation is called and equivalence relation.

Definition

A relation on a set A is an equivalence relation if it is reflexive, symmetric and transitive.

69 / 1

slide-36
SLIDE 36

Relations CSE235

Equivalence Classes I

Though a relation on a set A may not be an equivalence relation, we can defined a subset of A such that R does become an equivalence relation (for that subset).

Definition

Let R be an equivalence relation on the set A and let a ∈ A. The set of all elements in A that are related to a is called the equivalence class of a. We denote this set [a]R (we omit R when there is no ambiguity as to the relation). That is, [a]R = {s | (a, s) ∈ R, s ∈ A}

70 / 1

slide-37
SLIDE 37

Relations CSE235

Equivalence Classes II

Elements in [a]R are called representatives of the equivalence class.

Theorem

Let R be an equivalence relation on a set A. The following are equivalent:

1 aRb 2 [a] = [b] 3 [a] ∩ [b] = ∅

The proof in the book is a cicular proof.

71 / 1

slide-38
SLIDE 38

Relations CSE235

Partitions I

Equivalence classes are important because they can partition a set A into disjoint non-empty subsets A1, A2, . . . , Al where each equivalence class is self-contained. Note that a partition satisfies these properties: l

i=1 Ai = A

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

72 / 1

slide-39
SLIDE 39

Relations CSE235

Partitions II

For example, if R is a relation such that (a, b) ∈ R if a and b live in the US and live in the same state, then R is an equivalence relation that partitions the set of people who live in the US into 50 equivalence classes.

Theorem

Let R be an equivalence relation on a set S. Then the equivalence classes of R form a partition of S. Conversely, given a partition Ai of the set S, there is an equivalence relation R that has the sets Ai as its equivalence classes.

73 / 1

slide-40
SLIDE 40

Relations CSE235

Visual Interpretation

In a 0-1 matrix, if the elements are ordered into their equivalence classes, equivalence classes/partitions form perfect squares of 1s (and zeros else where). In a digraph, equivalence classes form a collection of disjoint complete graphs.

Example

Say that we have A = {1, 2, 3, 4, 5, 6, 7} and R is an equivalence relation that partitions A into A1 = {1, 2}, A2 = {3, 4, 5, 6} and A3 = {7}. What does the 0-1 matrix look like? Digraph?

74 / 1

slide-41
SLIDE 41

Relations CSE235

Equivalence Relations

Example I

Example

Let R = {(a, b) | a, b ∈ R, a ≤ b} Reflexive? Transitive? Symmetric?

75 / 1

slide-42
SLIDE 42

Relations CSE235

Equivalence Relations

Example I

Example

Let R = {(a, b) | a, b ∈ R, a ≤ b} Reflexive? Transitive? Symmetric? No, it is not since, in particular 4 ≤ 5 but 5 ≤ 4.

76 / 1

slide-43
SLIDE 43

Relations CSE235

Equivalence Relations

Example I

Example

Let R = {(a, b) | a, b ∈ R, a ≤ b} Reflexive? Transitive? Symmetric? No, it is not since, in particular 4 ≤ 5 but 5 ≤ 4. Thus, R is not an equivalence relation.

77 / 1

slide-44
SLIDE 44

Relations CSE235

Equivalence Relations

Example II

Example

Let R = {{(a, b) | a, b ∈ Z, a = b} Reflexive? Transitive? Symmetric? What are the equivalence classes that partition Z?

78 / 1

slide-45
SLIDE 45

Relations CSE235

Equivalence Relations

Example III

Example

For (x, y), (u, v) ∈ R2 define R =

  • (x, y), (u, v)
  • | x2 + y2 = u2 + v2

Show that R is an equivalence relation. What are the equivalence classes it defines (i.e. what are the partitions of R?

79 / 1

slide-46
SLIDE 46

Relations CSE235

Equivalence Relations

Example IV

Example

Given n, r ∈ N, define the set nZ + r = {na + r | a ∈ Z}

80 / 1

slide-47
SLIDE 47

Relations CSE235

Equivalence Relations

Example IV

Example

Given n, r ∈ N, define the set nZ + r = {na + r | a ∈ Z} For n = 2, r = 0, 2Z represents the equivalence class of all even integers.

81 / 1

slide-48
SLIDE 48

Relations CSE235

Equivalence Relations

Example IV

Example

Given n, r ∈ N, define the set nZ + r = {na + r | a ∈ Z} For n = 2, r = 0, 2Z represents the equivalence class of all even integers. What n, r give the equivalence class of all odd integers?

82 / 1

slide-49
SLIDE 49

Relations CSE235

Equivalence Relations

Example IV

Example

Given n, r ∈ N, define the set nZ + r = {na + r | a ∈ Z} For n = 2, r = 0, 2Z represents the equivalence class of all even integers. What n, r give the equivalence class of all odd integers? If we set n = 3, r = 0 we get the equivalence class of all integers divisible by 3.

83 / 1

slide-50
SLIDE 50

Relations CSE235

Equivalence Relations

Example IV

Example

Given n, r ∈ N, define the set nZ + r = {na + r | a ∈ Z} For n = 2, r = 0, 2Z represents the equivalence class of all even integers. What n, r give the equivalence class of all odd integers? If we set n = 3, r = 0 we get the equivalence class of all integers divisible by 3. If we set n = 3, r = 1 we get the equivalence class of all integers divisible by 3 with a remainder of one.

84 / 1

slide-51
SLIDE 51

Partial Orders CSE235

Partial Orders

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics

Sections 7.6 of Rosen cse235@cse.unl.edu

1 / 1

slide-52
SLIDE 52

Partial Orders CSE235

Partial Orders I

Motivating Introduction

Consider the recent renovation of Avery Hall. In this process several things had to be done. Remove Asbestos Replace Windows Paint Walls Refinish Floors Assign Offices Move in Office-Furniture.

2 / 1

slide-53
SLIDE 53

Partial Orders CSE235

Partial Orders II

Motivating Introduction

Clearly, some things had to be done before others could even begin—Asbestos had to be removed before anything; painting had to be done before the floors to avoid ruining them, etc. On the other hand, several things could have been done concurrently—painting could be done while replacing the windows and assigning office could have been done at anytime. Such a scenario can be nicely modeled using partial orderings.

3 / 1

slide-54
SLIDE 54

Partial Orders CSE235

Partial Orderings I

Definition

Definition

A relation R on a set S is called a partial order if it is reflexive, antisymmetric and transitive. A set S together with a partial

  • rdering R is called a partially ordered set or poset for short

and is denoted (S, R) Partial orderings are used to give an order to sets that may not have a natural one. In our renovation example, we could define an ordering such that (a, b) ∈ R if a must be done before b can be done.

4 / 1

slide-55
SLIDE 55

Partial Orders CSE235

Partial Orderings II

Definition

We use the notation a b to indicate that (a, b) ∈ R is a partial order and a ≺ b when a = b. The notation ≺ is not to be mistaken for “less than equal to.” Rather, ≺ is used to denote any partial ordering. Latex notation: \preccurlyeq, \prec.

5 / 1

slide-56
SLIDE 56

Partial Orders CSE235

Comparability

Definition

The elements a and b of a poset (S, ) are called comparable if either a b or b a. When a, b ∈ S such that neither are comparable, we say that they are incomparable. Looking back at our renovation example, we can see that Remove Asbestos ≺ ai for all activities ai. Also, Paint Walls ≺ Refinish Floors Some items are also incomparable—replacing windows can be done before, after or during the assignment of offices.

6 / 1

slide-57
SLIDE 57

Partial Orders CSE235

Total Orders

Definition

If (S, ) is a poset and every two elements of S are comparable, S is called a totally ordered set. The relation is said to be a total order.

Example

The set of integers over the relation “less than equal to” is a total order; (Z, ≤) since for every a, b ∈ Z, it must be the case that a ≤ b or b ≤ a. What happens if we replace ≤ with <?

7 / 1

slide-58
SLIDE 58

Partial Orders CSE235

Well-Orderings

Definition

(S, ) is a well-ordered set if it is a poset such that is a total

  • rdering and such that every nonempty subset of S has a least

element

Example

The natural numbers along with ≤, (N, ≤) is a well-ordered set since any subset of N will have a least element and ≤ is a total

  • rdering on N as before.

However, (Z, ≤) is not a well-ordered set. Why? Is it totally

  • rdered?

8 / 1

slide-59
SLIDE 59

Partial Orders CSE235

Principle of Well-Ordered Induction

Well-ordered sets are the basis of the proof technique known as induction (more when we cover Chapter 3).

Theorem (Principle of Well-Ordered Induction)

Suppose that S is a well ordered set. Then P(x) is true for all x ∈ S if Basis Step: P(x0) is true for the least element of S and Induction Step: For every y ∈ S if P(x) is true for all x ≺ y then P(y) is true.

9 / 1

slide-60
SLIDE 60

Partial Orders CSE235

Principle of Well-Ordered Induction

Proof

Suppose it is not the case that (P(x) holds for all x ∈ S ⇒ ∃y P(y) is false ⇒ A = {x ∈ S|P(x) is false} is not empty. Since S is well ordered, A has a least element a. P(x0) is true ⇒ a = x0. P(x) holds for all x ∈ S and x ≺ a, then P(a) holds, by the induction step. This yields a contradiction.

  • 10 / 1
slide-61
SLIDE 61

Partial Orders CSE235

Lexicographic Orderings I

Lexicographic ordering is the same as any dictionary or phone book—we use alphabetical order starting with the first character in the string, then the next character (if the first was equal) etc. (you can consider “no character” for shorter words to be less than “a”).

11 / 1

slide-62
SLIDE 62

Partial Orders CSE235

Lexicographic Orderings II

Formally, lexicographic ordering is defined by combining two

  • ther orderings.

Definition

Let (A1, 1) and (A2, 2) be two posets. The lexicographic

  • rdering on the Cartesian product A1 × A2 is defined by

(a1, a2) (a′

1, a′ 2)

if a1 ≺1 a′

1 or if a1 = a′ 1 and a2 2 a′ 2.

12 / 1

slide-63
SLIDE 63

Partial Orders CSE235

Lexicographic Orderings III

Lexicographic ordering generalizes to the Cartesian product of n sets in the natural way. Define on A1 × A2 × · · · × An by (a1, a2, . . . , an) ≺ (b1, b2, . . . , bn) if a1 ≺ b1 or if there is an integer i > 0 such that a1 = b1, a2 = b2, . . . , ai = bi and ai+1 ≺ bi+1

13 / 1

slide-64
SLIDE 64

Partial Orders CSE235

Lexicographic Orderings I

Strings

Consider the two non-equal strings a1a2 · · · am and b1b2 · · · bn

  • n a poset S.

Let t = min(n, m) and ≺ is the lexicographic ordering on St. a1a2 · · · am is less than b1b2 · · · bn if and only if (a1, a2, . . . , at) ≺ (b1, b2, . . . , bt), or (a1, a2, . . . , at) = (b1, b2, . . . , bt) and m < n

14 / 1

slide-65
SLIDE 65

Partial Orders CSE235

Hasse Diagrams

As with relations and functions, there is a convenient graphical representation for partial orders—Hasse Diagrams. Consider the digraph representation of a partial order—since we know we are dealing with a partial order, we implicitly know that the relation must be reflexive and transitive. Thus we can simplify the graph as follows: Remove all self-loops. Remove all transitive edges. Make the graph direction-less—that is, we can assume that the orientations are upwards. The resulting diagram is far simpler.

15 / 1

slide-66
SLIDE 66

Partial Orders CSE235

Hasse Diagram

Example

a1 a2 a3 a4 a5 Remove Self-Loops

16 / 1

slide-67
SLIDE 67

Partial Orders CSE235

Hasse Diagram

Example

a1 a2 a3 a4 a5 Remove Transitive Loops

17 / 1

slide-68
SLIDE 68

Partial Orders CSE235

Hasse Diagram

Example

a1 a2 a3 a4 a5 Remove Orientation

18 / 1

slide-69
SLIDE 69

Partial Orders CSE235

Hasse Diagram

Example

a1 a2 a3 a4 a5 Hasse Diagram!

19 / 1

slide-70
SLIDE 70

Partial Orders CSE235

Hasse Diagrams

Example

Of course, you need not always start with the complete relation in the partial order and then trim everything. Rather, you can build a Hasse directly from the partial order.

Example

Draw a Hasse diagram for the partial ordering {(a, b) | a | b}

  • n {1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60} (these are the divisors
  • f 60 which form the basis of the ancient Babylonian base-60

numeral system)

20 / 1

slide-71
SLIDE 71

Partial Orders CSE235

Hasse Diagrams

Example Answer

1 2 3 5 4 6 10 15 12 20 30 60

21 / 1