Title: Lecture 14 Functions
1Lecture 14 Functions
2What is a function?
- Functions are a special case of binary relations
from a set S to a set T. - The idea of associating an element from one set
with an element (or elements) from another is a
fundamental one in mathematics.
3Function-Definition
- A function from A to B is a mapping from one set
(the domain of the function) to another (the
codomain of the function), where each element of
the domain is mapped to one element of the range.
4Function-Definition
- The critical idea is that a function maps each
element in its domain to a unique element in its
range. -
- Example Exercise 6( Page 313)
- There are three parts to a function
- A set of starting values (S)
- A set from which associated values come (T)
- The association itself.
5Function-Definition
- The association is a set of ordered pairs, each
of the form (s, t) where s ? S, t ? T, ant t is
the value from T that the function associates
with the value s from S. - f S ? T
- t f(s), t is the image of s under f, s is a
preimage of t under f - The association is a subset of S ? T.
6Function-- Reminder
- A function is a special kind of binary relation.
- A binary relation that is one-to-many (or
many-to-many) cannot be a function. - We can have functions with more than one
variable, for example - f S1 ? S2 ? ? Sn ? T
- Associates with each ordered n-tuple of elements
(s1,s2,,sn) - si ? Si, a unique element of T.
7Function-- Examples
- From R to Z
- Floor function
- Ceiling function
- From Z to Z
- Modulo function
8Function- Equal
- Two functions are equal if they have the same
domain, the same codomain, and the same
association of values of the codomain with values
of the domain. - So, f S ? T means
- ?s ? S ?1 t ? T such that f(s) t
9Onto functions
- Every member of S has an image under f, and all
the images are members of T the set R of all
such images is called the range of the function
f. - Thus, R f(s) s ? S, R ? T
- If it should happen that R T, then the function
is called an onto function.
10Onto functions (cont.)
- Definition
- A function f S ? T is an onto, or surjective,
function if the range of f equals the codomain of
f. - ?t ? T ? s ? S such that f(s) t
- Example
- A a, b, c, d B x, y, z
- f A?B is defined as
- f (a) x f (b) y f (c) z f (d) z
- so f is onto
11Onto Function--more examples
- f Z?Z, f(x) x2, f is not onto because theres
no negative numbers on the range of f. - f Q?Q, f(x) 3x 2. f is onto
- f Z?Q, f(x) 3x 2. f is not onto
12One to One Function
- Definition
- A function f S ? T is one-to-one, or injective,
if no member of T is the image under f of two
distinct elements of S. - Different objects in the domain have different
images on the codomain. - a ? a ? f(a) ? f(a) or f(a) f(a) ? a a
- Example
- 1. f Z ? Z, f(x) x2, is not injective f(2)
f(-2) 22 4 - 2. f Z ? Z, f(x) x3, is injective a ? b ? a3
? b3
13Bijective Function
- Definition
- A function f S ? T is bijective (a bijection) if
it is both one-to-one and onto. - 1. ( f(a) f(a)) ? (a a)
- 2. y ? B ? x ? A ? f(x) y
14 Function More example
Not a function
Not a function
Function, not one-to-one, not onto
Function, not one-to-one, onto
Function, one-to-one, not onto
Function, one-to-one, onto
15Composition of Functions
- Definition
- Let f S?T and g T?U. Then the composition
function g ? f, is a function from S to U defined
by - (g ? f) (s) g( f(s) )
16Composition of Functions (cont.)
- It is not always possible to take two arbitrary
functions and compose them the domain and ranges
have to be compatible. - Function composition preserves the properties of
being onto and being one-to-one. - The composition of two bijections is a bijection.
17Composition--Examples
- f Z?Z, f (x) 3x-1
- g Z?Z, g (x) 2x2
- What is the value of (gof)(4)
- b. What is the value of (fog)(4)
-
18Inverse Functions
- Sa, b T7,4
- Lets consider the function f A?B
- Such that f(a)4 and f(b)4, so f(a,4),(b,4)
- Lets consider (f-1,B,A) such that f(4)a and
f(4) b we can see that f-1 is not a function
since an element of the domain has two different
images. - The necessary and sufficient condition for a
function to have an inverse is that the function
must be a bijection.
19Inverse function--Identity
- Let f S?T be a bijection. Every t ? T has a
unique preimage s ? S, so each member of the
codomain has an association with a unique member
of the domain. - This associations induce a function g T?S
- We can define a function that maps each element
of a set S to itself, so it leaves the element of
S unchanged. This function is denoted by is. (g ?
f is) - The same thing happens with T, f ? g ig
20Inverse function-- Definition
- Definition
- Let f be a function, f S?T. If there exists a
function g T?S such that g ? f is and f ? g
iT. Then g is called the inverse function of f,
denoted by f-1. - Theorem
- Let f S?T. Then f is a bijection if and only
if f-1 exists. - f(x) y , f-1(y) x
21Inverse function-- Example
- The inverse of a function f is another function,
denoted by f-1, such that f-1(f(x)) x for all x
in the domain of f. - Examples
- f R?R given by f(x)3x4 is a bijection. What
is f -1
22Permutation Functions
- Definition (Permutation of a Set)
- For a given set A, SA f f A?A and f is a
biyection - SA is thus the set all bijections of set A into
(and therefore onto) itself such functions are
called permutations of A. - Function composition is a binary operation on
the set SA. - Permutation functions represent ordered
arrangements of the - objects in the domain.
23Permutation Functions(cont.)
- Example
- Where the domain is A 1, 2, 3, 4. The
function f could be written as f (1,2),
(2,3), (3,1), (4,4). - If f and g are members of SA for some set A, then
g ? f ? SA, and the action of g ? f on any member
of A is determined by applying function f and
then function g.
Cycle notation
24Permutation Functions(cont.)
- If f and g are members of SA, and f and g are
disjoint cycles then - f ? g g ? f.
- Examples
- A1,2,3,4,5
- f (5,2,3) g (3,4,1)
- f (1,3) g (2,5)
The cycles have no elements in common
25Permutation Functions(cont.)
- The permutation that maps each element of A to
itself is the identity function on A, iA, also
called the identity permutation. - A 1,2,3,4,5, f ? SA given by f (1,2), f ?
f ? - Every permutation on a finite set that is not the
identity permutation can be written as
composition of one or more disjoint cycles.
26Order of magnitude
- Definition (Order of Magnitude)
- Let f and g be functions mapping nonnegative
reals into nonnegative reals. Then f is the same
order of magnitude as g, written f O(g), if
there exist positive constants n0, c1, c2 such
that for x ? n0, c1g(x) ? f(x) ? c2g(x)
27Exercise