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 x B : For each element in a A, we must have EXACTLY 1 element in R such that a is the first term of the ordered pair. In English

Ηλεκτρονική - Συσκευές

10 Οκτ 2013 (πριν από 4 χρόνια και 9 μήνες)

174 εμφανίσεις

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楳i灯獳楢汥i

䄩A

映瑨攠晵湣瑩潮Ⱐ桩捨⁣慮⁢攠m牥r景fma汬l⁷物瑴敮ea猠景汬潷猺

䄠素楳Ak湯w渠慳⁴桥⁲慮h攠潦e瑨攠晵湣瑩潮n

H敲e⁩猠慮

䱥琠Lh攠獥e⁁ =⁻⁴桥⁳整h映w牤猠楮⁴桥⁅湧汩獨⁬l湧畡g攠e

䙯爠F汬⁡l

䄬A敦e湥⁦⡡⤠a猠景汬sw猺

-

a汬l 灯獩瑩s攠 楮瑥来牳 汥獳 瑨a渠 29Ⱐ ⡡(獵s楮i 瑨慴
a湴楤楳敳瑡扬楳b浥湴m物r湩nm 楳i瑨 汯湧敳琠w牤r楮i桥h䕮E汩獨l

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 cm灯獩瑩s渠
映映a湤ng a猠牥污瑩潮 摥晩湥猠a f
u湣瑩潮ng

䌬C獵捨s

f a⤠=⁧⡦⡡⤩(

䄬 瑨攠數灲敳p楯渠
⡯爠景fmu污⤠g⡦⡡⤩ a獳楧湳n瑨攠畮楱略u敬em敮琠映䌠牥污瑥搠瑯a

楯渠潦⁲敬e瑩潮⁣m灯獩瑩測

(

䈠簠⡡Ⱐ戩b

⡢( c⤠

g⥽.

Hw敶敲Ⱐ⡡Ⱐ戩b

a湤n⡢( c⤠

g mea湳n挠㴠g⡢( 批 桥h晵湣瑩潮湯瑡楯渮n 周畳,

a楮猠灡楲猠 ⡡Ⱐ挩cw楴栠a

䄠a湤n挠

䌬C

䍯湳楤n

3

and g(x) =
2x

1. We have the following function compositions :

f

g⡸⤠(

1) = (2x

1)
3

g

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 =

䄠 獵捨 瑨琠 f⡡⤠ 㴠 b⸠ 坥W a汳l 獡y 映 楳i a

䍯湳楤敲⁴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

⡢(⁉映扯瑨⁦⁡湤⁧⁡牥⁳畲r散瑩癥e⁴h敮⁧e

⡣(⁉映扯瑨⁦⁡湤⁧⁡牥⁢楪散瑩癥e⁴桥渠朠

To prove g

䄬A

g⡦⡡⤩‽⁧ 昨戩)

m畳琠桡v攠e⡡⤠㴠f⡢(.

How敶敲Ⱐw攠a汳o k湯w 瑨慴t 映楳 楮橥i瑩癥Ⱐt桵猬ht桩猠im灬楥猠

Inverse Functions

A bijection
f
:
A

m
a灳p 敡c栠 敬em敮琠 映

 a 畮楱略u

B
Ⱐan搠捯湶敲獥汹Ⱐ敡c栠敬em敮琠映

ha猠a 畮楱略u

A

a猠楴猠灲p
-
imag攮 周T 景汬fw楮g 瑨敯牥m ma步猠a

䱥琠
f

B

i湶敲獥e牥污瑩潮

f

B

a猠{(
b

a
⤠簠
b

a湤n
a

A
Ⱐa湤n
f

(
a
⤠㴠
b
}Ⱐ

B

A

f
(
a
⤠㴠
a

a

A

a湤n

g
(
b
⤠=
b

b

B
⸠ 周攠晵f捴楯渠
g

映
f
,⁤敮潴敤e
f

1
.

Note that since
f
:
A

B

b

a

A
Ⱐ獵捨s瑨慴
f

(
a
⤠㴠
b
⸠.

B

A
Ⱐre污瑩湧
b

-
imag攠
a

A

f
,

g
:
B

A

b

B

g
(
b
) 㴠

f

(
a
⤠㴠
b

f

(
a
⤠=
g
(
f
(
a
⤩,

††† † †
=⁧⡢

††

a
.

g
(
b
⤠㴠
f
(
g
(
b

††† † †
=⁦⡡)

††
=⁢

Let
f
:
A

B

a湤
g

A

f
(
a
⤠=
a

a汬l
a

A
Ⱐa湤n

g
(
b
⤠㴠
b

b

B
Ⱐ瑨敮扯瑨
f

a湤n
g

a牥

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

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

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

f
(
a
⤠㴠
a

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