Chapter 2 Sets, Relations Functions
Chapter 2 Sets, Relations Functions
A set is a collection of object, which are called elements or members of the set.
For example, the set A of all vowels in the English alphabet.
C x Z
x is odd and x 10
Set A is the set of natural A = {1, 2, 3, 4, 5} B x x N and x 6
number less than 6 or B x x N and x 5
download@ 1|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
a) Null Set
A set which contains no elements at all.
Also known as Empty set { }
It is denoted by the symbol .
Example :
A set of even number greater than 8 and less than 10.
b) Sub Set
• All the elements of a set A are also elements of a set B
• We write A B
• Example:
Given set A = {1, 3, 4} and B = {1, 2, 3, 4, 5}
Conclusion : A B because all elements in A contain in the set B.
c) Proper Subset
• At least one element of B does not belong to A
• We write A B
• Example:
Given set A = {1, 5}, B = {1, 5, 6}, C = {1, 6, 5}
– A and B are subsets of C
– A is a proper subset of C
d) Equal Set
• Set A and Set B have exactly the same elements
• We write A= B
• Example:
The set A = {1, 3, 4}, B = {4, 3, 1}
Conclusion : Set A and B have the same elements.
e) Power Set
The set of all subsets of a set X is called the power set of X, denoted by P(X).
If a set has n elements, then its power set has 2n elements.
Example: If X = {a, b, c}, then P(X) = { , {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a, b, c}}
download@ 2|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
Solution:
A x B = {(1, a), (2, a), (3,a),(1, b), (2, b),(3,b)}
QUICK EXERCISE 1
4. Given that A = {2,4,6}, B = {2, 6}, C = {4,6}, and D = {4,6,8}. Determine which of
these set subset of which other of sets are.
download@ 3|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
Intersection
Symbol : A ∩ B
Set operation: The intersection of set A and B U
The set of elements : Belong to A and B
A ∩ B = *x : x ϵ A ∩ x ϵ B }
Example:
Given set A = {1, 3, 5} and B = {1, 2, 3}
A B
Hence,
A ∩ B = *1, 3, 5+ ∩ *1, 2, 3+
= {1, 3}
Union
Symbol: A U B
Set Operation: The union of sets A and B U
The set of elements : Belong to A or B or
both.
A U B = {x : x ϵ A U x ϵ B }
Example:
Given set A = {1, 3, 5} and B = {1, 2, 3} A B
Hence,
A U B = {1, 3, 5} U {1, 2, 3}
= {1, 2, 3, 5}
Difference
Symbol: A - B
U
Set Operation: The difference of sets A and
B
The set of elements : Belong to A but not to
B
download@ 4|Page
http://math2ever.blogspot.com A B
Discrete Mathematics BA202
A - B = {x : x ϵ A ∩ x ϵ B }
Example:
Given set A = {1, 3, 5} and B = {1, 2, 3}
Hence, A – B = {1, 3, 5} - {1, 2, 3} = {5}.
Complement U
Symbol: A’
Set Operation: The complement of sets A
The set of elements do not belong to A
A’ = *x: x ϵ A }
A
Example:
If U = {j, m, s, k, p, s, m, z, a} and A = {j, t, m, k} A’
Hence, A’ = *p, s, z, a}
Symmetrical difference ,
Symbol: A B
Set Operation: The symmetrical difference
of sets A and B U
The set of elements that belong to A or B but
not both A and B
A B = (A – B) U ( B – A)
Example:
If A = {1, 2, 3}; B = {3, 4, 5} A B
Hence,
A – B = {1, 2} and B – A = {4, 5} A B
A B = (A – B) U ( B – A)
= {1, 2} U {4, 5}
= {1, 2, 4, 5}
download@ 5|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
QUICK EXERCISE 2
U a , b , c , d , e , f , g
A a , b , e , g
B a , c , d , e
C b , e , f
Find:
a) A B A C .
b) A B C '
P x : x is a prime number
Q x : x is a factor of 10
R x : x is an integer & 1 x 5
download@ 6|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
P x : x is a prime number
Q x : x is a multiple of 3
R x : x is an integer & x 26
De Morgan’s Law
1. A B A B
2. A B A B
Visual DeMorgan:
A B
A B
A B
= A B
download@ 7|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
x R y x, y R
For example,
0 R 1 sin ce 0 1,
0 R 2 sin ce 0 2,
0 R 3 sin ce 0 3,
1R 2 sin ce 1 2,
1R 3 sin ce 1 3, and
2 R 3 sin ce 2 3,
x R y 0 , 1 , 0 , 2 , 0 , 3 , 1 , 2 , 1 , 3 , 2 , 3
A B x , y x A and y B .
Reflexive
x y
Example 1 :
Consider the following relations on the set A = {1, 2, 3, 4}. Determine whether the
relation is reflexive or not?
a) R₁ = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}
b) R₂ = *(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)+
Solution:
download@ 9|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202
a) R₁ = *(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)+
2
1
4 3
b) R₂ = *(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)+
1 2
4 3
Symmetric
Whenever (x , y) ϵ R then (y , x) ϵ R.
x y
Solution:
download@ 10 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
Transitive
A relation R on a set A is transitive if whenever x R y and y R z then x R z, that is,
Whenever (x, y) ϵ R and (y, z) ϵ R then (x, z) ϵ R.
y
z
x
QUICK EXERCISE 3
2) List the ordered pair in the relation R from A = ( 0,1,2,3,4) to B = ( 0,1,2,3) where
(a,b) R if and only if;
a) a=b
b) a+b=3
download@ 11 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
5) For the following questions, refer to the directed graph belowfor the relation R.
c
b
a) List the ordered pairs in the relation R represented by the directed graph
above.
b) Determine whether the relation R is an equivalence relation on the set {a, b ,c}.
Explain your answer.
Eg: Compare the two relations below. Which of the following relations are functions?
Relation 1 Relation 2
0 1 1
1 2 0 2
2 4 1 4
x y x y
Function Not Function
download@ 12 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
Relation 1 – Function.
– Has ONLY ONE y value for each x value.
Example 1:
Determine whether each below relation from X = {1, 2, 3, 4} to Y = { a, b, c, d} is a
function or not. If it is the function, gift its range.
a) f = {(1,a), (2,b), (3,a), (4,c)}
The diagram shows the relation that maps the elements of set P to the elements of
set Q.
P Q
domain
codomain
0 1
object 1 2 image
2 4
5
Set P is called the domain of the relation. Each element in the domain is called
an object.
Set Q is called the codomain of the relation. Each element in the codomain
that has been mapped is an image.
The subset of the codomain that contains all the images that have been
mapped is called the range.
download@ 13 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
A one to one function is a function in which every element in the range of the
function corresponds with one and only one element in the domain.
Each element in B can only have at most 1 arrow pointing to it. (no clashes
occur)
1 a 1 A
2 b 2
3 c 3 B
d C
1 a a 1
2 b b 2
3 c c 3
4 d 4
Example 1:
Function f = {(1,a),(2,c),(3,b), (4,c)} from X = { 1,2,3,4} to Y = {a,b,c}, is onto, but
not one-to-one.
.1
.a
.2
.b
.3
download@ .c 14 | P a g e
.4 http://math2ever.blogspot.com
X Y
Discrete Mathematics BA202
Example 2:
Example 3:
• a
1•
• b
2•
• c
3•
• d
c) Composition functions
A composition of functions occurs when you insert one function into another.
The range of the one function becomes the domain of the second.
The notation for composition of functions is either:
download@ 15 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
QUICK EXERCISE 4
1) The functions f and g are defined as f(x) = 2x – 3 and g(x) = x2 + 2. Find the
composite function
a) fg(x)
b) gf (x)
c) ff (x)
3) Given that f(x) = 2x + 1 and g(x) = x2, find gf (2) and fg(-2).
d) Inverse functions
The inverse of the function is when the domain and the range trade places.
All elements of the domain become the range, and all elements of the range become
a domain.
download@ 16 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
0 3 3 0
1 4 4 1
2 5 5 2
If f denotes a function that maps set A to set B and the process is reversed, then the
inverse mapping can be represented by the symbol f-1.
Hence,
If f(x) = y, then f -1(y) = x.
1) Change f(x) to y;
y 2x 4
2) Solve for x;
y 2x 4
y 4 2x
y 4
x
2
3) Change to inverse notation
Know that f -1(y) = x, then;
x 4
f
1
x
2
1
x 2
2
QUICK EXERCISE 5
4
3) The function h is defined as h(x) ,x 5 . Find:
x 5
a) h
1
(x)
1
b) h (8 )
download@ 17 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
a) Ceiling function
b) Floor function.
x Ceiling, x Floor, x
1 .5 1 .5 1 1 .5 2
1 1 1 1 1
1 .3 1 . 3 1 1 .3 2
download@ 18 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
0 .5 0 . 5 0 0 .5 1
0 0 0 0 0
0.3 0 . 3 1 0 . 3 0
0.5 0 . 5 1 0 . 5 0
1 1 1 1 1
1.5 1 . 5 2 1 . 5 1
2.71 2 . 71 3 2 . 71 2
Solution:
Floor of, 2 . 31 is 2 - The greatest integer that is less than (or equal) to 2.31 is 2.
The Ceiling of, 2 . 31 is 3 – The smallest integer that is greater than (or equal) to 2.31 is 3.
There is no change for the floor or ceiling of a number that is already an integer.
Example 2: What is the floor and ceiling of 5?
- The Floor of 5 is 5
- The Ceiling of 5 is 5
QUICK EXERCISE 6
download@ 19 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202
1 3
h)
2 2
1 5
i)
f) 3 2 2
g) 3 . 3 0 . 5
2) Solve for the following function;
a) 0 . 5 1 . 3 1 . 3
b) 2.5 1 3 . 2
c) 0 . 5 2 . 5 1 . 5
download@ 20 | P a g e
http://math2ever.blogspot.com