Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Function

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

GOA COLLEGE OF ENGINEERING

“BHAUSAHEB BANDODKAR TECHNICAL EDUCATION COMPLEX"


FARMAGUDI, PONDA- GOA - INDIA

DISCRETE MATHEMATICS
S.E.(COMPUTER) SEM-IV
FUNCTIONS

DEVELOPED BY MATHEMATICS FACULTY


DEPARTMENT OF SCIENCE & HUMANITIES
GOA COLLEGE OF ENGINEERING
FUNCTIONS
TOPICS TO BE COVERED:
➢ FUNCTIONS

➢ TYPES OF FUNCTIONS

➢ INVERTIBLE FUNCTIONS

➢ SPECIAL FUNCTIONS
FUNCTIONS
Functions
Let A and B be two non-empty sets. A function f from A to B is a relation from A to B such that for each
a ∈ A, there is a unique b ∈ B such that (a,b) ∈ f.
We write b = f(a) and read as b is called the image of a under f
a is called the preimage of b.
A function is denoted by f: A→ B.

A B
f
a b

A is called the domain and B is called the codomain of f.

Observations:
(i) Every a in A belongs to some pair (a,b) in f and if (a1, b1) ∈ f and (a1,b2)∈ f , then b1 = b2,
(ii) An element b ∈ B need not have a preimage in A . If b ∈ 𝐵 has a preimage a ∈ 𝐴, the preimage need not be
unique. i.e two elements of A can have the same image in B.
FUNCTIONS
Equal functions:
Let f : A→ B and g : A → 𝐵. We say f = g iff f(a)= g(a) ∀ a ∈ 𝐴.

Range of f: Let f: A → B. The range of f denoted by f(A) is f(A)= {f(x): x ∈ A}


Note: f(A) ⊆ B.

Example: Let A and B be finite sets with m and n elements respectively. How many
functions are possible from A to B?
Solution: Let A = {a1,a2 , …, am}
B = {b1,b2,…,bn}
A function f: A→ B is of the form
f = {(a1, x),(a2 , x), ……(am ,x) where x→some bj ∈ B
Since there are n number of bj’s , there are n choices for x in each of the m ordered pairs
belonging to f.
∴ The total possible no. of choices for x is n x n x ……n (m factors)= nm
Therefore, there are nm functions from set A to set B.
FUNCTIONS
Types of functions:
One-One (injective): A function f: A→ B is said to be one-one(injective) if distinct elements of A
have distinct images in B.
i.e. if f(x1)= f(x2), then x1 = x2 for x1,x2 𝜖 A

Onto (surjective): A function f: A→ B is said to be onto if every element of B has a preimage in A.


i.e. ∀ b ∈ B , ∃ a ∈ 𝐴 such that f(a) = b.
i.e. f(A)= B or Range of f = B

One-one and Onto(bijective): f is said to be bijective if it is both 1-1 and onto.


A B
Example 1:
f 1
a 2
b 3
c 4
d 5

f is one-one but not onto since 2∈ B does not have a preimage in A.


FUNCTIONS
Example 2:
A B
f
a 1
b 2
c 3
d 4
e

f is onto but not one-one since f(a)=f(d)=3


A B
Example 3: f
a 1
b 2
c 3
d 4

f is one-one and onto(bijective)


FUNCTIONS
Example 4:
A B
f
a 1
2
b 3
4
c

f is neither one-one nor onto.


Note: If A and B are finite sets and f: A→ B, then:
(i) f is one-one ⟹n(A) ≤ n(B)
(ii) f is onto ⟹n(A) ≥ n(B)
(iii) f is bijective ⟹ n(A)= n(B)
FUNCTIONS
Example 5: f: Z→ Z defined by f(x) = x2 is not one-one.
f(1) =1
f(-1) = 1
But 1 ≠ -1

Example 6: Let f: R→ R given by f(x)=2x + 3. Show that f is bijective where R is the set of real numbers
Solution: Suppose f(x1) = f(x2 )
2x1 + 3 = 2x2 + 3
⟹ 2x1 = 2x2
⟹ x1 = x2
∴ f is one-one
Let y ∈ R
𝑦 = 2𝑥 + 3
𝑦 − 3 = 2𝑥
𝑦−3
2
=𝑥
𝑦−3
For each y ∈ 𝑅 , ∃ x = 2 such that f(x)= y
∴ f is onto. Hence, f is bijective.
FUNCTIONS
Identity function: A function f: A→ A defined by f(x) =x ∀ 𝑥 ∈ 𝐴 is called the identity function. An
identity function is bijective.

Constant function: A function f: A→ 𝐵 𝑑𝑒𝑓𝑖𝑛𝑒𝑑 𝑏𝑦 𝑓 𝑥 = 𝑐, ∀ x ∈ 𝐴 , 𝑐 ∈ B is called a constant


function. A constant function is not one-one.

Composition of functions: Let A,B,C be three non-empty sets and f: A→ B and g: B→ C . The
composition of f and g denoted by 𝑔 ∘ 𝑓 is the function 𝑔 ∘ 𝑓: 𝐴 → 𝐶 defined by
𝑔∘𝑓 𝑥 =𝑔 𝑓 𝑥 ∀𝑥 ∈𝐴.
A B C
𝑔∘𝑓

a f b g c

Note: If f: A→ A, then 𝑓 ∘ 𝑓: 𝐴 →A is defined as 𝑓 ∘ 𝑓 𝑥 = 𝑓 𝑓 𝑥 ∀x∈𝐴


FUNCTIONS
Example 1: Let A = {1,2,3,4} , B={a,b,c} and C={w,x,y,z}
Let f: A→ B given by f= {(1,a),(2,a),(3,b),(4,c)}
Let g: B→ C given by g= {(a,x),(b,y),(c,z)}
Then g ∘ f: A→ C
(g ∘ f)(1)= g(f(1))= g(a)= x
(g ∘ f)(2) = g(f(2))= g(a)= x
(g ∘ f)(3)= g(f(3))= g(b)= y
(g ∘ f)(4)= g(f(4))= g(c) = z
∴ g ∘ f= {(1,x),(2,x),(3,y),(4,z)}

Example 2: Let f: R→ 𝑅 and g:R→ R defined by f(x)= x2 +1 and g(x ) = x +2 ∀ x ∈ R


Then f ∘ g: R→ R and g ∘ f: R → R
f ∘ g(x)= f(g(x))= f(x+2)= (x+2)2 + 1 = x2 + 4x +5
g ∘ f(x)= g(f(x))= g(x2+1)= x2 + 1+2 = x2 + 3

Note: In general, g ∘ f ≠ f ∘ g
FUNCTIONS
𝑥+1
Example 3: Let f: R–{1} → R – {1} given by 𝑓 𝑥 = . Show that 𝑓 ∘ 𝑓 𝑥 = 𝑥
𝑥−1
𝑥+1
Solution: 𝑓 ∘ 𝑓 𝑥 = 𝑓 𝑓 𝑥 =𝑓
𝑥−1
𝑥+1 𝑥+1+𝑥−1
+1 2𝑥
𝑥−1 𝑥−1
= 𝑥+1 = 𝑥+1−𝑥+1 = =𝑥
−1 2
𝑥−1 𝑥−1

Example 4: Let f, g :R→ R defined by f(x)= ax + b and g(x) = cx + d . Determine for which
constants f ∘ g = g ∘ f, where a,b,c,d are constants.
Solution: f ∘ g(x)= f(g(x)) = f(cx + d)= a(cx +d)+ b = acx + ad + b
g ∘ f(x)= g(f(x))= g(ax +b) = c(ax +b)+ d = acx + bc + d
If f ∘ g = g ∘ f
⟹ acx + ad +b = acx + bc + d
ad – bc = d –b
𝑎 𝑏
=𝑑−𝑏
𝑐 𝑑
FUNCTIONS
Theorem: If f: A→ B and g: B→ C are bijective functions, then g ∘ f : A→ 𝐶 is also
a bijective function.
Proof: Suppose g ∘ f (x1) = g ∘ f (x2 ) x1,x2 ∈ 𝐴
⟹ g(f(x1))= g(f(x2))
⟹ f(x1)= f(x2) since g is one-one
⟹ x1 = x2 since f is one-one
∴ g ∘ f is one –one
Let c ∈ C
Since g: B→ C is onto, ∃ b ∈ B such that g(b) = c
Since b ∈ B and f: A→ B is onto, ∃ a ∈ A such that f(a) = b
c= g(b) = g(f(a))= g∘f(a)
∴ For any c ∈ 𝐶 , ∃ 𝑎 ∈ 𝐴, such that g∘f(a)=c
∴ g ∘ f is onto.
Hence, g ∘ f : A → C is bijective.
FUNCTIONS
Inverse function: Let f:A→ B be a bijective function. The inverse function of f ,
denoted by f-1 is a function f-1 : B→ A that assigns to each b ∈ B a unique element
a ∈ A such that f(a) = b.

Theorem: A function f : A→ B is invertible if and only if it is bijective.

Example 1: Let f: {a,b,c} →{1,2,3} given by


f = {(a,2),(b,3),(c,1)}
f is bijective.
f-1 : {1,2,3} → {a,b,c}
f-1 = {(1,c),(2,a),(3,b)}
FUNCTIONS
Example 2: Let f: R→ 𝑅 be defined by f(x)= ax + b , a≠ 0. Show that f is bijective and hence find
f-1 .
Solution: Let f(x1) = f(x2 )
ax1 + b = ax2 + b
⟹ ax1 = ax2
⟹ x1 = x2 since, a ≠ 0
∴ f is one –one.
Let y ∈ R
y= ax + b
y – b = ax
𝑦−𝑏
=𝑥
𝑎
𝑦−𝑏
∴ For each element y ∈ R, ∃ x = such that f (x) = y .
𝑎
∴ f is onto.
Hence, f is bijective.
𝑦−𝑏
f-1 : R→ R given by 𝑓 −1 (𝑦) = .
𝑎
FUNCTIONS
Example 3: . Let f: R → R , where R is a set of real numbers be given by:
f(x) = 4x + 1 if x ≥ 1
= 2x + 3 if x < 1
Determine whether f is bijective. In case it is bijective, find its inverse.
Solution: The domain is divided into two parts : (-∞ , 1) , [1,∞)
Let x1, x2 ∈ [1,∞ ) and f(x1) = f(x2)
So, 4x1 + 1 = 4x2 + 1
⟹ 𝑥 1 = x2
Let x1 , x2 𝜖 (-∞ ,1) and f(x1 ) = f(x2 )
2x1 + 3 = 2x2 + 3
⟹ x1= x2
Also, 4x + 1 = 2x + 3 ⟹ x = 1
∴ f is one-one
FUNCTIONS
Let y ∈ R
x≥1
Let 𝑦 = 4𝑥 + 1 ⟹ 𝑦 − 1 = 4𝑥
𝑦−1 ⟹ 4x ≥4
=𝑥; y≥5 ⟹ 4x +1 ≥ 4 +1
4
⟹ 4x + 1 ≥ 5
Let 𝑦 = 2𝑥 + 3
𝑦−3
⟹ =𝑥,y<5 x<1
2
∴ f is onto ⟹ 2x < 2
⟹ 2x + 3 < 2 +3
Hence f is bijective. ⟹ 2x +3 < 5
f-1: R → R
𝑦−1
𝑓 −1 𝑦 = if y ≥ 5
4
𝑦−3
= if y < 5
2
FUNCTIONS
Theorem: Let f: A→ B and g:B→ A such that g ∘ f= iA and f ∘ g = iB where iA and iB are identity
functions on sets A and B respectively. Then f and g are bijective and f-1 = g and g-1 = f .

Example: Let f, g : R → R given by f(x)= x3 and g(x)= x 1/3 . Show that f and g are inverses of each
other.
Solution: f ∘ g: R → R
f ∘ g (x) = f(g(x))= f(x1/3) = (𝑥 1Τ3 )3 = x = iR (x)
∴ f ∘ g = iR

g ∘ f: R→ R
g ∘ f(x)= g (f(x))= g (x3 ) = (𝑥 3 )1Τ3 = x= iR (x)
g ∘ f= iR
∴ f and g are inverses of each other.

Theorem: Let f: A→ B and g: B→ C be invertible functions. Then g ∘ f is invertible and


(g ∘ f )-1 = f-1 ∘ g -1.
FUNCTIONS
Special functions:
1. Floor function: Let x be a real number. The floor function assigns to x the largest integer that is
less than or equal to x . It is denoted by 𝑥
𝑥 = 𝑛 ⟹ n ≤ x ≤ n +1

2. Ceiling function: Let x be a real number The ceiling function assigns to x the smallest integer
greater than or equal to x . It is denoted by 𝑥 .
𝑥 = n ⟹ n -1 ≤ 𝑥 ≤ n

Note: If x is an integer, then 𝑥 = 𝑥 = 𝑥 .

Examples:
a. 8 =8 8 =8
b. 1.5 = 1 1.5 = 2
c. −3 = −3 −3 = −3
d. −6.2 = −7 −6.2 = −6
e. −0.5 = −1 −0.5 = 0
f. 0.5 = 0 0.5 =1
FUNCTIONS
3. Characteristic function: Let A be a subset of a universal set U. The characteristic
function of A, denoted by fA : U→ [0,1] defined as
fA (x) = 1 if x ∈ A
=0 if x ∉ A

You might also like