Functions
A function is a special type of relation. In particular, here are
the rules for a relation to be a function, for an arbitrary
relation R
A⁸ 䈠B
䙯爠敡捨c敬em敮琠楮ia
䄬Aw攠m畳u 桡v攠䕘A䍔CY 1 敬eme湴n
楮i删獵捨s瑨慴a i猠瑨攠晩牳琠瑥m f
桥h牤r牥搠灡楲i 䥮I䕮E汩獨
瑨慴m敡湳n景爠敡捨c敬em敮琠楮i瑨攠獥琠䄠楴iM啓吠䉅 牥污瑥搠瑯
數a捴汹湥汥me湴n楮i瑨整 B.
乯瑥瑨慴瑨楳mea湳nwe m畳琠桡v攠籁|
籂簮 呹灩捡l汹Ⱐw攠ca汬
瑨攠獥琠A⁴桥 浡楮湤⁴桥整 B 瑨攠捯
-
摯ma楮i
䥴I楳i灯獳楢汥i
瑨慴 a汬l映瑨攠灯獳楢汥 va汵敳l映昨a⤠⡷桥渠a
䄩A
景fm 湬n a 灲pp敲e獵扳整 映B⸠T桵猠瑨 獥s 映灯s獩扬攠va汵敳l
映瑨攠晵湣瑩潮Ⱐ桩捨慮攠m牥r景fma汬l⁷物瑴敮ea猠景汬潷猺
昨A⤠㴠{⡡⤠簠a
䄠素楳Ak湯w渠慳⁴桥慮h攠潦e瑨攠晵湣瑩潮n
H敲e猠慮
數amp汥映愠l畮捴楯u›
䱥琠Lh攠獥e⁁ =⁻⁴桥整h映w牤猠楮⁴桥⁅湧汩獨l湧畡g攠e
䙯爠F汬l
䄬A敦e湥⡡⤠a猠景汬sw猺
昨a⤠=⁴桥 m扥r映汥瑴敲猠 渠nh攠e牤r
周畳Ⱐw攠桡v攠瑨慴瑨 摯ma楮 楳i瑨攠獥琠f a汬l䕮E汩獨lw牤猬
瑨攠捯
-
摯ma楮i楳i桥h
獥琠映a汬l灯獩瑩s攠楮瑥来牳Ⱐa湤n桥h牡湧攠楳i
a汬l 灯獩瑩s攠 楮瑥来牳 汥獳 瑨a渠 29Ⱐ ⡡(獵s楮i 瑨慴
a湴楤楳敳瑡扬楳b浥湴m物r湩nm 楳i瑨 汯湧敳琠w牤r楮i桥h䕮E汩獨l
污湧畡g攩e
However, recall the relation I showed you
in an e
arlier
lecture
:
Cocktails = {(Orange Juice, V
odka), (Cranberry Juice, Vodka),
(Coke, Rum), (Orange Juice, Peach Schnapps) }
This is not a function because Orange Juice is related to more
than one element of the range.
Note that you can define functions on multiple sets, just as you
can defin
e relations on multiple sets. Consider the following:
f(a,b) = a+b.
This is a function of two real number variables. Notice that
different ordered pairs of this function map to the same
element in the domain. For example, f(2,3) = f(4,1).
We have alrea
dy talked about composing relations together.
Now we will introduce function composition.
Consider the following example, which uses the first function
from this lecture:
f(a) = the number of letters in the word a.
g(b) = the sum of the digits in the int
eger b.
Consider inputting the output from f(a) into the function g.
Pictorially, we get something like this:
Composing Functions produces a function
Let f: A
䈠a湤ng㨠䈠
䌠扥b瑷 晵湣瑩潮⸠ 周T cm灯獩瑩s渠
映映a湤ng a猠牥污瑩潮 摥晩湥猠a f
u湣瑩潮ng
映㨠䄠
䌬C獵捨s
瑨慴
f
a⤠=⡦⡡⤩(
坥W湥n搠瑯t獨sw 瑨慴t景爠敡捨 敬em敮琠a
䄬 瑨攠數灲敳p楯渠
⡯爠景fmu污⤠g⡦⡡⤩ a獳楧湳n瑨攠畮楱略u敬em敮琠映䌠牥污瑥搠瑯a
扡獥搠渠瑨攠捯m灯獩瑩s渠映映a湤ng 捯湳楤敲敤na猠牥污瑩潮⸠ 䉹
瑨攠摥晩湩
楯渠潦敬e瑩潮m灯獩瑩測
朠
映㴠{⡡Ⱐ挩c簠a
䄠
挠
䌠
†
(
戠
䈠簠⡡Ⱐ戩b
映
⡢( c⤠
g⥽.
Hw敶敲Ⱐ⡡Ⱐ戩b
映m敡湳n戠㴠映⡡⤠畳楮u 瑨攠晵湣f楯渠湯瑡瑩測n
a湤n⡢( c⤠
g mea湳n挠㴠g⡢( 批 桥h晵湣瑩潮湯瑡楯渮n 周畳,
瑨攠牥污瑩潮g
映捯湴
a楮猠灡楲猠 ⡡Ⱐ挩cw楴栠a
䄠a湤n挠
䌬C
獵捨s 瑨慴 挠 㴠 g⡢( 㴠 g⡦⡡⤩( 批 獵扳瑩u瑩潮⸠ 䙵牴桥hⰠ 瑨楳
敬em敮e 挠瑨慴楳 牥污瑥搠瑯敬emen琠a v楡 瑨攠捯m灯獥搠牥污瑩潮
朠
映楳i畮楱略㬠瑨畳Ⱐ瑨攠牥污瑩潮tg
映摥晩湥猠a 晵湣瑩潮tg
映:
䄠
䌮
䍯湳楤n
爠a渠數am灬p 晲fm ma瑨捬c獳⸠䱥琠昨x) 㴠x
3
and g(x) =
2x
–
1. We have the following function compositions :
f
g⡸⤠(
昨g⡸(⤠=⠲(
–
1) = (2x
–
1)
3
g
昨x⤠=
g(昨x)⤠=⡸
3
) = 2x
3
–
1
As can be seen from this example, typically, f(g(x))
g⡦⡸()
Injection, Surjection and Bijection
These definitions are often confusing, but I think some pictures
will help...
A function f is injective, or is one
-
to
-
one, if for all a, b
䄬Aa
戠
f⡡⤠
f⡢(. 䕱畩va汥湴汹Ⱐ瑨楳im敡湳n楦 昨a⤠㴠昨戩b桥渠a =
戮b 坥汳 y猠s渠楮n散瑩潮⁴桩猠捡獥s
映楳i獵牪散瑩癥Ⱐr 楳i湴漬n楦 昨䄩 㴠B⸠ 周T 楳Ⱐi映景f 敶敲礠戠
䈠
瑨敲 數楳瑳i a
䄠 獵捨 瑨琠 f⡡⤠ 㴠 b⸠ 坥W a汳l 獡y 映 楳i a
獵牪散s楯n渠瑨楳捡獥s
映楳i扩橥b瑩癥楦i楴ii猠扯瑨楮橥i瑩癥a湤n獵牪散
楶攮e W攠a汳l 獡y 映
楳楪散瑩潮渠瑨楳i獥s
䍯湳楤敲⁴n敳攠煵敳瑩e湳›
䥳 瑨攠晵湣f楯渠昨x⤠㴠x
2
injective, where the domain and co
-
domain are all real numbers?
Is the function f(x) = sin x surjective, where the co
-
domain is
the set of real numbers
in the interval [
-
1,1].
Is the function f(x) = x
3
a bijection?
Consider functions
f
:
A
B
and
g
:
B
C
, and the
composition
g
f
:
A
C
.
(a) If both f and g are injective, then g
映楳湪散瑩癥t
⡢(⁉映扯瑨湤牥畲r散瑩癥e⁴h敮e
映楳
牪r捴cv攮
⡣(⁉映扯瑨湤牥楪散瑩癥e⁴桥渠朠
映楳楪散瑩癥t
To prove g
映楳湪散n楶eⰠw攠湥敤e瑯⁰牯v攠e桡to爠aⰠ戠
䄬A
楦ig
映⡡⤠㴠朠
映(戩b瑨敮‽e戬b批 t桥敦i湩瑩潮f 橥捴楯渮†
g⡦⡡⤩‽ 昨戩)
卩湣攠g 楳i 楮橥捴iv攬e瑨t
琠m敡湳n景爠瑨敳攠瑷o 瑯t 扥 敱畡氬l we
m畳琠桡v攠e⡡⤠㴠f⡢(.
How敶敲Ⱐw攠a汳o k湯w 瑨慴t 映楳 楮橥i瑩癥Ⱐt桵猬ht桩猠im灬楥猠
瑨慴t戮
Inverse Functions
A bijection
f
:
A
䈠
m
a灳p 敡c栠 敬em敮琠 映
䄠
a 畮楱略u
敬em敮琠f
B
Ⱐan搠捯湶敲獥汹Ⱐ敡c栠敬em敮琠映
䈠
ha猠a 畮楱略u
敬em敮e 映
A
a猠楴猠灲p
-
imag攮 周T 景汬fw楮g 瑨敯牥m ma步猠a
灲散楳攠獴p瑥m敮琠映瑨楳敬e瑩潮桩瀮
䱥琠
f
㨠
䄠
B
扥 a 扩橥捴楯n⸠ 周敮e瑨攠
i湶敲獥e牥污瑩潮
潦
f
Ⱐ
摥晩湥搠晲fm
B
瑯
䄠
a猠{(
b
Ⱐ
a
⤠簠
b
䈠
a湤n
a
A
Ⱐa湤n
f
(
a
⤠㴠
b
}Ⱐ
楳ia 晵湣f楯渠晲潭
B
瑯
A
獵捨s瑨慴
朠
f
(
a
⤠㴠
a
景爠a汬l
a
A
Ⱐ
a湤n
映
g
(
b
⤠=
b
景爠a汬l
b
B
⸠ 周攠晵f捴楯渠
g
楳 捡汬敤l瑨
楮i敲獥畮捴楯c
映
f
,敮潴敤e
f
–
1
.
Note that since
f
:
A
B
楳ia 扩橥捴楯測c景爠敡捨c
b
䈠
瑨敲攠
數楳瑳i湥na湤n湬n 湥n敬em敮琠
a
A
Ⱐ獵捨s瑨慴
f
(
a
⤠㴠
b
⸠.
周畳Ⱐ瑨攠r敬e瑩潮晲fm
B
瑯
A
Ⱐre污瑩湧
b
䈠
瑯楴猠灲p
-
imag攠
a
A
畮摥爠
f
,
楳ia 晵湣f楯渠批 瑨攠摥晩湩楯渠映晵fc瑩潮⸠ 周T琠
楳Ⱐi攠桡e攠摥e楮i搠愠晵湣
瑩潮
g
:
B
A
獵捨c瑨a琠景爠
b
B
Ⱐ
g
(
b
) 㴠
愠
楦i
f
(
a
⤠㴠
b
朠
f
(
a
⤠=
g
(
f
(
a
⤩,
††† † †
=⡢
††
㴠
a
.
映
g
(
b
⤠㴠
f
(
g
(
b
⤩
††† † †
=⡡)
††
=
⸠
Let
f
:
A
B
a湤
g
㨠
䈠
A
扥b瑷 晵湣瑩潮⸠ 䥦
朠
f
(
a
⤠=
a
景爠
a汬l
a
A
Ⱐa湤n
映
g
(
b
⤠㴠
b
景爠a汬l
b
B
Ⱐ瑨敮扯瑨
f
a湤n
g
a牥
扩橥捴楯湳n a湤n瑨敹 a牥r楮i敲獥e晵湣瑩潮n 映敡捨c桥爬h桡琠楳,
g
㴠
f
–
1
and
f
=
g
–
1
.
First, we will show that if
g
f
(
a
⤠=
a
Ⱐ景爠f汬l
a
A
†
a湤†
映
g
(
b
⤠
㴠
b
Ⱐ景爠f汬l
b
䈬B
瑨敮
f
楳 橥j瑩潮湤n
g
㴠
f
–
1
We first prove that
f
is an injection. That is, suppose
f
(
a
) =
f
(
a
’), for
a
,
a
’
A
, we want to prove that
a
=
a
’.
Using function
g,
g
(
f
(
a
)) =
g
(
f
(
a’
)), because
g
is a function.
Thus,
a
=
a
’ because
g
(
f
(
a
)) =
a
and
g
(
f
(
a’
)) =
a
’.
We then prov
e that
f
is a surjection; that is, we prove that for
each
b
B
Ⱐ瑨敲 數楳瑳i
a
A
獵捨s瑨慴
f
(
a
⤠=
b
⸠
Let
a
=
g
(
b
). Then,
f
(
a
) =
f
(
g
(
b
)) =
b
.
We now prove that
g
=
f
–
1
. Consider an arbitrary
a
A
⸠ If
f
(
a
⤠ 㴠
戠
B
Ⱐ 瑨敮 a捣潲摩湧 瑯 ⠱⤬(
g
(
b
⤠ 㴠
g
(
f
(
a
)⤠ 㴠
a
⸠.
䍯湶敲獥汹Ⱐ景爠 a渠 a牢楴牡特
b
B
Ⱐ楦i
g
(
b
⤠㴠
a
Ⱐ桥渠
f
(
a
⤠=
f
(
g
(
b
)⤠㴠
b
⸠ 周畳, 瑨楳 im灬楥猠瑨慴
g
(
b
⤠㴠
愠
i晦
f
(
a
⤠=
b
㬠桵猬h
g
㴠
f
–
1
.
By the symmetry between
f
and
g
, we can similarly prove
that
g
is a bijection and
f
=
g
–
1
. Thus, the theorem is proved.
When two functions
f
:
A
B
an搠
g
㨠
䈠
A
a牥r楮i敲獥猠f
敡捨c瑨敲 w攠hav攠瑨攠牥污瑩潮桩瀠
朠
f
(
a
⤠㴠
a
景爠a汬l
a
A
Ⱐ
爬r 敱畩ea汥湴汹l
朠
f
㴠
I
A
, where
I
A
denotes the
identity
function
defined on
A
(i.e.,
I
A
(
a
) =
a
for all
a
A
⤮ 卩m楬i牬rⰠ
w攠桡e攠
映
g‽
I
B
, the
identity function
defined on
B
.
Computing the inverse of a mathematical function
There is a simple way to c
ompute inverses of mathematical
functions. Whenever you have
a function such as
y = f(x) = 2x + 1,
Place an x where ever you see a y, and a y where ever you see a
x. Then, solve for y as follows:
y = 2x + 1
Inverse function is
x = 2y + 1
2y = x
–
1
y = (x
–
1)/2.
Computing the inverse of a function composition
If
f
:
A
B
and
g
:
B
C
are two bijections.
Then (
g
f
)
–
1
=
f
–
1
g
–
1
.
Since both
f
and
g
are bijections,
g
f
is also a bijection and its
inverse exists. To prove (
g
f
)
–
1
=
f
–
1
g
–
1
, it suffices to prove
that
(
g
f
)
(
f
–
1
g
–
1
) =
I
C
and (
f
–
1
g
–
1
)
(
g
f
) =
I
A
(
g
f
)
(
f
–
1
g
–
1
) = ((
g
f
)
f
–
1
)
g
–
1
,
= (
g
(
f
f
–
1
))
g
–
1
, associative
= (
g
I
B
)
g
–
1
=
g
g
–
1
, defn. of identity
=
I
C
,
Let f(x) = 2x+1 and g(x)=3x+4 and the domains and ranges for
both function are the real numbers. So,
we can compute
f
–
1
(x) = (x
–
1)/2
g
–
1
(x) = (x
–
4)/3
If we want to find (
g
f
)
-
1
, we can compute it as f
-
1
g
–
1
(x) =
f
-
1
(g
–
1
(x)) = f
-
1
((x
–
4)/3) = ((x
–
4)/3
–
1)/2
= (x
–
4)/6
–
3/6
= (x
–
7)/6
If
A
and
B
are two finite
sets, we can make the following
claims:
If there is a injection
f
:
A
B
, then |
A
|
|
B
|
If there is a surjection
g
:
A
B
, then |
A
|
|
B
|
If there is a bijection
h
:
A
B
, then |
A
| = |
B
|.
If
f
:
A
B
is an injection, and if we enumerate the elements o
f
A
as
A
= {
a
1
,
a
2
, …,
a
n
}, where
n
= |
A
|, then the images
f
(
a
1
),
f
(
a
2
), …,
f
(
a
n
), are mutually distinct because
f
is one
-
to
-
one.
Thus, |
B
|
n
because
B
contains these
n
elements.
Similarly, if
g
:
A
B
is a surjection, and if we enumerate the
eleme
nts of
B
as
B
= {
b
1
,
b
2
, …,
b
m
}, then
A
must contain the
pre
-
images of the elements of
B
. Suppose we use the notations
a
1
,
a
2
, …,
a
m
to denote, respectively, the pre
-
images of
b
1
,
b
2
, …,
b
m
;
thus,
g
(
a
i
) =
b
i
for 1
i
m
. Since
g
is a function, the
ele
ments
a
1
,
a
2
, …,
a
m
must be mutually distinct (i.e., if
a
i
=
a
j
for some
i
j
, then
b
i
=
g(
a
i
)
=
g(
a
j
)
= b
j
, a contradiction).
Therefore, |
A
|
m
= |
B
|.
Enter the password to open this PDF file:
File name:
-
File size:
-
Title:
-
Author:
-
Subject:
-
Keywords:
-
Creation Date:
-
Modification Date:
-
Creator:
-
PDF Producer:
-
PDF Version:
-
Page Count:
-
Preparing document for printing…
0%
Σχόλια 0
Συνδεθείτε για να κοινοποιήσετε σχόλιο