Week 3 Functions
Week 3 Functions
A
↳ B
•
: :#
→ if f associates set A with
y
C- B then
,
we write
1- In) f- maps
' '
y or n to
y
=
→
if f- is a function from A to B ,
we write
f- : A → B
→ we call it the domain off and B the codomain off
→
every
element of the domain has to be
mapped
somewhere in the codomain ( but not the other
way
around)
{ 1
,
2
,
3
}
1- : A → B where
f- (a) = 1
,
f- (b) = 1
,
f (c) =
2
A B
a.
C
:# ÷
•
or a
graph
B
n
2 •
I • •
> A
a b e
f- ( N ) = 6N + 28
(n ) ? if odd
{
2 n is
g.
=
.
3nF n + 1 ,
if n is even
→ function rule does not have to be a formula
I (E) = E 's left ear
Useful functions
the
largest integer that is ≤ x
e.
g L Ya J = 0
R→ real number
→
Ceiling function r 7 : 2-
assigns
to
any se
the smallest integer ≥ se
e.
g Mts 7 = I
L -
X J = - MT
n7 L N )
r
-
- =
function or
f has n
arguments
→ In this case , for each n -
tuple ( n , ,
- - -
, Mn ) C- Aix - - -
✗ An
,
1- ( M , ,
-
.
. .
, Nn)
denotes the value of fat ( x , ,
- . -
, Nn)
Same
↑
as
f- ( (N , ,
- -
.
Yn))
called
→
function with 2
arguments is a
binary function
we also have the option of writing f- In , g) = Z in the form
sefy = Z
→ A tuple can be
thought of as a function
e.
g the
5- tuple ( 22 14,55 700 ) can be,
defined by
1- ( O) = 22
,
Fl D= 14 , fl 2) =
55,1-1 3) = 1
,
f (4) = 700
→
similarly an infinite sequences can also be
thought of as a function
e-
g suppose (
b o ,
b,
,
. .
_
,
bn ,
. . .
) is an infinite sequence of
objects from a set S
Functions are
special Binary Relations
→
f : A - B { ( a. b) C- A ✗
B) f /a) b) =
→
Only true if :
1) for a
c- A there is some b EB with la b) being in the
every
relation
,
2) No two ordered
pairs in the relation have the same first
element .
Properties of Functions
→ A function f A B is called one to one ( injective
: → )
if it maps distinct elements of A to distinct elements of B
in A .
↳ the
range of
the function can be a
proper
subset of A
f- :B →
f- I a) b
'
F- (b) = a whenever =
by for all a C- A
id , (a) = a
→ let s be a set .
for every subset A ≤ s its characteristic
function fa :S →
{ 0,1 } is defined by for all NES , ,
if x EA
{
1
fn.tn/-- 0
.
if n¢A
,
→
Say if AIN then fa : N →
go it ,
can be represented by an
infinite 0-1 sequence .
→ e.
g factorial function
Basis : f- 101=1 and f 4) = 1
→
fibonacci function
Basis : f- 101--0 and f- 41--1
Recursive : if n> 1 then fcn) =
f- In 2) + f- In D
-
-
combining functions
→ let
g
: A → B and f :B → C be functions
the composition off and g is the function (fog) : A → C
defined by
4- g) (a) ◦ =
flag (a) ) for each a c- A
→
g
to
A B C
-
fog
→ We
only define composition fog when
codomain of g = domain of f
Properties of composition
→ Evenif both are defined fog and goof be different
,
can
let f and
g
be both E z functions defined by flat
→
,
-3
n'
and then
g (a)
= but 2
fog ( ) n = Cent 7-
6Mt 11
g. of (a)
=
→ f- ( gob)
◦ =
to g) oh
→
if f : A → B is a
bijection then
'
f- of = i da and f f ◦
"
= id
B
→
for any function f A → B :
,
f- ida i do f- f •
= •
always a
bijection between them
e -
N N bijection N countable
idn : →
is a
,
is
→ Not all sets are countable