24
1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

Embed Size (px)

Citation preview

Page 1: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

1

Lecture 2

Equivalence RelationsReading: Epp Chp 10.3

Page 2: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

2

Overview – Equivalence Relations

1. Revision

2. Definition of an Equivalence Relation

3. Examples (and non-examples)

4. Visualization Tool

5. From Equivalence Relationsto Equivalence Classesto Partitions

6. From Partitionsto Equivalence Relations

7. Another Example

Page 3: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

3

1. Revision

Concrete World

Abstract World

a. ___ has been to ___ {John, Mary, Peter} {Tokyo, NY, HK} {(John,Tokyo), (John,NY), (Peter, NY)}

b. ___ is in ___ {Tokyo, NY} {Japan, USA} {(Tokyo,Japan),(NY,USA)}

c. ___ divides ___ {1,2,3,4} {10,11,12} {(1,10),(1,11),(1,12), (2,10), (2,12),(3,12), (4,12)}

d. ___ less than ___ {1,2,3} {1,2,3} {(1,2),(1,3),(2,3)}

___ R ___ A B R A B

Q: What can you do with relations?A: (1) Set Operations; (2) Complement; (3) Inverse; (4) Composition

Q: What happens if A = B?

Relation R from A to B

Page 4: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

4

1. Revision

Concrete Worlda. ___ same age as ___ {John, Mary, Peter} {(John,John), (Mary,Mary) (Peter,Peter),

(Mary,Peter), (Peter,Mary)}

b. ___ same # of elements as ___

{ {}, {1}, {2}, {3.4} } { ({},{}), ({1},{1}), ({2},{2}) ({3,4},{3,4})({1},{2}), ({2},{1})

c. ___ ___ { {}, {1}, {2}, {1,2} } { ({},{}), ({},{1}), ({},{2}), ({},{1,2}),({1},{1}), ({1},{1,2}), ({2},{2}), ({2},{1,2})

({1,2},{1,2}) }

d. ___ ___ {1,2,3} {(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)}

___ R ___ A R A2 Relation R on A

“Everyone is related to himself”

“If x is related to y and y is related to z, then x is related to z.”

Reflexive

Transitive

“If x is related to y, then y is related to x”

“If x is related to y and y is related to x, then x = y.”

Symmetric

Anti-Symmetric

Page 5: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

5

1. Revision

Given a relation R on a set A,– R is reflexive iff

xA, x R x– R is symmetric iff

x,yA, x R y y R x– R is anti-symmetric iff

x,yA, x R y y R x x=y– R is transitive iff

x,yA, x R y y R z x R z

Page 6: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

6

Overview – Equivalence Relations

1. Revision

2. Definition of an Equivalence Relation

3. Examples (and non-examples)

4. Visualization Tool

5. From Equivalence Relationsto Equivalence Classesto Partitions

6. From Partitionsto Equivalence Relations

7. Another Example

Page 7: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

7

2. Definition

Given a relation R on a set A,– R is an equivalence relation iff

R is reflexive, symmetric and transitive. (Today’s Lecture)

– R is a partial order iff

R is reflexive, anti-symmetric and transitive.

(Next Lectures)

Page 8: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

8

2. Definition

Given a relation R on a set A,– R is an equivalence relation iff

R is reflexive, symmetric and transitive.

Q: How do I check whether a relation is an equivalence relation?

A: Just check whether it is reflexive, symmetric and transitive. (Always go back to the definition.)

Q: How do I check whether a relation is reflexive, symmetric and transitive?

A: Again, go back to the definitions of reflexive, symmetric and transitive. (Previous Lecture)

Page 9: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

9

3 Examples (EqRel in life)

3.1 Let S be the set of all second year students. Define a relation C on S such that

x C y iff x and y take at least 1 course in common

Q1: Is C reflexive?(xS, x C x) ??? Yes.

Q2: Is C symmetric? (x,yS, x C y y C x) ??? Yes.

Q3: Is C transitive? (x,yS, x C y y C z x C z) ??? NO!!!

Therefore C is NOT an equivalence relation.

Page 10: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

10

3 Examples (EqRel in life)

3.2 Let S be the set of all second year students. Define a relation N on S such that

x N y iff x and y take NO courses in common

Q1: Is N reflexive?(xS, x N x) ??? NO!!!.

Q2: Is N symmetric? (x,yS, x N y y N x) ??? Yes.

Q3: Is N transitive? (x,yS, x N y y N z x N z) ??? NO!!!

Therefore N is NOT an equivalence relation.

Page 11: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

11

3 Examples (EqRel in life)

3.3 Let S be the set of all people this room. Define a relation T on S such that

x T y iff x is of equal or taller height than y

Q1: Is T reflexive?(xS, x T x) ??? Yes.

Q2: Is T symmetric? (x,yS, x T y y T x) ??? NO!!!

Q3: Is T transitive? (x,yS, x T y y T z x T z) ??? Yes.

Therefore T is NOT an equivalence relation.

Page 12: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

12

3 Examples (EqRel in life)

3.4 Let S be the set of all people in this room. Define a relation M on S such that

x M y iff x is born in the same month as y

Q1: Is M reflexive?(xS, x M x) ??? Yes.

Q2: Is M symmetric? (x,yS, x M y y M x) ??? Yes.

Q3: Is M transitive? (x,yS, x M y y M z x M z) ??? Yes.

Therefore M is an equivalence relation.

Page 13: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

13

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q1: Is R reflexive? Reflexive : xA, x R x

(Always go back to the definition) Yes!

Page 14: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

14

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q2: Is R symmetric? Symmetric : x,yA, x R y y R x

(Always go back to the definition)

Page 15: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

15

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q2: Is R symmetric? Symmetric : x,yA, x R y y R x

(Always go back to the definition)

Page 16: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

16

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q2: Is R symmetric? Symmetric : x,yA, x R y y R x

(Always go back to the definition)

Page 17: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

17

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q2: Is R symmetric? Symmetric : x,yA, x R y y R x

(Always go back to the definition)

Page 18: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

18

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q2: Is R symmetric? Symmetric : x,yA, x R y y R x

(Always go back to the definition)

Page 19: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

19

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q2: Is R symmetric? Symmetric : x,yA, x R y y R x

(Always go back to the definition) Yes, R is symmetric.

Page 20: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

20

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q3: Is R transitive? Transitive : x,yA, x R y y R z x R z

(Always go back to the definition)

Page 21: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

21

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q3: Is R transitive? Transitive : x,yA, x R y y R z x R z

(Always go back to the definition)

Page 22: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

22

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q3: Is R transitive? Transitive : x,yA, x R y y R z x R z

(Always go back to the definition)

Page 23: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

23

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q3: Is R transitive? Transitive : x,yA, x R y y R z x R z

(Always go back to the definition)

Page 24: 1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

24

3 Examples (Finite Eq Rels)

3.5 Let A = {0,1,2,3,4}

Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)}

Is R an equivalence relation?

Q3: Is R transitive? Transitive : x,yA, x R y y R z x R z

(Always go back to the definition) Carry on with checking … Yes, R is transitive.