Relations and Functions
Relations and Functions
AQ010-3-1-MCFC
Introduction
Cartesian Product Set
Relations, Mapping & Function
Properties of Relations
Operations on Functions
Invertible Functions
Ordered pairs
An ordered pair consists of two elements, of
which one is designated as the first element
and the other as the second element.
It is written as (a, b) where a is the first
element and b is the second element.
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Cartesian Product Set
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Example
Let A be the set {1, 2, 3, 4}. Which ordered
pairs are in the relation R = { (a, b)| a divides b }?
Sol :
1 1
2 2
3 3
4 4
R2 ● ●
R3 ● ● ●
R4 ● ●
R5 ●
R6 ● ● ● ●
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Relation
• A relation is a set of ordered pairs.
• The presence of the ordered pair (a,b) in a
relation is interpreted as indicating a relationship
from a to b.
• Domain of R : Dom(R) is the set of all elements
in A that are related to some element in B.
• Range of R : Ran(R) is the set of all elements in
B that are related to some element in A.
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
• The complement of the relation R is defined
as follows:
R = (A B) – R
(x,y) R iff (x,y) (A B) – R
• For example:
Given A = {1,2,3} and B = {a,b}
AB {(1,a),(1,b),(2,a), (2,b),(3,a),(3,b)}
R {(1,a),(1,b),(3,b)}
R’{(2,a), (2,b), (3,a)}
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Relations
1
Inverse Relation of R is denoted as R
Let R is relation from set A to set B, the
inverse of R will be from set B to A.
For example,
Given A = {0, 1, 2} and B = {a, b}.
R = {(0, a), (1, b), (2, b)}
R-1 = {(a, 0), (b, 1), (b, 2)}
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Example
- R is reflexive
If (a,a) R for every element a A.
- R is symmetric
If (b,a) R whenever (a,b) R, for some a,b A.
- R is transitive
If (a,b) R and (b,c) R,
then (a,c) R , for a, b, c A.
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Properties of Relations
- R is irreflexive
If (a,a) R for all a A
x A , xR x
- R is antisymmetric if whenever
(a,b) R and (b,a) R only if a = b for a,b A
(if and only if there are no pairs of distinct
elements a and b with a related to b and b
related to a, the only way to have a related to
b and b related to a is for a and b to be the
same element. )
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Properties of Relations
Are the following relations on {1, 2, 3, 4} reflexive?
R1 = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}
R2 = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)}
R3 = {(1, 3), (3, 2), (2, 1)}
Sol: R2
R1 = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)}
R2 = {(1, 1)}
R3 = {(1, 3), (3, 2), (2, 1)}
R1 = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)}
Sol: R1
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Question
Sol :
R = {(1,1),(2,2)}
Is R antisymmetric?
Yes, if (x,y) R and (y,x) R then x = y2 and y = x2. The only
time this holds true is when x = y (and more specifically when x =
y = 1 or 0).
Is R transitive?
No, (16,4) R and (4,2) R, but (16,2) R.
Solution:
Reflexive = R3 & R5
Symmetric = R2 & R3
Transitive = R4 & R5
Irreflexive = R4
Antisymmetric = R4, R5
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Functions
A function f from a nonempty set A to a nonempty set B
is an assignment of exactly one element of B to each
element of A.
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
From Relation to Function
A relation f from A to B is a function if:
• Every element of A is related to some element
of B
• An element of A cannot be related to more
than one element of B.
A B A B
1 a 1 a
2 b 2 b
3 3
c c
4 4
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Example
Determine whether the following relation is a
function.
A B A B
α 1 α 1
β 2 β
γ 2
γ 3
A Not a function B A B
Not a function
α 1 α 1
2
β 2 β
3
γ γ
4
a function a function
0 0
1
1 2
3
2 4
Set X Set Y
X2 = Y is a function from X to Y.
Domain is {0, 1, 2} and Codomain is {0, 1, 2, 3, 4}.
Difference of functions
(f – g)(x) = f(x) – g(x)
Product of functions
(fg)(x) = f(x) . g(x)
Quotient of functions
(f/g)(x) = f(x)
g(x)
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Example 1
Find:
1) (f + g)(x)
2) (f - g)(x)
3) (fg)(x)
4) (f/g)(x)
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Composition Functions
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Example
Let f: AB and g:BC be defined as given below.
Find
a) g o f (p)
b) g o f (q)
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions ‹#›
Example
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Inverse Functions
Def: Let f be a one-to-one function from the set A to
the set B. The inverse function of f is the function
that assigns to an element b belonging to B the
unique element a in A such that f(a) = b. The
inverse function of f is denoted as f -1.
Hence, f -1(b) = a when f(a) = b.
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Example
Given that f ( x ) 2( x 1) 3
, Find
1
(i) f ( x )
(ii) f 1 (16 )
AQ010‐3‐1 Mathematics Concepts For Computing Relations & Functions
Quick Review Question
Q&A