Equivalence Relations Partial Orderings - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Equivalence Relations Partial Orderings

Description:

Define what is an equivalence relation induced by another relation. ... all loops x, x on the diagraph must be present when. constructing r(R) ... – PowerPoint PPT presentation

Number of Views:209
Avg rating:3.0/5.0
Slides: 37
Provided by: isabellebi
Category:

less

Transcript and Presenter's Notes

Title: Equivalence Relations Partial Orderings


1
Equivalence RelationsPartial Orderings
2
Learning Objectives
  • Define what are equivalence relations.
  • Define equivalence classes and partition.
  • Define what is an equivalence relation induced by
    another relation.
  • Define what is a partial order.
  • Define what is the least element, greatest
    element, lexicographic order.
  • Define Hasse or Poset diagrams.
  • Define properties of these diagrams.

3
Equivalence Relations
  • Definition A relation R on a set A is an
    equivalence relation iff R is
  • reflexive
  • symmetric
  • and
  • transitive
  • _______________

4
Equivalence Relations
  • It is easy to recognize equivalence relations
    using
  • digraphs.
  • The subset of all elements related to a
    particular
  • element forms a universal relation (contains all
    possible
  • arcs) on that subset. The (sub)digraph
    representing the
  • subset is called a complete (sub)digraph. All
    arcs are
  • present.
  • The number of such subsets is called the rank
    of the
  • equivalence relation.

5
Equivalence Relations
  • Examples
  • A has 3 elements

6
Equivalence Relations
  • Each of the subsets is called an equivalence
    class.
  • A bracket around an element means the
    equivalence
  • class in which the element lies.
  • x y ltx, ygt is in R
  • The element in the bracket is called a
    representative
  • of the equivalence class. We could have chosen
    any one.
  • ____________________
  • Examples

7
Equivalence Relations
  • An interesting counting problem
  • Count the number of equivalence relations on a
    set A with
  • n elements. Can you find a recurrence relation?
  • The answers are
  • 1 for n 1
  • 3 for n 2
  • 5 for n 3
  • How many for n 4 ?

8
Equivalence Relations
  • Definition Let S1, S2, . . ., Sn be a collection
    of subsets of A. Then the collection forms a
    partition of A if the subsets are nonempty,
    disjoint and exhaust A
  • Si ¹ Æ
  • SiÇSj Æ if i ¹ j
  • U Si A

9
Equivalence Relations
  • Theorem The equivalence classes of an
    equivalence
  • relation R partition the set A into disjoint
    nonempty
  • subsets whose union is the entire set.
  • This partition is denoted A/R and called
  • the quotient set, or
  • the partition of A induced by R, or,
  • A modulo R.
  • _______________
  • Examples
  • A A
  • A Æ

10
Equivalence Relations
  • Theorem Let R be an equivalence relation on A.
    Then either
  • a b
  • or
  • aÇb Æ

11
Equivalence Relations
  • Theorem If R1 and R2 are equivalence relations
    on A then R1Ç R2 is an equivalence relation on A.
  • Proof It suffices to show that the intersection
    of
  • reflexive relations is reflexive,
  • symmetric relations is symmetric,
  • and
  • transitive relations is transitive.

12
Equivalence Relations
  • Definition The closure of a relation R with
    respect to
  • property P is the relation obtained by adding the
    minimum
  • number of ordered pairs to R to obtain property
    P.
  • In terms of the digraph representation of R
  • To find the reflexive closure - add loops.
  • To find the symmetric closure - add arcs in the
  • opposite direction.
  • To find the transitive closure - if there is a
    path from
  • a to b, add an arc from a to b.
  • _________________
  • Note Reflexive and symmetric closures are easy.
  • Transitive closures can be very complicated.

13
Equivalence Relations
  • Definition Let R be a relation on A. Then the
    reflexive, symmetric, transitive closure of R,
    tsr(R), is an equivalence relation on A, called
    the equivalence relation induced by R.
  • Example
  • A aÈb aÈb, c, d
  • A/R a, b, c, d

14
Equivalence Relations
  • Theorem tsr(R) is an equivalence relation
  • Proof
  • We have to be careful and show that tsr(R) is
    still
  • symmetric and reflexive.
  • Since we only add arcs vs. deleting arcs when
  • computing closures it must be that tsr(R) is
    reflexive since
  • all loops ltx, xgt on the diagraph must be present
    when
  • constructing r(R).
  • If there is an arc ltx, ygt then the symmetric
    closure
  • of r(R) ensures there is an arc lty, xgt.

15
Equivalence Relations
  • Now argue that if we construct the transitive
    closure
  • of sr(R) and we add an edge ltx, zgt because there
    is a path
  • from x to z, then there must also exist a path
    from z to x
  • (why?) and hence we also must add an edge ltz, xgt.
    Hence
  • the transitive closure of sr(R) is symmetric.
  • Q. E. D.
  • _____________________

16
Partial Ordering
  • Definition Let R be a relation on A. Then R is a
    partial
  • order iff R is
  • reflexive
  • antisymmetric
  • and
  • transitive
  • (A, R) is called a partially ordered set or a
    poset.
  • __________________

17
Partial Ordering
  • Note It is not required that two things be
    related under a partial order. That's the partial
    part of it.
  • If two objects are always related in a poset,
    it is called a total order or linear order or
    simple order. In this case (A, R) is called a
    chain.
  • _________________

18
Partial Ordering
  • Examples
  • (Z ) is a poset. In this case either a b or
    b a so
  • two things are always related. Hence, is a
    total order and
  • (Z, ) is a chain.
  • If S is a set then (P(S), Í ) is a poset. It
    may not be the case that A Í B or B Í A. Hence, Í
    is not a total order.
  • (Z, 'divides') is a poset which is not a
    chain.

19
Partial Ordering
  • Definition Let R be a total order on A and
    suppose S Í
  • A. An element s in S is a least element of S iff
    sRb for
  • every b in S.
  • Similarly for greatest element.
  • Note this implies that lta, sgt is not in R for
    any a unless a
  • s. (There is nothing smaller than s under the
    order R).
  • ___________________
  • Definition A chain (A, R) is well-ordered iff
    every
  • subset of A has a least element.
  • ___________________

20
Partial Ordering
  • Examples
  • (Z, ) is a chain but not well-ordered. Z does
    not
  • have least element.
  • (N, ) is well-ordered.
  • (N, ³) is not well-ordered.
  • __________________

21
Partial Ordering
  • Lexicographic Order
  • Given two posets (A1, R1) and (A2, R2) we
    construct an
  • induced partial order R on A1 A2
  • lt x1, y1gt R ltx2, y2gt iff
  • x1 R1 x2
  • or
  • x1 x2 and y1 R2 y2.
  • _________________

22
Partial Ordering
  • Example
  • Let A1 A2 Z and R1 R2 'divides'.
  • Then
  • lt2, 4gt R lt2, 8gt since x1 x2 and y1 R2 y2.
  • lt2, 4gt is not related under R tolt2, 6gt since x1
    x2
  • but 4 does not divide 6.
  • lt2, 4gt R lt4, 5gt since x1 R1 x2. (Note that 4 is
    not
  • related to 5).
  • This definition extends naturally to multiple
    Cartesian
  • products of partially ordered sets
  • A1 A2 A3 . . . An.

23
Partial Ordering
  • Example Using the same definitions of Ai and Ri
    as
  • above,
  • lt 2, 3, 4, 5gt R lt 2, 3, 8, 2gt since x1 x2, y1
    y2
  • and 4 divides 8.
  • lt2, 3, 4, 5gt is not related to lt3, 6, 8, 10gt
    since 2
  • does not divide 3.
  • _______________
  • Strings
  • We apply this ordering to strings of symbols
    where there is
  • an underlying 'alphabetical' or partial order
    (which is a
  • total order in this case).
  • ________________

24
Partial Ordering
  • Example
  • Let A a, b, c and suppose R is the natural
  • alphabetical order on A
  • a R b and b R c.
  • Then
  • Any shorter string is related to any longer
    string
  • (comes before it in the ordering).
  • If two strings have the same length then use
    the
  • induced partial order from the alphabetical
    order
  • aabc R abac

25
Partial Ordering
  • Hasse or Poset Diagrams
  • To construct a Hasse diagram
  • 1) Construct a digraph representation of the
    poset
  • (A, R) so that all arcs point up (except the
    loops).
  • 2) Eliminate all loops
  • 3) Eliminate all arcs that are redundant because
    of
  • transitivity
  • 4) eliminate the arrows at the ends of arcs since
  • everything points up.
  • _________________

26
Partial Ordering
  • The elements of P(a, b, c) are
  • Æ, a, b, c, a, b, a, c, b, c, a, b,
    c
  • The digraph is

27
Partial Ordering
  • Maximal and Minimal Elements
  • Definition Let (A, R) be a poset. Then a in A is
    a
  • minimal element if there does not exist an
    element b in A such that bRa.
  • Similarly for a maximal element.
  • _________________
  • Note there can be more than one minimal and
    maximal
  • element in a poset.
  • _________________
  • Example In the above Hasse diagram, Æ is a
    minimal
  • element and a, b, c is a maximal element.

28
Partial Ordering
  • Least and Greatest Elements
  • Definition Let (A, R) be a poset. Then a in A is
    the least
  • element if for every element b in A, aRb and b is
    the
  • greatest element if for every element a in A,
    aRb.
  • Theorem Least and greatest elements are unique.
  • Proof
  • Assume they are not. . .
  • ___________________
  • Example
  • In the poset above a, b, c is the greatest
    element. Æ is
  • the least element.

29
Partial Ordering
  • Upper and Lower Bounds
  • Definition Let S be a subset of A in the poset
    (A, R). If
  • there exists an element a in A such that sRa for
    all s in S,
  • then a is called an upper bound. Similarly for
    lower
  • bounds.
  • Note to be an upper bound you must be related to
    every
  • element in the set. Similarly for lower bounds.
  • _________________
  • Example
  • In the poset above, a, b, c, is an upper
    bound for
  • all other subsets. Æ is a lower bound for all
    other subsets.

30
Partial Ordering
  • Least Upper and Greatest Lower Bounds
  • Definition If a is an upper bound for S which is
    related
  • to all other upper bounds then it is the least
    upper bound,
  • denoted lub(S). Similarly for the greatest lower
    bound,
  • glb(S).
  • ___________________
  • Example
  • Consider the element a.
  • Since a, b, c, a, b a, c and a
  • are upper bounds and a is related to all of
    them, a
  • must be the lub. It is also the glb.

31
Partial Ordering
  • Lattices
  • Definition A poset is a lattice if every pair of
    elements has a lub and a glb.
  • __________________
  • Examples
  • In the poset (P(S), Í), lub(A, B) A È B. What
    is
  • the glb(A, B)?

32
Partial Ordering
  • Consider the elements 1 and 3.
  • Upper bounds of 1 are 1, 2, 4 and 5.
  • Upper bounds of 3 are 3, 2, 4 and 5.
  • 2, 4 and 5 are upper bounds for the pair 1 and
    3.
  • There is no lub since
  • - 2 is not related to 4
  • - 4 is not related to 2
  • - 2 and 4 are both related to 5.
  • There is no glb either.
  • The poset is not a lattice.

33
Partial Ordering
  • Topological Sorting
  • We impose a total ordering R on a poset
    compatible with the partial order.
  • Useful in PERT charts to determine an ordering
    of tasks
  • Useful in rendering in graphics to render
    objects from back to front to obscure hidden
    surfaces
  • A painter uses a topological sort when applying
    paint to a canvas - he/she paints parts of the
    scene furthest from the view first.
  • Algorithm To sort a poset (S, R).
  • Select a (any) minimal element and put it in
    the list.
  • Delete it from S.
  • Continue until all elements appear in the list
    (and S
  • is void).

34
Partial Ordering
  • Example
  • Consider the rectangles T and the relation R
    is more distant than. Then R is a partial order
    on the set of rectangles.
  • Two rectangles, Ti and Tj, are related, Ti R Tj,
    if Ti is more distant from the viewer than Tj.

35
Partial Ordering
  • Then 1R2, 1R4, 1R3, 4R9, 4R5, 3R2, 3R9, 3R6, 8R7.
  • The Hasse diagram for R is

36
Partial Ordering
  • Draw 1 (or 8) and delete 1 from the diagram to
    getNow draw 4 (or 3 or 8) and delete from
    the diagram.
  • Always choose a minimal element. Any one will
    do.
  • ...and so forth.
Write a Comment
User Comments (0)
About PowerShow.com