Jarrar - LectureNotes.7.2 Functions Properties
Jarrar - LectureNotes.7.2 Functions Properties
Functions
, 1
mjarrar©2015
Acknowledgement:
This lecture is based on (but not limited to) to chapter 7 in “Discrete Mathema:cs with Applica:ons
by Susanna S. Epp (3rd Edi:on)”.
, 2
1
11/25/18
x
اﻟﻣﻘﺎﺑلstatement
To obtain a precise رة ﻓﻲ اﻟﻣﺟﺎلof
ﺻوwhat
ﺎ ﻧﻔس اﻟitﮭﻣmeans
ﻲ اﻟﻣﺟﺎل ﻟfor
ﻻ ﯾوﺟد ﻋﻧﺻرﯾن ﻓnot to be one-to-one,
X = domain ofaF function
F Y = co-domain of F
takeX the negation
= domain of F of one of theYequivalent
= co-domain versions
of F of the definition above. Thus:
F
x1 Two distinct elements
x1 Any two distinct elements
A function F: X → Y is not one-to-one
F(x 1 ) ⇔ x ∃sent
of X are
elements
to two
x1 and x2 inF(x 1X) = with
F(x 2 ) of X are sent to
2 the same element of Y.
x2 F(x 2 ) F(x )
distinct elements
1 = F(x
of Y. 2 ) and x 1 ̸ = x 2.
, A 4
ThatFigure 7.2.1(a)
is, if elements x1One-to-One
and x2 canFunction
be found Separates
Figure havePoints
that7.2.1(b) Athe sameThat
Function function value but
Is Not One-to-One are Points Together
Collapses
not equal, then F is not one-to-one.
X =In termsofof
domain F arrow diagrams,
Example
F
a =one-to-one
7.2.1
Y Identifying
co-domain offunction can be
FOne-to-One thoughtDefined
Functions of as aonfunction that
Finite Sets
separates points. That is, it takes distinct points of the domain to distinct points of the
a. Do either of the arrow diagrams in Figure 7.2.2 define one-to-one functions?
co-domain. A function that is not one-to-one fails to separate points. That is, at least two
points xof
1 the domain are taken to the same point of the co-domain. This is illustrated in
Two distinct elements
F(x 1 ) = F(x 2 ) Domain
of X of
areF sentCo-domain
to of F Domain of G Co-domain of G
Figure x7.2.1
2
on the next page.
theXsame element Yof Y. X Y
2
F G
a u a u
b v b v
ht 2010 Cengage Learning. All Rights Reserved. May notFigure 7.2.1(b) A Function
in whole or inThat
part. DueIs Not One-to-One Collapses
content mayPoints Together
c w c w
be copied, scanned, or duplicated, to electronic rights, some third party
d
be suppressed x
from the eBook and/or eChapter(s).
d x
review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time
y if subsequent rights restrictions require it. y
11/25/18
, 5
, 6
3
11/25/18
Counterexample:
Let n1 =2 and n2 = −2. Then by definition of g,
g(n1) = g(2) = 22 = 4 and also
g(n2) = g(−2) = (−2)2 = 4.
Hence g(n1) = g(n2) but n1 ≠ n2,
and so g is not one-to-one.
, 7
Counter example:
0599123456 and 0569123456 are both for Sami
, 8
4
11/25/18
Func9ons
7.2 Properties of Functions
In this lecture:
qPart 1: One-to-one Functions
qPart 2: Onto Functions
qPart 3: one-to-one Correspondence Functions
qPart 4: Inverse Functions
qPart 5: Applications: Hash and Logarithmic Functions 10
,
5
Symbolically:
• Definition F: X → Y is onto ⇔ ∀y ∈ Y, ∃x ∈ X such that F(x) = y.
Let F be a function from a set X to a set Y . F is onto (or surjective) if, and only if,
402 Chapter 7 Functions
given any element y in Y , it is possible to find an element
To obtainxain X with
precise the property
statement of what it means for a function 11/25/18
not to be onto, take
that y = F(x). negation of the definition of onto:
Onto Functions
Symbolically:
It was noted in Section 7.1 that there may be an element of the co-domain of a function
→ Yis is
F: X that notonto ⇔ of∀yany
the image ∈ Y, ∃x ∈ inX the
element suchF:that
X→
domain. F(x) =notother
Y isthe
On y.ontohand,
⇔ every
∃y inelement
Y such that ∀x ∈ X, F(x) ̸= y.
of a function’s co-domain may be the image of some element of its domain. Such a
function is called onto or surjective. When a function is onto, its range is equal to its
To obtain a precise statement of what it meansThat
co-domain. for ais,function
there is some element
not to be onto, Onto Functions
in Ytake
that the
is not the image of any element in X .
In terms of arrow diagrams, a function is onto if each element of the co-domain
negation of the definition of onto:
an arrow pointing to it from some element of the domain. A function is not onto if at l
• Definition
one element in its co-domain does not have an arrow pointing to it. This is illustrate
Let F be a function from a set X to Figure
a set 7.2.3.
Y . F is onto (or surjective) if, and only if,
F: X → Ygivenis not onto ⇔ ∃y in Y such that ∀x ∈ X, F(x) ̸ = y.
any element y in Y , it is possible to find an element x in X with the property
that y = F(x). X = domain of F Y = co-domain of F
F
Symbolically:
That is, there is some element in Y that is not the image of any element in X . Each element y in
F: X → Y is onto ⇔ ∀y ∈ Y, ∃x ∈ X such that F(x) = y.
In terms of arrow diagrams, a function is onto if each element of the co-domain has y = F(x) Y equals F(x) for
x
an arrow pointing to it from some element of the domain. A function is not onto if at least at least one x in X.
ﻻ ﯾوﺟد ﻋﻧﺻر ﻓﻲ اﻟﻣﺟﺎل اﻟﻣﻘﺎﺑل ﻟﯾس ﺻورة ﻟﻌﻧﺻر ﻓﻲ اﻟﻣﺟﺎل
one element in its co-domain
To obtaindoes not statement
a precise have an arrow
of whatpointing
it meansto
forit.a This is illustrated
function in take the
not to be onto,
Figure 7.2.3. negation of the definition of onto: Figure 7.2.3(a) A Function That Is Onto
x
X = domain of F Y = co-domain of F X = domain of F
F: X →FY is not onto ⇔ ∃y in Y such that ∀x ∈ X, F(x)
F ̸= Y =y.co-domain of F
X = domain of F X = domain of F
Y = co-domain Y = co-domain of F
F Fof F
Each element y in
At least one element in Y
= F(x) Y equals F(x) for
doesy not
Proving/Disproving
x
Functions are Onto equal F(x)at least one x in X.
for any x in X.
Figure
To prove F is not 7.2.3(b)
onto, youAwill
Function That Is Not Onto
usually
find an element y of Y | y ≠ F(x) for any x in X.
All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
y suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
,
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).12
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
6
11/25/18
Define f : R→R
f(x) = 4x − 1 for all x∈R
, 13
, 14
7
11/25/18
Counter example:
Sami does not have a mobile number
, 15
Prove:
In biology and forensic science: there is no person without fingerprint
, 16
8
11/25/18
Functions
7.2 Properties of Functions
In this lecture:
408 Chapter 7 Functions qPart 1: One-to-one Func1ons
qPart 2: Onto Func1ons
each element of X with exactly one element of Y and each element of Y with exactly one
element ofqPart one-to-one Correspondence Func:ons
X . Such a3:pairing is called a one-to-one correspondence or bijection and is
illustrated by the arrow diagram in Figure 7.2.5. One-to-one correspondences are often
used as aidsqPart 4: Inverse
to counting. Func1ons
The pairing of Figure 7.2.5, for example, shows that there are
five elements in the set X .
qPart 5: Applica1ons: Hash and Logarithmic Func1ons
, 17
X = domain of F Y = co-domain of F
F
a 1
b 2
c 3
d 4
e 5
One-to-One Correspondences
Figure 7.2.5 An Arrow Diagram for a One-to-One Correspondence
• Definition
er 7 Functions
A one-to-one correspondence (or bijection) from a set X to a set Y is a function
F: X → Y that is both one-to-one and onto.
each element of X with exactly one element of Y and each element of Y with exactly one
element of X . Such
اﻟﻣﺟﺎلaﻓﻲpairing
ة ﻟﻌﻧﺻرﯾنis
ﺻورcalled
او،ﻣﺟﺎلaﻲ اﻟ
one-to-one
س ﺻورة ﻟﻌﻧﺻر ﻓ ﺻر ﻓﻲ اﻟﻣﺟﺎل اﻟﻣﻘﺎﺑل ﻟﯾor
correspondence ﻋﻧbijection
ﻻ ﯾوﺟد and is
Example 7.2.8 A Function from a Power Set to a Set of Strings
illustrated by the arrow diagram in Figure 7.2.5. One-to-one correspondences are often
used asLet
aids to counting.
P({a, b}) be the The
set ofpairing
all subsetsof ofFigure 7.2.5,
{a, b} and for
let S be example,
the set of allshows
stringsthat there2 are
of length
made up of 0’s and
five elements in the set X . 1’s. Then P({a, b}) = {∅, {a}, {b}, {a, b}} and S = {00, 01, 10, 11}.
Define a function h from P({a, b}) to S as follows: Given any subset A of {a, b}, a is
either in A or not in A, and b is either in A or not in A. If a is in A, write a 1 in the first
X = domain of F Y = co-domain of F
position of the string h(A). If a is not in F A, write a 0 in the first position of the string
h(A). Similarly, if b is in A, write
a a 1 in the second position
1 of the string h(A). If b is not
b
in A, write a 0 in the second position 2 This definition is summarized in
of the string h(A).
the following table. c 3
d 4
e h 5
∅ not in not in 00
{a} in not in 10
• Definition {b} not in in 01
{a, b} in in 11
A one-to-one correspondence (or bijection) from a set X to a set Y is a function
F: X → Y that is both one-to-one and onto. 9
Is h a one-to-one correspondence?
Solution The arrow diagram shown in Figure 7.2.6 shows clearly that h is a one-to-one
xample 7.2.8 A Function from a Power
correspondence. It isSet
ontoto a Seteach
because of Strings
element of S has an arrow pointing to it. It is
one-to-one because each element of S has no more than one arrow pointing to it.
Let P({a, b}) be the set of all subsets of {a, b} and let S be the set of all strings of length 2
11/25/18
String-Reversing Function
Let T be the set of all finite strings of x’s and y’s. Define
g : T →T by the rule: For all strings s ∈ T ,
g(s) = the string obtained by writing the characters of s in reverse
order. E.g., g(“Ali”) = “ilA”
, 19
Func3ons
7.2 Properties of Functions
In this lecture:
qPart 1: One-to-one Functions
qPart 2: Onto Functions
qPart 3: one-to-one Correspondence Functions
qPart 4: Inverse Functions
qPart 5: Applications: Hash and Logarithmic Functions
, 20
10
Suppose F: X → Y is a one-to-one correspondence; that is, suppose F is one-to-one
and onto. Then there is a function F −1: Y → X that is defined as follows:
Given any element y in Y,
F −1 ( y) = that unique element x in X such that F(x) equals y.
11/25/18
In other words,
F −1 (y) = x ⇔ y = F(x).
The proof of Theorem 7.2.2 follows immediately from the definition of one-to-one
and onto. Given an element y in Y , there is an element x in X with F(x) = y because F
is onto; x is unique because FInverse Functions
is one-to-one.
Theorem 7.2.2
• Definition
Suppose F: X → Y is a one-to-one correspondence; that is, suppose F is one-to-
The function F −1 of Theorem 7.2.2 is called the inverse function for F.
one and onto. Then there is a function F-1: Y → X that is defined as follows:
Given any element y in Y,
Note Fthat
-1(y)according to this
= that unique definition,
element x in Xthe logarithmic
such function
that F(x) equals y. with base b > 0 is the
inverse of the exponential
In other words, function with base b.
The diagram that follows illustrates
F-1(y)=x the⇔facty=F(x).
that an inverse function sends each ele-
ment back to where it came from.
X = domain of F Y = co-domain of F
F
x = F –1( y) F(x) = y
F –1
Example 7.2.11 Finding an Inverse Function for a Function Given by an Arrow Diagram
è Is it always that the inverse of a function is a function?
Define the inverse function for the one-to-one correspondence h given in Example 7.2.8.
, 21
Solution The arrow diagram for h−1 is obtained by tracing the h-arrows back from S to
P({a, b}) as shown below.
({a, b}) S
h–1
∅ 00
–1 –1
{a}
{b} Finding Inversehh Func/ons
(00) = ∅ h (10) = {a}
10
01
(01) = {b} h (11) = {a, b} –1 –1
{a, b} 11 ■
The function f : R → R defined by the formula
f(x) = 4x−1
Example 7.2.12 Finding an Inverse Function for all realGiven
for a Function numbers x
in Words
Define the inverse function for the one-to-one correspondence g given in Example 7.2.9.
(was shown one-to-one and onto)
Solution The function g: T → T is defined by the rule
Find
For its inverse
all strings t in T ,function?
g(t) = the string obtained by writing the
characters of t in reverse order.
Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
w has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
, 22
11
11/25/18
Functions
7.2 Proper*es of Func*ons
In this lecture:
qPart 1: One-to-one Functions
qPart 2: Onto Functions
qPart 3: one-to-one Correspondence Functions
qPart 4: Inverse Functions
qPart 5: Applications: Hash and Logarithmic Functions
, 23
Hash Func,ons
, 24
12
Imagine a set of student records, each
number, and suppose the records are to
located if the social security number is k
record with social security number n int
security numbers have nine digits, this m
positions. The problem is that creating s
11/25/18
very wasteful of computer memory spac
larger to smaller sets of integers, frequen
of the solution to this problem. We illust
a very simple example.
Exponen)al and Logarithmic Func)ons Solution When you compute Hash you fin
occupied by the record with social secur
from position 2, you find that position 3 i
H ash
908-37-1011 −→
oc
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves th
, 26
13
When working with the exponential function, it is useful to recall the laws of expo-
When working
nents from elementary algebra. with the exponential function, it is useful to recall the laws of expo-
nents from elementary algebra.
Laws of Exponents
If b and c are any positive real numbers andLaws
u and of Exponents
v are any real numbers, the 11/25/18
following laws of exponents hold true:
If b and c are any positive real numbers and u and v are any real numbers, the
following laws of exponents bu +v true:
bu bv = hold 7.2.1
406 Chapter 7 Functions (bu )v = bu v 7.2.2
u bu bv = bu +v 7.2.1
b
= bu −v it (b
When working with the exponentialbfunction,
v is uuseful bu recall
)v = to v
the laws 7.2.3
of expo- 7.2.2
Relations
nents between
from elementary Exponential
algebra. u
(bc) = b c u and
u Logarithmic
b u Functions
7.2.4
= bu −v 7.2.3
Laws of Exponents b v
u
If In Section
b and 7.1any
c are the logarithmic function
positive real numbers baseu b(bc)
withand = bu cfor
wasvdefined
and are any
u
any positive
real numbers, num-
the
7.2.4
+
ber b ̸ = 1 to be the function from
following laws of exponents hold true:R to R with the property that for each positive real
number x,
bu bv = bu +v 7.2.1
In
logSection 7.1 the logarithmic
b (x) = the exponent to which
u v b ufunction
must withtobase
be raised was defined for any positive num-
b x.
obtain
(b
ber b ̸= 1 to be the function from ) = b v
R+real R withy,the property that
to number 7.2.2
for each positive real
Or, equivalently, for each positive real number
b u x and
number x, =b u −v
7.2.3
logb x = ybv ⇔ b y = x.
logb (x) = the (bc)exponent
u
bu cu to which b must be raised to obtain x.
It can be shown using calculus that both the=exponential and logarithmic functions7.2.4
are
one-to-one
Or,and onto. Therefore,
equivalently, forby definition
each of one-to-one,
positive real numberthe following properties
x and real holdy,
The exponential and logarithmic functions are one-to-one andnumber
onto.
true:
Thus the following
In Section properties
7.1 the logarithmic hold:
function with
logbase b was defined for
y any positive num-
+ b x = y ⇔ b = x.
b ̸=any
ber For 1 topositive
be thereal
function
number from R bto̸=R1,with the property that for each positive real
b with
number x,It can be shown using calculus that both the exponential and logarithmic functions are
if bu = bv then u = v for all real numbers u and v, 7.2.5
one-to-one
logb (x) =andtheonto. Therefore,
exponent to whichby definition
b must of one-to-one,
be raised to obtain x. the following properties hold
and true:
Or, equivalently, for each positive real number x and real number y,
if logb u = logb v then u = v for all positive real numbers u and v. 7.2.6
y 27
log x = y ⇔ b
For any, positive realb number b with b ̸= 1, = x.
ItThese
can be shown using calculus
properties are used if bthat
to derive =both
u many the exponential
bvadditional
then u= facts andexponents
v about
for alllogarithmic functions are
and logarithms.
real numbers u and v, 7.2.5
one-to-one and
In particular weonto.
haveTherefore,
the followingby definition
properties of
of one-to-one,
logarithms. the following properties hold
true: and
Theorem 7.2.1 Properties of Logarithms
For any positiveifreal b u = log
lognumber ̸= 1,u = v for all positive real numbers u and v.
b v bthen
b with 7.2.6
For any positive real numbers b, c and x with b ̸= 1 and c ̸= 1:
Relations between Exponential
if bu = bv then u = v for alland Logarithmic
real numbers u and v, Functions 7.2.5
and b (x y) =
a. logThese logb x + log
properties b yused to derive many additional facts about exponents and logarithms.
are
! "
We In particular
can x
if blogderive
wethen
have
additional the following
facts propertiesand
about exponents of logarithms.
logarithms, e.g.:
b. log bu == log
logb vx − logub y= v for all positive real numbers u and v. 7.2.6
y
Theorem
c. logb (x a
) = a logb7.2.1
x Properties of Logarithms
These properties are used to derive many additional facts about exponents and logarithms.
log
anyb xpositive c and x with b ̸= 1 and c ̸= 1:
d. logc xFor
In particular we
= have real properties
the following numbers of b,logarithms.
logb c
Theorem 7.2.1 Properties of Logarithms
a. log b (x y) = logb x + logb y
ForTheorem
any positive 7.2.1(d) real "
!isnumbers b, c and x with b ̸= 1 and c ̸= 1:
xproved in the next example. You are asked to prove the remainder
of the theorem b. logbin exercises = logatb the
33–35 x −end log ofbthisy section.
a. logb (x y) = logb x + logb y y
! c."log (x a ) = a log x
x b b
Copyright 2010 Cengage Learning. All Rights Reserved. May not b.be log
copied, = loginb whole
b scanned, or duplicated, x −or log y to electronic rights, some thirdHow
b Due
in part.
to prove this?
party content may be suppressed from the eBook and/or eChapter(s).
logCengage
Editorial review has deemed that any suppressed content does not materially affectythe overall learning experience.
b x Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
d. log x =
c
c. logb (x a ) = a logb x logb c
logb x
d. logc x =
logb c
Theorem
, 28prove the remainder
7.2.1(d) is proved in the next example. You are asked to
of the theorem in exercises 33–35 at the end of this section.
Theorem 7.2.1(d) is proved in the next example. You are asked to prove the remainder
of the theorem in exercises 33–35 at the end of this section.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
opyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
14
ditorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
7.2 One-to-One and Onto, Inverse Functions 407
Use the definition of logarithm, the laws of exponents, and the one-to-oneness of the
exponential function (property 7.2.5) to prove part (d) of Theorem 7.2.1: For any positive
real numbers b, c, and x, with b ̸ = 1 and c ̸ = 1, 7.2 One-to-One and Onto, Inverse Functions 407
Substituting (1′ ) into (2′ ) and using one of the laws of exponents gives
(logb c)(logc x) = logb x.
And dividing both sides by log c (which is nonzero because c ̸= 1) results in b
logb x
x = cv = (bu )v = bu v 29■
logc x = .
, logb c
by 7.2.2
Example 7.2.7 Computing Logarithms with Base 2 on a Calculator
But by (3), x = b also. Hence w In computer science it is often necessary to compute logarithms with base 2. Most calcu-
lators do not have keys to compute logarithms with base 2 but do have keys to compute
logarithms with base 10 (called common logarithms and often denoted simply log) and
bu v = bw ,
logarithms with base e (called natural logarithms and usually denoted ln). Suppose
your calculator shows that ln 5 ∼= 1.609437912 and ln 2 ∼= 0.6931471806. Use
Theorem 7.2.1(d) to find an approximate value for log2 5.
One-to-One Correspondences
u v = w.
Consider a function F: X → Y that is both one-to-one and onto. Given any element x in
Substituting from (1), (2), and (3)givengives
X , there that
is a unique corresponding element y = F(x) in Y (since F is a function). Also
any element y in Y , there is an element x in X such that F(x) = y (since F is onto)
and there is only one such x (since F is one-to-one). Thus, a function that is one-to-one
logb x
logc x = . ■
logb c