You are on page 1of 36

Functions

Today’s Meny

•What are functions


•Difference b/w functions and relations
•Types of functions
•Inverse functions
•Function of a functions
Functions 1

Every function is a relation but not all relations are


functions
Functions 2

A relation is a function only if it fulfills 2 conditions:

1. There is a mapping from all elements of domain

2. There is only 1 such mapping


Functions 3

A function f from A to B is an assignment of


exactly one element of B to all elements of A.

f : A → B
f : A → B
• f is a function from A to B,
• f maps A to B.
• A is the domain of f and B is the codomain of f.
• f(a) = b, if b is the unique element of B assigned by the function f to
the element a of A.
•b is the image of a
•a is a preimage of b.
•range of f
•image, of f
•is the set of all images of elements of A.
f : A → B
• f(a) = b,
if b is the unique element of B assigned by the function f to the element a of A.

•b is the image of a

•a is a preimage of b.
f : A → B
•range of f
•image, of f
•is the set of all images of elements of A.
Codomain vs range

•the codomain of a function from A to B is the set of all


possible values of the function (that is, all elements of B),

•the range is the set of all values of f (a) for a ∈ A,

•Range is always a subset of the codomain.


Codomain vs range

The codomain is the set of possible values of the


function and the range is the set of all elements of
the codomain that are achieved as the value of f
for at least one element of the domain.
Example: Students and Grade
Domain
Codomain

Amjad
A

Majid
A-
B+
Sajid
B

Rashid B-
C
Shahid
D
Real Valued Function

Function whose codomain is the set of real


numbers.
Integer Valued Function

Function whose codomain is the set of integers.


Addition of functions

Two real valued or integer valued functions can be


added or multiplied

( f1+f2)(x) = f1(x)+f2(x)

( f1f2 )(x) = f1(x)f2(x)


Types of functions

One-to-one, onto and bijection


One-to-one

f(a) = f (b)  a = b for all a and b


in the domain of f.
One to one

∀a∀b ( f (a) = f (b) → a = b)

∀a∀b(a ≠ b → f (a) ≠ f (b))


Example: Students and Grade
Domain
Codomain

Amjad
A

Majid
A-
B+
Sajid
B

Rashid B-
C
Shahid
D
Example:

• Determine whether the function f (x) = x2 from the set of integers to the set
of integers is one-to-one.
Example:

•Determine whether the function


f (x) = x2 where f:Z+ Z+ is one-to-one.
On to

Functions where range and the codomain are equal.


On to

Every member of the codomain is the image of


some element of the domain.
On to

Also called surjective


Example: one to one and onto
Domain
Codomain
bijective

both one-to-one and onto

Also called one-to-one correspondence


bijective

both injective and surjective

Also called one-to-one correspondence


Function and types: A summary

•Function
•Arrow from all elements of domain
•Exactly one arrow

•Types
•One-to-one : At most one arrow on element of codomain if any
•On-to: Arrow on all elements of codomain
•Bijection: One arrow on all elements of codomain.
Prove type of function
•Suppose that f : A → B

•To show that f is injective Show that if f (x) = f (y) for arbitrary x, y ∈ A, then x = y.

•To show that f is not injective Find particular elements x, y ∈ A such that x ≠ y and f (x)
= f (y).

•To show that f is surjective Consider an arbitrary element y ∈ B and find an element x ∈
A such that f (x) = y.

•To show that f is not surjective Find a particular y ∈ B such that f (x) ≠ y for all x ∈ A.
Prove that f(x) = x+1 is injective

•For sake of contradiction


•Assume f(x) = x+1 is not injective.
•f(x) = f(y) where x!=y
• f(x) = f(y)  x+1 = y+1
•Subtract both sides by 1
• x = y which is a contradiction therefore f(x)=x+1 must
be injective.
Prove that f(x) = x2 is injective

•f:ZZ

•If there exists some a and b where a!=b but f(a) = f(b)
then the function is not injective.

• f(-2) = f(2) = 4 and -2 != 2 therefore f(x) is not injective.


Inverse of a function

You might also like