FUNCTIONS & Relations

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

Cartesian Product

The Cartesian product A×B between two sets A and B


is the set of all possible ordered pairs with
element from A and element from B:
A×B={(x,y)|x∈A and y∈B}.
Formula to find the possible Cartesian Product
Suppose A=m, B=n, so the formula will be (m x n)
Cartesian product is basically A x B. Multiply A set
element with set B elements
Relation or Binary Relation
Let A and B be two sets. A relation from A to B is a subset
of the Cartesian Product AxB.
Relation can be only one subset from the AxB or multiple
subsets from the Cartesian product subset (pairs).
The formula to find for the possible relations Is:
 2m x n where m is the total number of element of set A and n is the
total number of elements of set B.
Any subset from the Cartesian product is called relation it could be a single pair or multiple For
Example:

R={(a1,b2)} or R={(a1,a2),(b1,b2),……..(an,bn)}

Domain of a Relation
The set containing the first elements of all ordered
pairs in the given binary relation is called the domain
of a relation.
Denoted by Dom (R).
R={(a,2),(b,1),(c,4)} so, the domain of the R is
Dom(R)={(a,b,c)}
Range of the Relation
The set containing the second elements of all ordered
pairs in the given binary relation is called the range of
a relation.
Denoted by Ran (R)
R={(a,2),(b,1),(c,4)} So, the Range of R is:
Ran (R)= {(2,1,4)}.
Example
Let A={2,3,4} and B={3,4,5}. List the element of each
relation R defined below and the domain and the
range.
i) a∈A is related to b∈B, that is aRb if and only if a<b
For range and domain, we need to solve Cartesian
Product first AxB.
Find the Range and Domain in which a<b.
Types of Relations
Inverse
Identity
Universal
Void
Inverse
Let R be any relation from set A to set B. The inverse of
R, denoted by R-1 is the relation from B to A which
consist of these ordered pairs which, when reversed
belong to R,
R-1 = {(a,b) : (b,a) ∈R}
Let A = {2,3,5} and B={6,8,10} and define a binary
relation R from A to B as follows.
For all (A,B) ∈AxB, (A,B) ∈R A/B (A divides by B)
Write Each R and R-1 as a set of ordered Pairs
Inverse Continue…
First find the Cartesian Product
R (ordered pairs which are divisible of x/y)
R-1 (Inverse the order pair of R )
Identity
A relation R in a set A is said to be identity relation,
Generally denoted by IA If every element is related to
itself only. Every element must multiply with itself, it
is called Identity Relation. In identity relation we have
only one set.
Eg: A={1,2,3}
IA = R1= {(1,1), (3,2) , (3,3)}
R2= {(1,1), (3,2) , (2,3)}- N
Which of the above is Identity Relation ?
Universal Relation
Universal relation is a relation on set A when A X A ⊆
A X A. In other words, universal-relation is the relation
if each element of set A is related to every element of
A. universal relation ordered pair (Subsets) are in
maximum numbers.
If R= AxA than it is called universal Relation.
Eg: Relation on the set A={1,2,3} by R ={(a,b) : |a-b|>=0}
Void Relation
A relation R in a set A is said to be a void relation if R
is a null set and it is also called empty relation. Void
relation is the opposite of universal relation.
 i.e if R= Ø
Eg: the relation R on the set A={1,2,3} by R =
{(a,b):a+b=10}
If we add (a,b) it ,ust be equal to 10.
Properties of Relation
Reflexive Property
Irreflexive Property
Symmetric Property
Asymmetric Property
Transitive Property
Anti Symmetric Property
Reflexive Property
In reflexive property we have only one set A binary relation
R on set A is reflexive if aRa for every a ∈ A that is: if (a,a) ∈
R∀a∈A
∀ is the sign of universal quantifier or “For all”
(1,1) (1,2) (1,3)
For example:
(2,1) (2,2) (2,3)
Let A={1,2,3} (3,1) (3,2) (3,3)
Make a Cartesian product with AxA
R={(1,1), (1,2), (1,3), (2,2), (2,3), (3,3)} This relation is reflexive
because it is fulfilling the statement (a,a) ∈ R ∀ a ∈ A
R2= {(1,1), (1,2), (1,3), (2,2), (2,3)} Not reflexive because not
fulfilling the (a,a) ∈ R ∀ a ∈ A
Irreflexive Property
A binary relation R on set A is irreflexive if aRa for
every a∈A that is: if (a,a) ∈ R ∀ a ∈ A.
Irreflexive is the opposite of reflexive property.
For example
R= {(1,2), (1,3), (2,1), (2,3)}
Question
Let A=Z;
aRb iff a<=b+1 (Take those subset in which 1 is added
to the value of B and the answer is less than A)
(1,1), (1,2),(2,2)……
Symmetric Property
A relation R is symmetric on a set A if whenever aRb
then bRa.
Example:
If (a,b) ∈ R then (b,a) ∈ R ∀ (a,b) ∈ A
A={1,2,3,4}
R1={(2,4), (4,2)}
R2={(1,1), (1,2), (2,1), (1,3), (3,1)}
R3={(1,1), (1,2), (2,1), (1,3), (3,1), (4,1)} not Sym.
R= {(O)} ? Yes Sym
R=AxA ( with table ) is sym
Asymmetric Property
A relation R is said to be asymmetric if aRb and bRa
then a=b ∀ (a,b) ∈ A
i.e if (a,b) ∈ R then (b,a) ∈ R ∀ (a,b) ∈ A
Means no inverse and equal subset will be allowed in
asymmetric
Antisymmetric Property
A relation R is antisymmetric on a set A if when ever
aRb and bRa then a=b
If (a,b) ∈ R then (b,a) ∈ R then A=B ∀ (a,b) ∈ A
Means only inverse is not allowed to be in subset.
A={1,2,3,4}
R={(2,2), (2,3), (2,4), (3,2), (3,3), (3,4)} No
R1={(2,4), (4,2)} No
R2={(1,1), (1,2), (2,1), (1,3), (3,1)}No
R3={ (1,2), (2,3), (1,3), (3,4), (4,1)} Yes
R4={ (1,1), (2,2),(3,3), (4,4)}
Transitive Property
A relation R on a set A is said to be transitive if (aRb) and (bRc) then
(aRc) ∀ (a,b,c) ∈ A
if (a,b) ∈ R and (b,c) ∈ R then (a,c) ∈ R
So, if a,b and b,c ∈ R then a,c must be in relation as well otherwise it is
not transitive.
And if a,b is not available in R than we don’t need to check further
condition it is transitive property.
Example:
A={1,2,3}
R1={(1,1), (2,2)}
R2={(1,2), (2,3), (1,3)} a,b ( means next value must start from B value

b,c (
means next value must start from C value

R3={ }
FUNCTIONS
What is a function ?
A function is a rule that assigns each input exactly one
output. We call the output the image of the input. The set
of all inputs for a function is called the domain. The set of
all allowable outputs is called the codomain
We would write f : X → Y to describe a function with
name f, domain X and codomain Y.
Functions are sometimes also called mappings or
transformations
A relation ‘f’ from set A to a set B is called function
f:A B, if each element a ∈ A, we can assign unique
element of B
Function
How many Functions are possible?
Let suppose A=(1,2,3,4), B=(a,b,c)
We denote A with x and B with y.
Number of choices for each element of A to map with B
is 3.
We can write 3x3x3x3 for set A. which is 34.
We will write for y the number of mapping available in x.
YxYxYxY
Formula will be yx
This is the possible functions formula.
Function
How many relations which are not functions?
The formula to find the relation is 2xy
And the formula of functions is set A elements x set B
elements mapping.
We will take the example of previous slide
2xy - yx
2xy - 34 = Relations not Functions.
Example
Suppose that each student in a discrete mathematics
class is assigned a letter grade from the set {A, B, C, D,
F}. And suppose that the grades are A for Adams, C for
Chou, B for John, A for Rodriguez, and F for Stevens.
Properties of Functions
One to one function (Injective)
Onto function (Surjective )
Bijective
One to one function (Injective)
 A function f: A → B is One to One if for each element of A there is a
distinct element of B. It is also known as Injective. Consider if a1 ∈ A
and a2 ∈ B, f is defined as f: A → B such that f (a1) = f (a2). In one-one
set A must map all elements with set B. But it is not necessary that set
B all element must be mapped with Set A.
 No two elements in ‘A’ are mapped to same element of ‘B’.
One to one
 How many one-to-one functions are possible
 We have two sets ‘A’ and ‘B’
 Let's say we have ‘x’ number of elements in A and ‘y’ number of elements in B.
 Formula will be X occupy/image with Y and the remaining choices will be for
the elements of X.
 Let suppose A=(1,2,3), B=(a,b,c)
 Now we have three choices mapping with 1 from set B, 2 have two choices and 3
have one choice.
 Formula will be:
{Y (y-1), (y-2), (y-3)……..y-(x-1)}
Where the first Y is the first element of set A.
We can write ypx which is called permutation.
A permutation is an arrangement of all or part of a set of objects, with regard to
the order of the arrangement
Onto function (Surjective)
 If there exists a function for which every element of set B there is (are)
pre-image(s) in set A, it is Onto Function. Onto is also referred as
Surjective Function.
 A function f from set A to set B is onto if each element of B is mapped
to at least one element of set A.
 In onto we will focus on set B all elements of B must be mapped with A
 Means both A and B must be mapped completely.(keep function in
mind)
 Range of f=B
 Formula will be :
n(n-1)(n-2)(n-3)
N factorial
Where n is the element of set B
Bijective
A function, f is One to One and Onto or Bijective if
the function f is both One to One and Onto function.
In other words, the function f associates each element
of A with a distinct element of B and every element of
B has a pre-image in A.
Notice that for a function to be a bijection, the domain
and codomain must have the same cardinality.
Short Quiz
Choose the Correct one.
one to one ?
Onto ?
Bijection ?
Not a function?

You might also like