Ch 8 Relations 8 1 Relations and their

  • Slides: 28
Download presentation
Ch. 8: Relations 8. 1 Relations and their Properties

Ch. 8: Relations 8. 1 Relations and their Properties

Functions Recall ch. 1: Functions Def. of Function: f: A→B assigns a unique element

Functions Recall ch. 1: Functions Def. of Function: f: A→B assigns a unique element of B to each element of A

Functions- Examples and Non. Examples Ex: students and grades

Functions- Examples and Non. Examples Ex: students and grades

Function Ex Ex: A={1, 2, 3, 4, 5, 6}, B={a, b, c, d, e,

Function Ex Ex: A={1, 2, 3, 4, 5, 6}, B={a, b, c, d, e, f} {(1, a), (2, c), (3, b), (4, f), (5, b), (6, c)} is a subset of Ax. B Also show graphical format.

Relations are also subsets of Ax. B, without the above uniqueness requirement of functions.

Relations are also subsets of Ax. B, without the above uniqueness requirement of functions. Def. of Relations: Let A and B be sets. A binary relation from A to B is a subset of Ax. B. Special Case: A relation on the set A is a relation from A to A.

Examples of relations • Flights

Examples of relations • Flights

Review of Ax. B • Recall that Ax. B={(a, b)|a � A and b

Review of Ax. B • Recall that Ax. B={(a, b)|a � A and b � B} • For A={1, 2, 3} and B={x, y}, find Ax. B • Find Ax. A

Functions and Relations • Do a few examples of students and grades and determine

Functions and Relations • Do a few examples of students and grades and determine if they are functions and/or relations

Notations for Relations Notations: • Graphical • Tabular • Ordered pairs • a. Rb

Notations for Relations Notations: • Graphical • Tabular • Ordered pairs • a. Rb • later: matrices and digraphs

Properties for a relation A relation R on a set A is called: •

Properties for a relation A relation R on a set A is called: • reflexive if (a, a) � R for every a � A • symmetric if (b, a) � R whenever (a, b) � R for a, b � A • antisymmetric : (a, b) � R and (b, a) � R only if a=b for a, b � A • transitive if whenever (a, b) � R and (b, c) � R, then (a, c) � R for a, b, c � A

Alternative notation A relation R on a set A is called: • • reflexive

Alternative notation A relation R on a set A is called: • • reflexive if a. Ra for every a � A symmetric if b. Ra whenever a. Rb for every a, b � A antisymmetric : a. Rb and b. Ra only if a=b for a, b � A transitive if whenever a. Rb and b. Rc, then a. Rc for every a, b, c � A

Question • What does RST show? • RAT?

Question • What does RST show? • RAT?

Ex: Consider the following relations R on the set A of all people. Determine

Ex: Consider the following relations R on the set A of all people. Determine which properties (RSAT) hold: 1. R={(a, b)| a is older than b } circle if so: 2. R={(a, b)| a lives within 10 miles of b } RSAT 3. R={(a, b)| a is a cousin of b } RSAT 4. R={(a, b)| a has the same last name as b } RSAT

More examples- R on the set A of all people. 5. R={(a, b)| a’s

More examples- R on the set A of all people. 5. R={(a, b)| a’s last name starts with the same letter as b’s } R S A T 6. R={(a, b)| a is a (full) sister of b } R S A T

Let A=set of subsets of a nonempty set 7. R={(a, b)| a is a

Let A=set of subsets of a nonempty set 7. R={(a, b)| a is a subset of b } R S A T

Let A={1, 2, 3, 4} 8. R={(a, b)| a divides b } R={(1, 1),

Let A={1, 2, 3, 4} 8. R={(a, b)| a divides b } R={(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), …} R S A T 9. R={(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)} R S A T

Let A=Z (integers) 10. R={(a, b)| a≤ b } R S A T 11.

Let A=Z (integers) 10. R={(a, b)| a≤ b } R S A T 11. R={(a, b)| a=b+1 } R S A T 12. R={(1, 1), (2, 2), (3, 3) } R S A T

Number of relations-questions How many relations are there on a set with 4 elements?

Number of relations-questions How many relations are there on a set with 4 elements? Ax. A has ___ elements. So number of subsets is ___ How many relations are there on a set with n elements? ___ Number of reflexive relations on a set with n elements • The other ___may or may not be in. • So ___ reflexive relations.

Number of relations- Answers How many relations are there on a set with 4

Number of relations- Answers How many relations are there on a set with 4 elements? Ax. A has 4^2=16 elements. So number of subsets is 216 How many relations are there on a set with n elements? 2 n^2 Number of reflexive relations on a set with n elements • The other n(n-1) may or may not be in. • So 2 n(n-1) reflexive relations.

Combining Relations Ex: sets A={1, 2, 3}, B={1, 2, 3, 4}; Relations: R={(1, 1),

Combining Relations Ex: sets A={1, 2, 3}, B={1, 2, 3, 4}; Relations: R={(1, 1), (2, 2), (3, 3)}, S={(1, 1), (1, 2), (1, 3), (1, 4)} R∩S R� S R – S S – R

Def. of Composite Let R be a relations from A to B and S

Def. of Composite Let R be a relations from A to B and S a relations from B to C. The composite of R and S: S ο R = {(a, c)| a � A, c �C, and there exists b � B such that (a, b) � R and (b, c) � S}

Composite example Ex 1: R from {0, 1, 2, 3, 4} to {0, 1,

Composite example Ex 1: R from {0, 1, 2, 3, 4} to {0, 1, 2, 3, 4}, S from {0, 1, 2, 3, 4} to {0, 1, 2, 3, 4} R={(1, 0), (1, 1), (2, 2), (3, 0), (3, 1)} S={(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)} Find S ο R Find R ο S

Ex 2 Ex. 2: R and S on the set of all people: Let

Ex 2 Ex. 2: R and S on the set of all people: Let R={(a, b)| a is the mother of b} S={(a, b)|a is the spouse of b} Find S ο R Find R ο S

Def of powers Def: Let R be a relation on the set A. The

Def of powers Def: Let R be a relation on the set A. The powers Rn, n=1, 2, 3, … are defined inductively by R 1=R and Rn+1=Rn R

Ex Ex: R={(1, 1), (2, 1), (3, 2), (4, 3)} R 2= {(1, 1),

Ex Ex: R={(1, 1), (2, 1), (3, 2), (4, 3)} R 2= {(1, 1), (2, 1), (3, 1), (4, 2)} R 3=… Show R 4=R 3 So Rn=R 3 for n=4, . .

Ex: R={(1, 1), (1, 2), (3, 4), (4, 5), (3, 5)} R 2 =

Ex: R={(1, 1), (1, 2), (3, 4), (4, 5), (3, 5)} R 2 = {(1, 1), (1, 2), (3, 5)} R 3={(1, 1), (1, 2)} R 4=R 3 so Rn=R 3

Thm. 1 Theorem 1: Let R be a transitive relation on a set A.

Thm. 1 Theorem 1: Let R be a transitive relation on a set A. Then Rn is a subset of R for n=1, 2, 3, … Proof— what method would work well?

Proof By Induction: N=1: trivially true Inductive Step: Assume Rn � R where n�

Proof By Induction: N=1: trivially true Inductive Step: Assume Rn � R where n� Z+. Show: _______ Assume (a, b) � R n+1. (Question: Show? ____) Then, since R n+1 = R n ο R, _______ Since ______, then ____ � R. Since _______ then ______ � R.