SlideShare a Scribd company logo
Functions
Functions
CSCE 235, Fall 2008 2
Outline
• Definitions & terminology
– function, domain, co-domain, image, preimage (antecedent), range, image of a
set, strictly increasing, strictly decreasing, monotonic
• Properties
– One-to-one (injective), onto (surjective), one-to-one correspondence
(bijective)
– Exercices (5)
• Inverse functions (examples)
• Operators
– Composition, Equality
• Important functions
– identity, absolute value, floor, ceiling, factorial
Functions
CSCE 235, Fall 2008 3
Introduction
• You have already encountered function
– f(x,y) = x+y
– f(x) = x
– f(x) = sin(x)
• Here we will study functions defined on discrete
domains and ranges.
• We will generalize functions to mappings
• We may not always be able to write function in a
‘neat way’ as above
Functions
CSCE 235, Fall 2008 4
Definition: Function
• Definition: A function f from a set A to a set B is an
assignment of exactly one element of B to each element of A.
• We write f(a)=b if b is the unique element of B assigned by the
function f to the element aA.
• If f is a function from A to B, we write
f: A  B
This can be read as ‘f maps A to B’
• Note the subtlety
– Each and every element of A has a single mapping
– Each element of B may be mapped to by several elements in A or not
at all
Functions
CSCE 235, Fall 2008 5
Terminology
• Let f: A  B and f(a)=b. Then we use the
following terminology:
– A is the domain of f, denoted dom(f)
– B is the co-domain of f
– b is the image of a
– a is the preimage (antecedent) of b
– The range of f is the set of all images of elements
of A, denoted rng(f)
Functions
CSCE 235, Fall 2008 6
Function: Visualization
A function, f: A  B
A B
a b
f
Domain Co-Domain
Preimage Image, f(a)=b
Range
Functions
CSCE 235, Fall 2008 7
More Definitions (1)
• Definition: Let f1 and f2 be two functions from
a set A to R. Then f1+f2 and f1f2 are also
function from A to R defined by:
– (f1+f2)(x) = f1(x) + f2(x)
– f1f2(x)= f1(x)f2(x)
• Example: Let f1(x)=x4+2x2+1 and f2(x)=2-x2
– (f1+f2)(x) = x4+2x2+1+2-x2 = x4+x2+3
– f1f2(x) = (x4+2x2+1)(2-x2)= -x6+3x2+2
Functions
CSCE 235, Fall 2008 8
More Definitions (2)
• Definition: Let f: A B and S A. The image
of the set S is the subset of B that consists of
all the images of the elements of S. We
denote the image of S by f(S), so that
f(S)={ f(s) |  sS}
• Note there that the image of S is a set and not
an element.
Functions
CSCE 235, Fall 2008 9
Image of a set: Example
• Let:
– A = {a1,a2,a3,a4,a5}
– B = {b1,b2,b3,b4,b5}
– f={(a1,b2), (a2,b3), (a3,b3), (a4,b1), (a5,b4)}
– S={a1,a3}
• Draw a diagram for f
• What is the:
– Domain, co-domain, range of f?
– Image of S, f(S)?
Functions
CSCE 235, Fall 2008 10
Definition: Injection
• Definition: A function f is said to be one-to-one or
injective (or an injection) if
 x and y in the domain of f, f(x)=f(y)  x=y
• Intuitively, an injection simply means that each
element in the range has at most one preimage
(antecedent)
• It may be useful to think of the contrapositive of this
definition
x  y  f(x)  f(y)
Functions
CSCE 235, Fall 2008 11
Definition: Surjection
• Definition: A function f: AB is called onto or
surjective (or an surjection) if
bB,  aA with f(a)=b
• Intuitively, a surjection means that every
element in the codomain is mapped (i.e., it is
an image, has an antecedent).
• Thus, the range is the same as the codomain
Functions
CSCE 235, Fall 2008 12
Definition: Bijection
• Definition: A function f is a one-to-one
correspondence (or a bijection), if is both one-to-one
(injective) and onto (surjective)
• One-to-one correspondences are important because
they endow a function with an inverse.
• They also allow us to have a concept cardinality for
infinite sets
• Let’s look at a few examples to develop a feel for
these definitions…
Functions
CSCE 235, Fall 2008 13
Functions: Example 1
• Is this a function? Why?
a1
a2
a3
a4
b1
b2
b3
b4
A B
• No, because each of a1, a2 has two images
Functions
CSCE 235, Fall 2008 14
Functions: Example 2
• Is this a function
– One-to-one (injective)? Why?
– Onto (surjective)? Why?
a1
a2
a3
a4
b1
b2
b3
b4
A B
No, b1 has 2 preimages
No, b4 has no preimage
Functions
CSCE 235, Fall 2008 15
Functions: Example 3
• Is this a function
– One-to-one (injective)? Why?
– Onto (surjective)? Why?
a1
a2
a3
b1
b2
b3
b4
A B
Yes, no bi has 2 preimages
No, b4 has no preimage
Functions
CSCE 235, Fall 2008 16
Functions: Example 4
a1
a2
a3
a4
b1
b2
b3
A B
• Is this a function
– One-to-one (injective)? Why?
– Onto (surjective)? Why?
No, b3 has 2 preimages
Yes, every bi has a preimage
Functions
CSCE 235, Fall 2008 17
Functions: Example 5
a1
a2
a3
a4
b1
b2
b3
b4
A B
• Is this a function
– One-to-one (injective)?
– Onto (surjective)?
Thus, it is a bijection or a
one-to-one correspondence
Functions
CSCE 235, Fall 2008 18
Exercice 1
• Let f:ZZ be defined by
f(x)=2x-3
• What is the domain, codomain, range of f?
• Is f one-to-one (injective)?
• Is f onto (surjective)?
• Clearly, dom(f)=Z. To see what the range is, note that:
b rng(f)  b=2a-3, with aZ
 b=2(a-2)+1
 b is odd
Functions
CSCE 235, Fall 2008 19
Exercise 1 (cont’d)
• Thus, the range is the set of all odd integers
• Since the range and the codomain are
different (i.e., rng(f)  Z), we can conclude that
f is not onto (surjective)
• However, f is one-to-one injective. Using
simple algebra, we have:
f(x1) = f(x2)  2x1-3 = 2x2-3  x1= x2 QED
Functions
CSCE 235, Fall 2008 20
Exercise 2
• Let f be as before
f(x)=2x-3
but now we define f:N N
• What is the domain and range of f?
• Is f onto (surjective)?
• Is f one-to-one (injective)?
• By changing the domain and codomain of f, f is not
even a function anymore. Indeed, f(1)=21-3=-1N
Functions
CSCE 235, Fall 2008 21
Exercice 3
• Let f:ZZ be defined by
f(x) = x2 - 5x + 5
• Is this function
– One-to-one?
– Onto?
Functions
CSCE 235, Fall 2008 22
Exercice 3: Answer
• It is not one-to-one (injective)
f(x1)=f(x2)  x1
2-5x1+5=x2
2 - 5x2+5  x1
2 - 5x1 = x2
2 - 5x2
 x1
2 - x2
2 = 5x1 - 5x2  (x1 - x2)(x1 + x2) = 5(x1 - x2)
 (x1 + x2) = 5
Many x1,x2 Z satisfy this equality. There are thus an infinite number of
solutions. In particular, f(2)=f(3)=-1
• It is also not onto (surjective).
The function is a parabola with a global minimum at (5/2,-5/4). Therefore,
the function fails to map to any integer less than -1
• What would happen if we changed the domain/codomain?
Functions
CSCE 235, Fall 2008 23
Exercice 4
• Let f:ZZ be defined by
f(x) = 2x2 + 7x
• Is this function
– One-to-one (injective)?
– Onto (surjective)?
• Again, this is a parabola, it cannot be onto
(where is the global minimum?)
Functions
CSCE 235, Fall 2008 24
Exercice 4: Answer
• However, it is one-to-one! Indeed:
f(x1)=f(x2)  2x1
2+7x1=2x2
2 + 7x2  2x1
2 - 2x2
2 = 7x2 - 7x1
 2(x1 - x2)(x1 + x2) = 7(x2 - x1)  2(x1 + x2) = -7  (x1 + x2) = -7
 (x1 + x2) = -7/2
But -7/2  Z. Therefore it must be the case that x1 = x2.
It follows that f is a one-to-one function. QED
Functions
CSCE 235, Fall 2008 25
Exercise 5
• Let f:ZZ be defined by
f(x) = 3x3 – x
• Is this function
– One-to-one (injective)?
– Onto (surjective)?
Functions
CSCE 235, Fall 2008 26
Exercice 5: f is one-to-one
• To check if f is one-to-one, again we suppose
that for x1,x2 Z we have f(x1)=f(x2)
f(x1)=f(x2)  3x1
3-x1=3x2
3-x2
 3x1
3 - 3x2
3 = x1 - x2
 3 (x1 - x2)(x1
2 +x1x2+x2
2)= (x1 - x2)
 (x1
2 +x1x2+x2
2)= 1/3
which is impossible because x1,x2 Z
thus, f is one-to-one
Functions
CSCE 235, Fall 2008 27
Exercice 5: f is not onto
• Consider the counter example f(a)=1
• If this were true, we would have
3a3 – a=1  a(3a2 – 1)=1 where a and (3a2 – 1) Z
• The only time we can have the product of two
integers equal to 1 is when they are both equal to 1
or -1
• Neither 1 nor -1 satisfy the above equality
• Thus, we have identified 1Z that does not have an
antecedent and f is not onto (surjective)
Functions
CSCE 235, Fall 2008 28
Inverse Functions (1)
• Definition: Let f: AB be a bijection. The
inverse function of f is the function that
assigns to an element bB the unique
element aA such that f(a)=b
• The inverse function is denote f-1.
• When f is a bijection, its inverse exists and
f(a)=b  f-1(b)=a
Functions
CSCE 235, Fall 2008 29
Inverse Functions (2)
• Note that by definition, a function can have an
inverse if and only if it is a bijection. Thus, we say
that a bijection is invertible
• Why must a function be bijective to have an inverse?
– Consider the case where f is not one-to-one (not injective).
This means that some element bB has more than one
antecedent in A, say a1 and a2. How can we define an
inverse? Does f-1(b)=a1 or a2?
– Consider the case where f is not onto (not surjective). This
means that there is some element bB that does not have
any preimage aA. What is then f-1(b)?
Functions
CSCE 235, Fall 2008 30
Inverse Functions: Representation
A function and its inverse
A B
a b
f(a)
Domain Co-Domain
f -1(b)
Functions
CSCE 235, Fall 2008 31
Inverse Functions: Example 1
• Let f:RR be defined by
f(x) = 2x – 3
• What is f-1?
1. We must verify that f is invertible, that is, is a bijection.
We prove that is one-to-one (injective) and onto
(surjective). It is.
2. To find the inverse, we use the substitution
• Let f-1(y)=x
• And y=2x-3, which we solve for x. Clearly, x= (y+3)/2
• So, f-1(y)= (y+3)/2
Functions
CSCE 235, Fall 2008 32
Inverse Functions: Example 2
• Let f(x)=x2. What is f-1?
• No domain/codomain has been specified.
• Say f:RR
– Is f a bijection? Does its inverse exist?
– Answer: No
• Say we specify that f: A B where
A={xR |x0} and B={yR | y0}
– Is f a bijection? Does its inverse exist?
– Answer: Yes, the function becomes a bijection and thus,
has an inverse
Functions
CSCE 235, Fall 2008 33
Inverse Functions: Example 2 (cont’)
• To find the inverse, we let
– f-1(y)=x
– y=x2, which we solve for x
• Solving for x, we get x=y, but which one is it?
• Since dom(f) is all nonpositive and rng(f) is nonnegative, thus
x must be nonpositive and
f-1(y)= -y
• From this, we see that the domains/codomains are just as
important to a function as the definition of the function itself
Functions
CSCE 235, Fall 2008 34
Inverse Functions: Example 3
• Let f(x)=2x
– What should the domain/codomain be for this function to
be a bijection?
– What is the inverse?
• The function should be f:RR+
• Let f-1(y)=x and y=2x, solving for x we get x=log2(y).
Thus, f-1(y)=log2(y)
• What happens when we include 0 in the codomain?
• What happens when restrict either sets to Z?

More Related Content

What's hot

PPt on Functions
PPt on FunctionsPPt on Functions
PPt on Functions
coolhanddav
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
Sunny Chauhan
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
Heather Scott
 
Function transformations
Function transformationsFunction transformations
Function transformations
Terry Gastauer
 
General Mathematics - Composition of Functions
General Mathematics - Composition of FunctionsGeneral Mathematics - Composition of Functions
General Mathematics - Composition of Functions
Juan Miguel Palero
 
8.1 intro to functions
8.1 intro to functions8.1 intro to functions
8.1 intro to functions
Barbara Knab
 
Functions
FunctionsFunctions
Functions
Ankit Bhandari
 
Inverse of functions
Inverse of functionsInverse of functions
Inverse of functions
Leo Crisologo
 
3 2 solving systems of equations (elimination method)
3 2 solving systems of equations (elimination method)3 2 solving systems of equations (elimination method)
3 2 solving systems of equations (elimination method)
Hazel Joy Chong
 
Linear function and slopes of a line
Linear function and slopes of a lineLinear function and slopes of a line
Linear function and slopes of a line
Jerlyn Fernandez
 
Relations & Functions
Relations & FunctionsRelations & Functions
Relations & Functions
J Edwards
 
Exponential Growth And Decay
Exponential Growth And DecayExponential Growth And Decay
Exponential Growth And Decay
Phil Saraspe
 
distance formula
distance formuladistance formula
distance formula
Charlene Ballera
 
Polynomial equations
Polynomial equationsPolynomial equations
Polynomial equations
kimverly ganaden
 
Sine and Cosine Functions Ppt
Sine and Cosine Functions PptSine and Cosine Functions Ppt
Sine and Cosine Functions Ppt
Devan Tate
 
Lesson 3: The Limit of a Function
Lesson 3: The Limit of a FunctionLesson 3: The Limit of a Function
Lesson 3: The Limit of a Function
Matthew Leingang
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmetic
sangeetha s
 
Exponential functions
Exponential functionsExponential functions
Exponential functions
Ron Eick
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
Matthew Leingang
 
Finding the slope of a line
Finding the slope of a lineFinding the slope of a line
Finding the slope of a line
Ahmed Nar
 

What's hot (20)

PPt on Functions
PPt on FunctionsPPt on Functions
PPt on Functions
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
 
Function transformations
Function transformationsFunction transformations
Function transformations
 
General Mathematics - Composition of Functions
General Mathematics - Composition of FunctionsGeneral Mathematics - Composition of Functions
General Mathematics - Composition of Functions
 
8.1 intro to functions
8.1 intro to functions8.1 intro to functions
8.1 intro to functions
 
Functions
FunctionsFunctions
Functions
 
Inverse of functions
Inverse of functionsInverse of functions
Inverse of functions
 
3 2 solving systems of equations (elimination method)
3 2 solving systems of equations (elimination method)3 2 solving systems of equations (elimination method)
3 2 solving systems of equations (elimination method)
 
Linear function and slopes of a line
Linear function and slopes of a lineLinear function and slopes of a line
Linear function and slopes of a line
 
Relations & Functions
Relations & FunctionsRelations & Functions
Relations & Functions
 
Exponential Growth And Decay
Exponential Growth And DecayExponential Growth And Decay
Exponential Growth And Decay
 
distance formula
distance formuladistance formula
distance formula
 
Polynomial equations
Polynomial equationsPolynomial equations
Polynomial equations
 
Sine and Cosine Functions Ppt
Sine and Cosine Functions PptSine and Cosine Functions Ppt
Sine and Cosine Functions Ppt
 
Lesson 3: The Limit of a Function
Lesson 3: The Limit of a FunctionLesson 3: The Limit of a Function
Lesson 3: The Limit of a Function
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmetic
 
Exponential functions
Exponential functionsExponential functions
Exponential functions
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
 
Finding the slope of a line
Finding the slope of a lineFinding the slope of a line
Finding the slope of a line
 

Similar to Functions

Functions.pptx
Functions.pptxFunctions.pptx
Functions.pptx
MUHAMMADANASSAEED1
 
9-Functions.pptx
9-Functions.pptx9-Functions.pptx
9-Functions.pptx
jaffarbikat
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representations
allyn joy calcaben
 
Chpt 2-functions-seqs v.5
Chpt 2-functions-seqs v.5Chpt 2-functions-seqs v.5
Chpt 2-functions-seqs v.5
ShahidAkbar22
 
Functions
FunctionsFunctions
Functions
Gaditek
 
Introductory calculus
Introductory calculusIntroductory calculus
Introductory calculus
FRANCISYEBOAH11
 
Introductory part of function for class 12th JEE
Introductory part of function for class 12th JEEIntroductory part of function for class 12th JEE
Introductory part of function for class 12th JEE
MohanSonawane
 
Task3
Task3Task3
functions-1.pdf
functions-1.pdffunctions-1.pdf
functions-1.pdf
KevalVala4
 
Math task 3
Math task 3Math task 3
Math task 3
blackbox90s
 
Functions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsFunctions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levels
Math Academy Singapore
 
Functions.ppt
Functions.pptFunctions.ppt
Functions.ppt
PramodMathur8
 
Functions.ppt
Functions.pptFunctions.ppt
Functions.ppt
ssuser19b417
 
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLESTYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
MohanSonawane
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
homeworkping3
 
Functions and graphs
Functions and graphsFunctions and graphs
Functions and graphs
Sujata Tapare
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10
Boipelo Radebe
 
The concept of functions.pptx
The concept of functions.pptxThe concept of functions.pptx
The concept of functions.pptx
MTiti1
 
Inverse function
Inverse function Inverse function
Inverse function
RidhimaPangtey
 
Functions
FunctionsFunctions
Functions
Bhagwan Das
 

Similar to Functions (20)

Functions.pptx
Functions.pptxFunctions.pptx
Functions.pptx
 
9-Functions.pptx
9-Functions.pptx9-Functions.pptx
9-Functions.pptx
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representations
 
Chpt 2-functions-seqs v.5
Chpt 2-functions-seqs v.5Chpt 2-functions-seqs v.5
Chpt 2-functions-seqs v.5
 
Functions
FunctionsFunctions
Functions
 
Introductory calculus
Introductory calculusIntroductory calculus
Introductory calculus
 
Introductory part of function for class 12th JEE
Introductory part of function for class 12th JEEIntroductory part of function for class 12th JEE
Introductory part of function for class 12th JEE
 
Task3
Task3Task3
Task3
 
functions-1.pdf
functions-1.pdffunctions-1.pdf
functions-1.pdf
 
Math task 3
Math task 3Math task 3
Math task 3
 
Functions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsFunctions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levels
 
Functions.ppt
Functions.pptFunctions.ppt
Functions.ppt
 
Functions.ppt
Functions.pptFunctions.ppt
Functions.ppt
 
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLESTYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
 
Functions and graphs
Functions and graphsFunctions and graphs
Functions and graphs
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10
 
The concept of functions.pptx
The concept of functions.pptxThe concept of functions.pptx
The concept of functions.pptx
 
Inverse function
Inverse function Inverse function
Inverse function
 
Functions
FunctionsFunctions
Functions
 

More from BindhuBhargaviTalasi

Inheritance
InheritanceInheritance
Blood relations
Blood relationsBlood relations
Blood relations
BindhuBhargaviTalasi
 
Boost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality predictionBoost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality prediction
BindhuBhargaviTalasi
 
Battery
BatteryBattery
Batteries
BatteriesBatteries
Water
WaterWater
Stories
StoriesStories
Predicates
PredicatesPredicates
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
BindhuBhargaviTalasi
 
Jdbc
JdbcJdbc
Blue jacking
Blue jackingBlue jacking
Blue jacking
BindhuBhargaviTalasi
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
BindhuBhargaviTalasi
 
Algebraic structures
Algebraic structuresAlgebraic structures
Algebraic structures
BindhuBhargaviTalasi
 
Bike sharing prediction
Bike sharing predictionBike sharing prediction
Bike sharing prediction
BindhuBhargaviTalasi
 
Travel agency
Travel agencyTravel agency
Travel agency
BindhuBhargaviTalasi
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
BindhuBhargaviTalasi
 
Library system
Library systemLibrary system
Library system
BindhuBhargaviTalasi
 
Data analytics
Data analyticsData analytics
Data analytics
BindhuBhargaviTalasi
 
Agristore
AgristoreAgristore
Collection framework
Collection frameworkCollection framework
Collection framework
BindhuBhargaviTalasi
 

More from BindhuBhargaviTalasi (20)

Inheritance
InheritanceInheritance
Inheritance
 
Blood relations
Blood relationsBlood relations
Blood relations
 
Boost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality predictionBoost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality prediction
 
Battery
BatteryBattery
Battery
 
Batteries
BatteriesBatteries
Batteries
 
Water
WaterWater
Water
 
Stories
StoriesStories
Stories
 
Predicates
PredicatesPredicates
Predicates
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
 
Jdbc
JdbcJdbc
Jdbc
 
Blue jacking
Blue jackingBlue jacking
Blue jacking
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
 
Algebraic structures
Algebraic structuresAlgebraic structures
Algebraic structures
 
Bike sharing prediction
Bike sharing predictionBike sharing prediction
Bike sharing prediction
 
Travel agency
Travel agencyTravel agency
Travel agency
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
 
Library system
Library systemLibrary system
Library system
 
Data analytics
Data analyticsData analytics
Data analytics
 
Agristore
AgristoreAgristore
Agristore
 
Collection framework
Collection frameworkCollection framework
Collection framework
 

Recently uploaded

Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
ramrag33
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
riddhimaagrawal986
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
PKavitha10
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
architagupta876
 

Recently uploaded (20)

Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
 

Functions

  • 2. Functions CSCE 235, Fall 2008 2 Outline • Definitions & terminology – function, domain, co-domain, image, preimage (antecedent), range, image of a set, strictly increasing, strictly decreasing, monotonic • Properties – One-to-one (injective), onto (surjective), one-to-one correspondence (bijective) – Exercices (5) • Inverse functions (examples) • Operators – Composition, Equality • Important functions – identity, absolute value, floor, ceiling, factorial
  • 3. Functions CSCE 235, Fall 2008 3 Introduction • You have already encountered function – f(x,y) = x+y – f(x) = x – f(x) = sin(x) • Here we will study functions defined on discrete domains and ranges. • We will generalize functions to mappings • We may not always be able to write function in a ‘neat way’ as above
  • 4. Functions CSCE 235, Fall 2008 4 Definition: Function • Definition: A function f from a set A to a set B is an assignment of exactly one element of B to each element of A. • We write f(a)=b if b is the unique element of B assigned by the function f to the element aA. • If f is a function from A to B, we write f: A  B This can be read as ‘f maps A to B’ • Note the subtlety – Each and every element of A has a single mapping – Each element of B may be mapped to by several elements in A or not at all
  • 5. Functions CSCE 235, Fall 2008 5 Terminology • Let f: A  B and f(a)=b. Then we use the following terminology: – A is the domain of f, denoted dom(f) – B is the co-domain of f – b is the image of a – a is the preimage (antecedent) of b – The range of f is the set of all images of elements of A, denoted rng(f)
  • 6. Functions CSCE 235, Fall 2008 6 Function: Visualization A function, f: A  B A B a b f Domain Co-Domain Preimage Image, f(a)=b Range
  • 7. Functions CSCE 235, Fall 2008 7 More Definitions (1) • Definition: Let f1 and f2 be two functions from a set A to R. Then f1+f2 and f1f2 are also function from A to R defined by: – (f1+f2)(x) = f1(x) + f2(x) – f1f2(x)= f1(x)f2(x) • Example: Let f1(x)=x4+2x2+1 and f2(x)=2-x2 – (f1+f2)(x) = x4+2x2+1+2-x2 = x4+x2+3 – f1f2(x) = (x4+2x2+1)(2-x2)= -x6+3x2+2
  • 8. Functions CSCE 235, Fall 2008 8 More Definitions (2) • Definition: Let f: A B and S A. The image of the set S is the subset of B that consists of all the images of the elements of S. We denote the image of S by f(S), so that f(S)={ f(s) |  sS} • Note there that the image of S is a set and not an element.
  • 9. Functions CSCE 235, Fall 2008 9 Image of a set: Example • Let: – A = {a1,a2,a3,a4,a5} – B = {b1,b2,b3,b4,b5} – f={(a1,b2), (a2,b3), (a3,b3), (a4,b1), (a5,b4)} – S={a1,a3} • Draw a diagram for f • What is the: – Domain, co-domain, range of f? – Image of S, f(S)?
  • 10. Functions CSCE 235, Fall 2008 10 Definition: Injection • Definition: A function f is said to be one-to-one or injective (or an injection) if  x and y in the domain of f, f(x)=f(y)  x=y • Intuitively, an injection simply means that each element in the range has at most one preimage (antecedent) • It may be useful to think of the contrapositive of this definition x  y  f(x)  f(y)
  • 11. Functions CSCE 235, Fall 2008 11 Definition: Surjection • Definition: A function f: AB is called onto or surjective (or an surjection) if bB,  aA with f(a)=b • Intuitively, a surjection means that every element in the codomain is mapped (i.e., it is an image, has an antecedent). • Thus, the range is the same as the codomain
  • 12. Functions CSCE 235, Fall 2008 12 Definition: Bijection • Definition: A function f is a one-to-one correspondence (or a bijection), if is both one-to-one (injective) and onto (surjective) • One-to-one correspondences are important because they endow a function with an inverse. • They also allow us to have a concept cardinality for infinite sets • Let’s look at a few examples to develop a feel for these definitions…
  • 13. Functions CSCE 235, Fall 2008 13 Functions: Example 1 • Is this a function? Why? a1 a2 a3 a4 b1 b2 b3 b4 A B • No, because each of a1, a2 has two images
  • 14. Functions CSCE 235, Fall 2008 14 Functions: Example 2 • Is this a function – One-to-one (injective)? Why? – Onto (surjective)? Why? a1 a2 a3 a4 b1 b2 b3 b4 A B No, b1 has 2 preimages No, b4 has no preimage
  • 15. Functions CSCE 235, Fall 2008 15 Functions: Example 3 • Is this a function – One-to-one (injective)? Why? – Onto (surjective)? Why? a1 a2 a3 b1 b2 b3 b4 A B Yes, no bi has 2 preimages No, b4 has no preimage
  • 16. Functions CSCE 235, Fall 2008 16 Functions: Example 4 a1 a2 a3 a4 b1 b2 b3 A B • Is this a function – One-to-one (injective)? Why? – Onto (surjective)? Why? No, b3 has 2 preimages Yes, every bi has a preimage
  • 17. Functions CSCE 235, Fall 2008 17 Functions: Example 5 a1 a2 a3 a4 b1 b2 b3 b4 A B • Is this a function – One-to-one (injective)? – Onto (surjective)? Thus, it is a bijection or a one-to-one correspondence
  • 18. Functions CSCE 235, Fall 2008 18 Exercice 1 • Let f:ZZ be defined by f(x)=2x-3 • What is the domain, codomain, range of f? • Is f one-to-one (injective)? • Is f onto (surjective)? • Clearly, dom(f)=Z. To see what the range is, note that: b rng(f)  b=2a-3, with aZ  b=2(a-2)+1  b is odd
  • 19. Functions CSCE 235, Fall 2008 19 Exercise 1 (cont’d) • Thus, the range is the set of all odd integers • Since the range and the codomain are different (i.e., rng(f)  Z), we can conclude that f is not onto (surjective) • However, f is one-to-one injective. Using simple algebra, we have: f(x1) = f(x2)  2x1-3 = 2x2-3  x1= x2 QED
  • 20. Functions CSCE 235, Fall 2008 20 Exercise 2 • Let f be as before f(x)=2x-3 but now we define f:N N • What is the domain and range of f? • Is f onto (surjective)? • Is f one-to-one (injective)? • By changing the domain and codomain of f, f is not even a function anymore. Indeed, f(1)=21-3=-1N
  • 21. Functions CSCE 235, Fall 2008 21 Exercice 3 • Let f:ZZ be defined by f(x) = x2 - 5x + 5 • Is this function – One-to-one? – Onto?
  • 22. Functions CSCE 235, Fall 2008 22 Exercice 3: Answer • It is not one-to-one (injective) f(x1)=f(x2)  x1 2-5x1+5=x2 2 - 5x2+5  x1 2 - 5x1 = x2 2 - 5x2  x1 2 - x2 2 = 5x1 - 5x2  (x1 - x2)(x1 + x2) = 5(x1 - x2)  (x1 + x2) = 5 Many x1,x2 Z satisfy this equality. There are thus an infinite number of solutions. In particular, f(2)=f(3)=-1 • It is also not onto (surjective). The function is a parabola with a global minimum at (5/2,-5/4). Therefore, the function fails to map to any integer less than -1 • What would happen if we changed the domain/codomain?
  • 23. Functions CSCE 235, Fall 2008 23 Exercice 4 • Let f:ZZ be defined by f(x) = 2x2 + 7x • Is this function – One-to-one (injective)? – Onto (surjective)? • Again, this is a parabola, it cannot be onto (where is the global minimum?)
  • 24. Functions CSCE 235, Fall 2008 24 Exercice 4: Answer • However, it is one-to-one! Indeed: f(x1)=f(x2)  2x1 2+7x1=2x2 2 + 7x2  2x1 2 - 2x2 2 = 7x2 - 7x1  2(x1 - x2)(x1 + x2) = 7(x2 - x1)  2(x1 + x2) = -7  (x1 + x2) = -7  (x1 + x2) = -7/2 But -7/2  Z. Therefore it must be the case that x1 = x2. It follows that f is a one-to-one function. QED
  • 25. Functions CSCE 235, Fall 2008 25 Exercise 5 • Let f:ZZ be defined by f(x) = 3x3 – x • Is this function – One-to-one (injective)? – Onto (surjective)?
  • 26. Functions CSCE 235, Fall 2008 26 Exercice 5: f is one-to-one • To check if f is one-to-one, again we suppose that for x1,x2 Z we have f(x1)=f(x2) f(x1)=f(x2)  3x1 3-x1=3x2 3-x2  3x1 3 - 3x2 3 = x1 - x2  3 (x1 - x2)(x1 2 +x1x2+x2 2)= (x1 - x2)  (x1 2 +x1x2+x2 2)= 1/3 which is impossible because x1,x2 Z thus, f is one-to-one
  • 27. Functions CSCE 235, Fall 2008 27 Exercice 5: f is not onto • Consider the counter example f(a)=1 • If this were true, we would have 3a3 – a=1  a(3a2 – 1)=1 where a and (3a2 – 1) Z • The only time we can have the product of two integers equal to 1 is when they are both equal to 1 or -1 • Neither 1 nor -1 satisfy the above equality • Thus, we have identified 1Z that does not have an antecedent and f is not onto (surjective)
  • 28. Functions CSCE 235, Fall 2008 28 Inverse Functions (1) • Definition: Let f: AB be a bijection. The inverse function of f is the function that assigns to an element bB the unique element aA such that f(a)=b • The inverse function is denote f-1. • When f is a bijection, its inverse exists and f(a)=b  f-1(b)=a
  • 29. Functions CSCE 235, Fall 2008 29 Inverse Functions (2) • Note that by definition, a function can have an inverse if and only if it is a bijection. Thus, we say that a bijection is invertible • Why must a function be bijective to have an inverse? – Consider the case where f is not one-to-one (not injective). This means that some element bB has more than one antecedent in A, say a1 and a2. How can we define an inverse? Does f-1(b)=a1 or a2? – Consider the case where f is not onto (not surjective). This means that there is some element bB that does not have any preimage aA. What is then f-1(b)?
  • 30. Functions CSCE 235, Fall 2008 30 Inverse Functions: Representation A function and its inverse A B a b f(a) Domain Co-Domain f -1(b)
  • 31. Functions CSCE 235, Fall 2008 31 Inverse Functions: Example 1 • Let f:RR be defined by f(x) = 2x – 3 • What is f-1? 1. We must verify that f is invertible, that is, is a bijection. We prove that is one-to-one (injective) and onto (surjective). It is. 2. To find the inverse, we use the substitution • Let f-1(y)=x • And y=2x-3, which we solve for x. Clearly, x= (y+3)/2 • So, f-1(y)= (y+3)/2
  • 32. Functions CSCE 235, Fall 2008 32 Inverse Functions: Example 2 • Let f(x)=x2. What is f-1? • No domain/codomain has been specified. • Say f:RR – Is f a bijection? Does its inverse exist? – Answer: No • Say we specify that f: A B where A={xR |x0} and B={yR | y0} – Is f a bijection? Does its inverse exist? – Answer: Yes, the function becomes a bijection and thus, has an inverse
  • 33. Functions CSCE 235, Fall 2008 33 Inverse Functions: Example 2 (cont’) • To find the inverse, we let – f-1(y)=x – y=x2, which we solve for x • Solving for x, we get x=y, but which one is it? • Since dom(f) is all nonpositive and rng(f) is nonnegative, thus x must be nonpositive and f-1(y)= -y • From this, we see that the domains/codomains are just as important to a function as the definition of the function itself
  • 34. Functions CSCE 235, Fall 2008 34 Inverse Functions: Example 3 • Let f(x)=2x – What should the domain/codomain be for this function to be a bijection? – What is the inverse? • The function should be f:RR+ • Let f-1(y)=x and y=2x, solving for x we get x=log2(y). Thus, f-1(y)=log2(y) • What happens when we include 0 in the codomain? • What happens when restrict either sets to Z?