Sei sulla pagina 1di 20

Discrete Mathematics BA202

2.0 SETS, RELATIONS AND FUNCTIONS

2.1 UNDERSTAND SETS AND SET OPERATIONS

2.1.1 Describe set notation and operation on sets

 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.

 Notation used to describe membership;

 Three methods are commonly used to describe a set:

Description Roster Form Set-Builder Notation

The set V of all vowels in V = {a, e, i, o, u} V = {x: x is a vowel in the


the English alphabet. English alphabets}
The set C of odd positive C = {1, 3, 5, 7, 9} C = {x : x is an odd positive
integers less than 10 integer less than 10}

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 

Note : N = { 0,1,2,3,..... } is a natural number


Z = {...., -2, -1, 0,1,2,.... } is an integer
Z+ = {1,2,3,,.... } is the set of positive integer
R = {x : x is a real number}

download@ 1|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202

 STANDARDS NOTATION IN SETS

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

f) Cartesian product of X and Y

 The Cartesian product of X and Y is denoted by X x Y , is the set of all ordered


pairs (x, y) where x  X and y Y .
 Hence, X x Y = { (x, y) |x X  y Y }.
 Example
What is the Cartesian product of A = {1, 2, 3} and B = {a, b}

Solution:
A x B = {(1, a), (2, a), (3,a),(1, b), (2, b),(3,b)}

• Note that since (x, y) is an ordered pair, then X x Y  YxX.

QUICK EXERCISE 1

1. U = {natural numbers}; A = {2, 4, 6, 8, 10}; B = {1, 3, 6, 7, 8}. State whether


each of the following is true or false:
a. A ϵ U b. 10 ϵ B c. 3 ϵ B

2. Express each of the following set in set builder form


a. A = {1, 2, 3, 4, 5}
b. B is the set of months that contain less than 30 days.

3. Express each of the following set to roster form


a. Set A is the positive integer less than 12
b. Set B is the prime number less than 10
c. Set C is multiple of 20
d. D = {x : x is square of an integer and x less than 100}

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

2.1.2 Apply Venn Diagram to represent set operations

 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

1) If A = (1,2,3,4,6,7), B = ( 2,4,6,9) and C = ( 1,3,7), find :


a) A  B
b) A  B
c) Relation between A and C.

2) Given the sets U = {a,b,c,d,e,f,g,h}, R = {a,b,c,d,e,f,}, S = {c,d,e, } and T ={f,g,h}.

a) Construct a Venn Diagram illustrating the sets.


b) Relation between set R and set S.
c) Give the element for S  T

3) Given the following sets:

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 '

4) Given the universal set,    x : x is an integer & 1  x  10  .

P   x : x is a prime number 
Q   x : x is a factor of 10 
R   x : x is an integer & 1  x  5

a) List the element of set P, Q and R


b) Find  P 
/
 Q  R

download@ 6|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202

5) Given the universal set, U  x : x is an integer & 20  x  35  .

P   x : x is a prime number 
Q   x : x is a multiple of 3 
R   x : x is an integer & x  26 

a) List the element of set P, Q and R


b) Find  P  Q   R /

2.1.3 Create set properties followed D’Morgan’s Law

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

2.2 UNDERSTAND RELATIONS

2.2.1 Definition of relations

Let A and B be sets. A (binary) relation R from A to B is a subset of A B .


Given an ordered pair  x , y  in A B , x is related to y by R , written x R y , if and only if
 x , y  is in R .
 The notation for relation may be written symbolically as follows:

x R y  x, y   R

 For example,

Given set A  0 ,1 , 2  and B  1 , 2 , 3  .

- Element x in A is related to an element y in B if, and only if, x is less


than y.
- Let us use the notation x R y as shorthand for the sentence “ x is
related to y.”
- Then:

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  

 Recall that the Cartesian product of A and B where A B , consists of all


ordered pairs whose first element is in A and whose second element is in B:
download@ 8|Page
http://math2ever.blogspot.com
Discrete Mathematics BA202

A B   x , y  x  A and y  B  .

2.2.2 Properties Relation

1) R is reflexive  for all x in A, x, x   R.

2) R is symmetric  for all x and y in A , if x, y   R then y, x R

3) R is transitive  for all x , y , and z in A , if x, y   R and y, z  R then x, z   R.

 Reflexive

 A relation R on a set A is reflexive if (x , x) ϵ R for every x ϵ A.


 In a reflexive relation, every element on a set A is related to itself (the arrow
pointed to itself)
 Have a loop at every vertex.

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)+

Draw directed graph;

2
1

4 3

Hence, R₁ is not reflexive because not all (x , x) ϵ R for every x ϵ A.

b) R₂ = *(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)+

1 2

4 3

Hence, R2 is reflexive because for all (x , x) ϵ R for every x ϵ A.

 Symmetric

 A relation R on a set A is symmetric if whenever x R y, that is,

 Whenever (x , y) ϵ R then (y , x) ϵ R.

 In a symmetric relation, for each arrow we have also an opposite arrow.

x y

 Example 2: Determine which of the relations in Example 1 are symmetric.

Solution:

a) Hence, R₁ is not symmetric because not all (x , y) ϵ R then (y , x) ϵ R.


b) Hence, R2 is not symmetric because not all (x , y) ϵ R then (y , x) ϵ R.

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

 Example 3: Determine which of the relations in Example 1 are transitive.

- Hence, R₁ is transitive because for all (x , y) ϵ R and(y, z) ϵ R, then (x, z) ϵ R.


- Hence, R2 is not transitive because not all (x , y) ϵ R and(y, z) ϵ R, then (x, z) ϵ R.

QUICK EXERCISE 3

1) Let A  1 , 2  and B  1 , 2 , 3  and define a binary relation R from A to B as follows:


Given any  x , y   A  B, x, y   R  x  y is even.
a) State explicitly which ordered pairs are in A  B and which are in R .

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

3) Consider the following relation on A = {1, 2, 3, 4} which is

R  1,1 , 1, 2 , 1, 3 , 1, 4 ,  2 ,1 ,  2 , 2 , 3 ,1 , 3 , 3 ,  4 ,1 ,  4 , 4 

a) Draw the directed graph for the relation R.


b) Determine whether the relation R is reflexive, symmetric or transitive. Explain
your answers.

4) Let M= {0, 1, 2, 3} and define relation R=  0 ,1 ,  0 , 3 , 1 , 0 , 1 ,1  2 , 3 ,  3 , 0 ,  3 , 3 ,  3 , 2 

a) Represent the relation R using directed graph


b) Determine whether the relation R is reflexive, symmetric or transitive. Explain
your answers.

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.

2.3 EXPLAIN FUNCTIONS

2.3.1 Basic constructions

 A function is a relationship between two sets of numbers. A function maps a number


in one set to a number in another set.
 Like a relation, a function has a domain and range made up of the x and y values
of ordered pairs. such as { (0,1) , (5, 22), (11,9) }.
 Properties of function:
a) Each x value in a function has one and only ONE y value.

 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.

 Relation 2 – Not Function.


– Has TWO distinct y values '2' and '4' for the same x value of '1'.

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)}

Ans: f is a function from X to Y because each element of X map to Y. Range of f = { a, b, c }

b) f = {(1,a), (2,b), (3,a)}

Ans: f is a not function from X to Y because the element 4 of X not function to Y.

 Domain, Codomain & Range

 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

2.3.2 Types of function

a) One-to-one functions (injective)

 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)

 Example of a one-to-one function: {(0,1), (5,2),(6,4)}

Domain: 0,5,6 Range: 1,2,4


Each element in the domain (0,5 and 6) correspond with a unique element in
the range.

 No clashes (1-to-1)  A clash occurred (not 1-to-1)


A B A B

1 a 1 A
2 b 2
3 c 3 B
d C

b) Onto functions (surjective)

 Each element in B must have at least 1 arrow pointing to it.

 Onto  Not onto


A B A B

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:

Function f = {(1,a),(2,c),(3,b)} from X = { 1,2,3} to Y = {a,b,c} is one-to-one and onto


Y.

Example 3:

Function f = {(1,b),(3,a),(2,c)} from X = { 1,2,3} to Y = {a,b,c,d}, is not onto.

• 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:

The composition of function notation on the left is the


f(g(x))
composition. f(g(x)) = f  g(x)
f  g(x)
However it should be noted that f(g(x)) ≠ g(f(x))

Composition of two functions

download@ 15 | P a g e
http://math2ever.blogspot.com
Discrete Mathematics BA202

Composition of two functions

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)

2) Given f x   x  3 and g  x   5 x  10 . Find


a) f  g  x  if x =2
b) g f  x  if x =3
c) g
1
1 

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

If ƒ maps X to Y, then ƒ–1 maps Y back to X.

 Example of the inverse of a simple function:


Original function f(x) Inverse of function or f-1(x)

{ (0,3 ) , (1,4) , (2, 5) } { (3, 0 ) , (4,1) , (5, 2) }

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.

 Example: Find the inverse function for f x   2 x  4

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

1) Given that f(x) = 2x + 1 , find f -1(3).


2) Given that g(x) = 5 – 3x , find g -1(2).

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

2.3.3 Graph of function

 Two important functions in discrete mathematics are:


 Ceililng and floor function - Give you the nearest integer up or down.

a) Ceiling function

 Round x up to the smallest integer that is greater than or equal to x


 Graph of Ceiling function

b) Floor function.

 Round x down to the greatest integer that is less than or equal to x


 Graph of Floor function

 Example of values in ceiling 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

Example 1: What is the floor and ceiling of 2.31?

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.

 Floor and Ceiling of Integers

 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

1) Find these values;


3
d)
a) 1 . 1   
4
b)   0 . 1   7
e) 


c)  2 . 99   8

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

Potrebbero piacerti anche