Discrete Mathematics - Functions
Discrete Mathematics - Functions
Menu Login
Home
Coding
HTML CSSGround
Javascript SQL Python Java C C++ PHP Scala C#
Jobs
Discrete Mathematics - Functions
Whiteboard
Tools
Function - Definition
A function or mapping (Defined as f : X → Y ) is a relationship from elements
of one set X to elements of another set Y (X and Y are non-empty sets). X is
called Domain and Y is called Codomain of function ‘f’.
Function ‘f’ is a relation on X and Y such that for each x ∈ X, there exists a
unique y ∈ Y such that (x, y) ∈ R. ‘x’ is called pre-image and ‘y’ is called
image of function f.
A function can be one to one or many to one but not one to many.
https://www.tutorialspoint.com/discrete_mathematics/discrete_mathematics_functions.htm 1/5
9/15/23, 4:57 PM Discrete Mathematics - Functions
Example
f : N → N , f (x) = 5x is injective.
f : N → N , f (x) = x
2
is injective.
f : R → R, f (x) = x
2
is not injective as (−x)2 = x
2
Example
f : N → N , f (x) = x + 2 is surjective.
f : R → R, f (x) = x
2
is not surjective since we cannot find a real
number whose square is negative.
Problem
Hence, f is injective.
Here, 2x– 3 = y
https://www.tutorialspoint.com/discrete_mathematics/discrete_mathematics_functions.htm 2/5
9/15/23, 4:57 PM Discrete Mathematics - Functions
Hence, f is surjective.
Inverse of a Function
The inverse of a one-to-one corresponding function f : A → B, is the function
g : B → A, holding the following property −
f (x) = y ⇔ g(y) = x
Example
A Function f : Z → Z , f (x) = x
2
is not invertiable since this is not one-
to-one as (−x)2 = x
2
.
Composition of Functions
Two functions f : A → B and g : B → C can be composed to give a
composition gof . This is a function from A to C defined by (gof )(x) = g(f (x))
Example
Solution
https://www.tutorialspoint.com/discrete_mathematics/discrete_mathematics_functions.htm 3/5
9/15/23, 4:57 PM Discrete Mathematics - Functions
Get Started
Advertisements
https://www.tutorialspoint.com/discrete_mathematics/discrete_mathematics_functions.htm 4/5
9/15/23, 4:57 PM Discrete Mathematics - Functions
Affiliates eBooks
Contact Us
Tutorials Point India Private Limited, Incor9
Building, Kavuri Hills, Madhapur,
Hyderabad, Telangana - 500081, INDIA
https://www.tutorialspoint.com/discrete_mathematics/discrete_mathematics_functions.htm 5/5