CSE115/ENGR160 Discrete Mathematics 05/03/12 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

CSE115/ENGR160 Discrete Mathematics 05/03/12

Description:

CSE115/ENGR160 Discrete Mathematics 05/03/12 Ming-Hsuan Yang UC Merced * * * * * * * * * * * 9.4 Equivalence relation In traditional C, only the first 8 characters of ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 20
Provided by: CindaHee
Category:

less

Transcript and Presenter's Notes

Title: CSE115/ENGR160 Discrete Mathematics 05/03/12


1
CSE115/ENGR160 Discrete Mathematics05/03/12
  • Ming-Hsuan Yang
  • UC Merced

2
9.4 Equivalence relation
  • In traditional C, only the first 8 characters of
    a variable are checked by the complier
  • Let R be relation on the set of strings of
    characters s.t. sRt where s and t are two
    strings, if s and t are at least 8 characters
    long and the first 8 characters of s and t agree,
    or st
  • Easy to see R is reflexive, symmetric, and
    transitive

3
Example
  • The integers a and b are related by the
    congruence modulo 4 relation when 4 divides a-b
  • We will see this relation is reflexive, symmetric
    and transitive
  • The above-mentioned two relations are examples of
    equivalence relations, namely, relations that are
    reflexive, symmetric, and transitive

4
Equivalence relation
  • A relation on a set A is called an equivalence
    relation if it is reflexive, symmetric, and
    transitive
  • Important property in mathematics and computer
    science
  • Two elements a and b are related by an
    equivalence relation are called equivalent,
    denoted by a b, a and b are equivalent elements
    w.r.t. a particular equivalence relation

5
Example
  • Let R be the relation on the set of integers s.t.
    aRb iff ab or a-b
  • We previously showed that R is reflexive,
    symmetric, and transitive
  • R is reflexive, aRa iff aa or a-a
  • R is symmetric, aRb if ab or a-b, then ba or
    b-a and so bRa (also for the only if part)
  • R is transitive, if aRb and bRc, then (ab or
    a-b) and (bc or b-c). So ac or a-c. Thus aRc
    (also for the only if part)
  • If follows that R is an equivalence relation

6
Example
  • Let R be the relation on the set of real numbers
    s.t. aRb iff a-b is an integer. Is R an
    equivalence relation?
  • Since a-a0 is an integer for all real number a,
    aRa for all a. Hence R is reflexive
  • Now suppose aRb, then a-b is an integer, so b-a
    is an integer. Hence bRa. Thus R is symmetric
  • If aRb and bRc, then a-b and b-c are integers.
    So, a-c(a-b)(b-c) is an integer. Hence aRc.
    Thus R is transitive
  • Consequently, R is an equivalence relation

7
Example
  • Let m be a positive integer with mgt1. Show that
    the relation R(a,b)a b (mod m) is an
    equivalence relation on the set of integers
  • Recall ab (mod m) iff m divides a-b. Note that
    a-a0 is divided by m. Hence aa (mod m). So
    congruence modulo m is reflexive
  • Suppose ab(mod m), then a-b is divisible by m,
    so a-bkm, where k is an integer. It follows
    b-a(-k)m, so ba(mod m). Hence, congruence
    modulo m is symmetric

8
Example
  • Suppose ab(mod m) and bc(mod m). Then m divides
    both a-b and b-c. Thus, there are integers k and
    l with a-bkm and b-clm
  • Put them together a-c(a-b)(b-c) kmlm
    (kl)m. Thus ac(mod m). So, congruence modulo m
    is transitive
  • It follows that congruence modulo m is an
    equivalence relation

9
Example
  • Let R be the relation on the set of real numbers
    s.t. xRy iff x and y are real numbers that differ
    by less than 1, that is x-ylt1. Show that R is
    not an equivalence relation
  • R is reflexive as x-x0lt1 where x ? R
  • R is symmetric for if xRy, then x-ylt1, which
    tells us y-xlt1. So yRx
  • R is not transitive. Take x2.8, y1.9, z1.1, so
    that x-y0.9lt1, y-z0.8lt1, but x-z1.7gt1
  • So R is not an equivalence relation

10
9.6 Partial orderings
  • Often use relations to order some or all of the
    elements of sets
  • Example order words, schedule projects
  • A relation R on a set S is called partial
    ordering or partial order if it is reflexive,
    antisymmetric, and transitive
  • A set S together with a partial ordering R is
    called partially ordered set, or poset, and is
    denoted by (S,R)
  • Members of S are called elements of the poset

11
Example
  • Show that the greater than or equal relation (
    ) is a partial ordering on the set of integers
  • is reflexive as a a
  • is antisymmetric as if a b and b a then ab
  • is transitive as if if ab and bc then a c
  • (Z, ) is a poset

12
Example
  • The divisbility relation is a partial ordering
    on the set of positive integers, as it is
    reflexive, antisymmetric, and transitive
  • We see that (Z, ) is a poset

13
Example
  • Show that inclusion ? is a partial ordering (the
    relation of one set being a subset of another is
    called inclusion) on the power set of a set S
  • Example power set of 0,1,2 is P(0,1,2) Ø,
    0, 1, 2, 0,1, 0,2, 1,2, 0,1,2
  • A ? A whenever A is a subset of S, so ? is
    reflexive
  • It is antiysmmetric as A ? B and B ? A imply that
    AB
  • It is transitive as A ? B and B ? C imply that A
    ? C. Hence ? is a partial ordering on P(S), and
    (P(S), ?) is a poset

14
Example
  • Let R be the relation on the set of people s.t.
    xRy if x and y are people and x is older than y.
    Show that R is not a partial ordering
  • R is antisymmetric if a person x is order than a
    person y, then y is not order than x
  • R is transitive
  • R is not reflexive as no person is older than
    himself/herself

15
Relation in any poset
  • In different posets different symbols such as ,
    ? and are used for a partial ordering
  • Need a symbol we can use when we discuss the
    ordering in an arbitrary poset
  • The notation a ? b is used to denote (a,b)?R in
    an arbitrary poset (S,R)
  • ? is used as the less than or equal to
    relation on the set of real numbers is the most
    familiar example of a partial ordering, and
    similar to symbol
  • ? is used for any poset, not just less than or
    equals relation , i.e., (S, ?)

16
Comparable
  • The elements a and b of a poset (S, ?) are called
    comparable if either a?b or b?a. When a and b are
    elements of S s.t. neither a?b nor b?a, a and b
    are incomparable
  • In the poset (Z, ), are the integers 3 and 9
    comparable? Are 5 and 7 comparable?
  • The integers 3 and 9 are comparable as 39. the
    integers 5 and 7 are incomparable as 5 does not
    divide 7 and 7 does not divide 5

17
Total ordering
  • Pairs of elements may be incomparable and thus we
    have partial ordering
  • When every 2 elements in the set are comparable,
    the relation is called total ordering
  • If (S, ?) is a poset and every two elements of S
    are comparable, S is called a totally ordered or
    linearly ordered set, and ? is called a total
    order or a linear order
  • A totally ordered set is also called a chain

18
Example
  • The poset (Z, ) is totally ordered as a b or
    b a whenever a and b are integers
  • The poset (Z, ) is not tally ordered as it
    contains elements that are incomparable, such as
    5 and 7

19
Well-ordered set
  • (S, ?) is a well-ordered set if it is a poset
    s.t. ? is a total ordering and every nonempty
    subset of S has a least element
  • The set of ordered pairs of positive integers,
    ZZ with (a1, a2) (b1, b2) if a1 lt a2 or if
    a1b1 and a2 b2 (the lexicographic ordering), is
    a well-ordered set
  • The set Z, with the usual ordering, is not
    well-ordered as the set of negative integers has
    no least element
Write a Comment
User Comments (0)
About PowerShow.com