Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function.

Similar presentations


Presentation on theme: "EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function."— Presentation transcript:

1 EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function

2 EE1J2 - Slide 2 Relations Suppose A = {0,1,2,3}. An example of a relation on A is ‘<’ This relation is defined by the set R = {0<1, 0<2, 0<3, 1<2, 1<3, 2<3} or, equivalently R = {(0,1), (0,2), (0,3), (1,2), (1,3), (2,3)}  A  A So, a relation on A is a subset of R  A  A

3 EE1J2 - Slide 3 Equivalence relations A relation ~ is an equivalence relation on a set S if and only if: a ~ a for every a  S (~ reflexive) If a~b then b~a a,b  S (~ symmetric) If a~b and b~c then a~c (~ transitive) a,b,c  S If ~ is an equivalence relation and a~b, then we can say that a is equivalent to b

4 EE1J2 - Slide 4 Examples S is the set of all people in the UK R 1 : x,y  S, x~y if and only if x and y are the same age. This is an equivalence relation on S R 2 : x,y  S, x~y if and only if x and y own a copy of the same book. This is not an equivalence relation. Why? R 3: x,y  S, x~y if and only if x and y both own a copy of ‘War and Peace’. This is an equivalence relation on S

5 EE1J2 - Slide 5 Partitions Suppose A is a set. A partition P of A is a set of subsets of A, P = {P 1,…,P N } such that: P n  P m =  if n  m P 1  P 2  …  P N = A

6 EE1J2 - Slide 6 Partitions - example S P1P1 P2P2 P3P3 {P 1,P 2,P 3 } is a partition of S P1P1 P2P2 P3P3 {P 1,P 2,P 3 } is not a partition – P 1  P 2  P 3  S P1P1 P2P2 P3P3 {P 1,P 2,P 3 } not a partition – P 2  P 3  

7 EE1J2 - Slide 7 Partitions & Equivalence Relations (1) Let ~ be an equivalence relation on A For a  A, let P a be the set of elements of A which are equivalent to a I.e. P a = {b  A: b~a} P = {P a :a  A} is a partition of A

8 EE1J2 - Slide 8 Partitions & Equivalence Relations (2) Let P={P  } be a partition of A Define an equivalence relation ~ on A by a~b if and only if both a and b belong to P  for some  ~ is an equivalence relation on A

9 EE1J2 - Slide 9 Partitions & Equivalence Relations (3) So, for a set A there is a one-to-one correspondence between: Equivalence relations on A Partitions of A

10 EE1J2 - Slide 10 Relations - More Terminology Let A be a set, R a relation on A The domain of R, dom(A), is the set: dom ( A )={ a :  b((a,b)  R )} The range of R, range(A), is the set: range (A)={ b:  a((a,b)  R )} If R is a relation on A then the inverse relation R -1 is given by R -1 ={( b,a ): ( a,b )  R }

11 EE1J2 - Slide 11 Example Let S be the set of all people in the world Define a relation R on S by: If x,y  S, then (x,y)  R if and only if x and y are siblings The domain of R is the set of all people who have brothers or sisters The range of R is the same as its domain

12 EE1J2 - Slide 12 Example 2 Let S be the set of all people in the world Define a relation R on S by: If x,y  S, then (x,y)  R if and only if x is y’s younger sibling The domain of R is the set of all people who have an older brother or sister The range of R is the set of all people who have a younger brother or sister

13 EE1J2 - Slide 13 Example 3 S = {1,4,7,9} Define a relation R on S by: If x,y  S, then (x,y)  R if and only if x < y The domain of R is {1,4,7} The range of R is {4,7,9} Is R an equivalence relation?

14 EE1J2 - Slide 14 Functions You probably have pre-conceived ideas of what a function is – f(x)=x 2 +2x+2, f(x)=sin(x), f(x)=exp(x),… These are all functions which associate a member x of ℝ unambiguously with another member f(x) of ℝ They can all be written in set-theoretic notation as f = {(x,f(x)): x  ℝ }

15 EE1J2 - Slide 15 Function – more examples Some functions require more care. f(x)=log(x) only defined for x > 0 f = {(x, f(x)): x  ℝ, x>0 }

16 EE1J2 - Slide 16 Examples continued f(x)=1/x Not defined when x = 1 f = {(x, f(x)): x  ℝ, x  0}

17 EE1J2 - Slide 17 Functions Also, x and f(x) need not be members of the same set. For example consider the function (positive square root) If x>0, then f is a real-valued function Otherwise f is a complex-valued function

18 EE1J2 - Slide 18 Functions A function f from a set A to a set B is a subset of P(A  B) such that if (a 1,b 1 )  f and (a 2,b 2 )  f then a 1  a 2 This ensures that f is well-defined. As before dom(f)={a:  b((a,b)  f)} range(A)={b:  a((a,b)  R)} If a  dom(f), then there is a unique b  range(f) such that (a,b)  f In this case we normally write f(a)=b

19 EE1J2 - Slide 19 Functions If f is a function from A to B and A=dom(f) then we write: f : A  B

20 EE1J2 - Slide 20 Functions In formal mathematics it is important to take care with this notation –in particular to be sure about the domain and range in the definition of a function: f: ℝ  ℝ, is not well-defined f:[0,  )  ℝ, (positive root) is a well- defined function f: ℝ  ℂ, is a well-defined function, and is different from either of the previous functions

21 EE1J2 - Slide 21 Special Types of Function Let f:A  B be a function f is called a surjection (or f is onto) if  b(b  B)  a((a  A)  (f(a)=b)) f is called an injection (or f is 1-1 “one-to- one”) if (f(a 1 )=b)(f(a 2 )=b)  a 1 =a 2 f is a bijection if and only if f is 1-1 and onto (f is a surjection and an injection)

22 EE1J2 - Slide 22 Special Types of Function f not 1-1 or onto f onto but not 1-1 f 1-1 and onto - bijection f 1-1 but not onto A B

23 EE1J2 - Slide 23 Isomorphism If f:A  B is a bijection, then A and B are basically the same set Mathematicians say that A and B are isomorphic f 1-1 and onto - bijection

24 EE1J2 - Slide 24 Examples Let A = {0,1,2,3} and B = {a,b,c,d} The function f :A  B defined by {(0,a),(1,b),(2,c),(3,d)} is a bijection The sets A and B are isomorphic. B is just a ‘re-labelled’ version of A

25 EE1J2 - Slide 25 More examples Well defined? Injection? Surjection? Bijection? f : ℝ  ℝ, f(x) = cos(x) f : ℝ  [-1,1], f(x) = sin(x) f : [- ,  ]  [-1,1], f(x) = sin(x) f : ℝ  ℝ, f(x) = log(x) f : ℝ  ℝ, f(x) = 1/x if x  0, f(0) = 0. f : ℕ  ℤ, f(n) = n/2 if n is even, f(n)=-(n+1)/2 if n is odd

26 EE1J2 - Slide 26 The Image of a Subset A and B sets, f:A  B be a function. Suppose X  A (X is a subset of A) Then f(X) is the subset of B defined by f(X)={b:f(x)=b for some x  X}, called the image of X under f A B X f(X) f

27 EE1J2 - Slide 27 The Inverse-Image of a Subset A and B sets, f:A  B a function. Suppose Y  B (Y is a subset of B) Then f -1 (Y) is the subset of A defined by f -1 (Y)={a:f(a)=y for some y  Y} Called the inverse-image of Y under f A B X=f -1 (Y) f(X)=Y f -1

28 EE1J2 - Slide 28 Inverse Functions A, B sets, f:A  B a function f = {(a,b): b=f(a), a  A} Is f –1 ={(b,a): b=f(a), a  A}a function? In order for f –1 to be a function, if (b,a)  f –1 and (b,c)  f –1 then a=c i.e. if (a,b)  f and (c,b)  f then a=c i.e f must be 1-1

29 EE1J2 - Slide 29 Inverse Functions In other words, if f:A  B, then the inverse function f –1 :f(A)  A exists if and only if f is 1-1 If f(A)=B, and f is 1-1, then f –1 :B  A exists In other words, f –1 :B  A exists if and only if f is a bijection In this case, f –1 is also a bijection, and A and B are isomorphic

30 EE1J2 - Slide 30 Cardinality Revisited Recall that for a finite set A={a 1,…,a n }, the cardinality of A is simply the number of members which A has. In this case |A|=n For infinite sets the notion of cardinality is more complex. But, if two infinite sets A and B are isomorphic, then surely |A|=|B|

31 EE1J2 - Slide 31 Summary of Lecture 8 Relations on sets Equivalence relations and partitions Introduction to functions Injections (or 1-1 functions) Surjections (or ‘onto’ functions) Bijections Cardinality revisited


Download ppt "EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function."

Similar presentations


Ads by Google