close

Вход

Забыли?

вход по аккаунту

?

sec3.1

код для вставкиСкачать
6/13/2016
Chapter 3: Functions, Sequences,
and Relations
Section 3.1: Functions
ALL 1-12, 16-50 from section 3.1 in the textbook are
relevant
Function
In Calculus, functions are usually given by a formula:
f (x) = x+3, or
g(x) = x2
where x is any real number.
In discrete math, functions are not necessarily defined over the real
numbers.
Example:
f (x) = 1 if x is odd, and 0 if x is even is a function.
It takes as input any integer number only, and the output is either 0
or 1.
So, in addition to specifying the formula, we need to define the set
of elements which are acceptable as inputs, and the set of
elements into which the function outputs.
1
6/13/2016
Functions
Let A and B be sets. Recall that
The Cartesian product, denoted by AxB, is the set
AxB = { (a,b) | a  A, b  B}
Definition. A function f from A to B is a subset of AxB with the property,
for every a  A, there exists exactly one b  B such that (a,b)  f.
Example. The set A={x,y,z}, B ={-1,0,2}. Then
(1).
f  {( x, 0), ( y , 1), ( z , 2)} is a function from A to B.
(2). Is g  {( x, 0), ( y , 1), ( z , 0)} a function from A to B?
(3). Is l  {( x, 0), ( y , 1), ( x, 2), ( z , 2)} a function from A to B?
(4). Is h  {( x, 0), ( z , 2)} a function from A to B?
Properties of Functions
Let A and B be two sets. A function f from A to B, usually denoted f : A → B,
is an assignment of exactly one element of B to each element of A.
1. We write f(a) = b to denote the assignment of b to an element a of A by the
function f.
2. The domain of f, written dom(f), is the set A.
3. The target of f (codomain) is the set B.
4. The range (image) of f, written rag(f), is
rag(f) = {b  B | (a,b)  f, for some a  A}
= {b  B | b=f(a), for some a  A}
5. The function f is called onto (surjective) if rag(f)=B. That is,
every b  B is of the form b=f(a) for some a  A .
6. The function f is called one-to-one (1-1, or injective) if different
elements in A have different images in B. That is,
if a1  a2 , then f ( a1 )  f ( a2 ).
Or, if f ( a1 )  f ( a2 ), then a1  a2 .
7. The function f is called bijective if it is both injective and surjective.
That is, both 1-1 and onto.
2
6/13/2016
Examples
Example. The set A={1,2,3}, B ={x,y,z,w}. Then
(1).
f  {(1, x ), (2, z ), (3, w)} is a function.
The domain of f is dom(f)={1,2,3}. The rag(f) ={x,z,w}.
f is 1-1 but NOT onto.
(2). Let g : Z  Z be defined by g ( x )  2 x  7. Is g a function?
dom ( g )  Z , and rag ( g )  odd integers only, why?
g is 1-1 but NOT onto.
(3). Let h : Z  Z be defined by h ( x )  2 x 2  4 x. Is h a function?
h is NOT 1-1 and is NOT onto.... WHY?
(4). Let m :{ people}  { people} be defined by m ( x )  the mother of x.
Is m a function?
What is the dom(m)? rag (m)?
Is m 1-1?
Is m onto?
Functions over the Real
(1). Let g : R  R be defined by g ( x )  2 x  7.
dom ( g )  rag ( g )  R , why?
The graph of g is a line in the xy -plane!
(2). Let h : R  R be defined by h ( x )  2 x 2  4 x. Is h a function?
It is easy to see from the graph of this function that
f is NOT 1-1 and is NOT onto.
(3). Let h :[1,  )  [ 2,  ) be defined by h ( x )  2 x 2  4 x. Is h a function?
It is easy to see from the graph of this function that
f is 1-1 and onto, and hence f is bijective!
(4). Let f : R  R be defined by f ( x )  x . Is h a function?
dom ( f )  R , and rag ( f )  [0,  ), why?
f is NOT 1-1, and NOT onto either.
3
6/13/2016
Ceiling and Floor Functions
(1). The floor of a real number x, denoteded by  x  ,
is the greatest intger less than or equal to x.
That is, x  1   x   x.
Notice that,   : R  Z.
Example. 1.76   1.
Example.  1.76   2.
(2). The ceiling of a real number x, denoteded by  x  ,
is the least intger greater than or equal to x.
That is, x   x   x  1.
Notice that,   : R  Z.
Example. 1.76   2.
Example.  1.76   1.
MOD function
Definition. If x is an integer and y is a positive intger, we define
x mod y to be the remainder when x is divided by y.
Example. 8 mod 2 = 0
Example. 5 mod 3  2
Example. 15 mod1  0
Example. 3 mod 5  3
Remark. For any natural number n,
f ( x )  x mod n is a function from Z to {0,1, 2,..., n -1}
Is mod n one-to-one? No, for example, f ( n)  f (2 n )  0.
Is mod n onto?
Yes, for any integer m between 0 and n  1, we have f ( m )  m
4
6/13/2016
Universal Product Codes
Each product has a code called the Universal
Product Code (UPS) or Barcode. Check out
wikipedia for more info:
http://en.wikipedia.org/wiki/Barcode
Here we focus on 1-dim codes such
as
However, there are 2-dim barcodes such as the
one on the right but we will not deal with them
here.
Universal Product Codes
The codes we will discuss here consist of 12 digits, for example
“6 71860 0 1362 4”.
As it is not unusual for a scanner to misread a bar code, the last digit is
a check digit that serves to affirm the accuracy of the other 11 digits.
The check digit is determined by the rule:
3(sum of digits in odd positions)+(sum of digits in even positions)
mod 10 = 0.
Example. The bar code from the previous slide:
3(6+1+6+0+3+2)+(7+8+0+1+6+4)=3(18)+26=80.
It is clear that 80 mod 10 = 0.
Example. Find the check digit for the UPC whose first 11 digits are
2-52503-12345
Exercise. Do 53 at page 151
Remark. The same technique is used in the ISBN for books.
5
6/13/2016
Inverse
Let f be a bijective function from A to B.
Then, for every b  B , there exists (because f is onto)
exactly one (because f is 1-1) a  A such that b  f ( a ).
Thus {(b, a ) ( a , b )  f } is a function from B to A.
This function is called the inverse of f , and denoted by f 1 .
Example. Let A  {1, 2,3} and B  {x, y, z}.
(1). Let f  {(1, x), (2, y ), (3, z )}. Then
f 1  {( x,1), ( y, 2), ( z,3)},
and
( f 1 ) 1  {(1, x), (2, y ), (3, z )}  f .
(2). Consider the function g  {(1, x ), (2, y ), (3, x )} from A to B.
If exists, what is g 1 ?
When does f has an inverse?
Theorem. A function f : A → B has an inverse iff f is 1-1 and onto.
In this case, a  f 1 (b ) if and only if f ( a )  b.
6
6/13/2016
f is not 1-1
f is not onto
7
6/13/2016
Examples
(1). Let h : R  R given by h ( x )  2 x  1.
Is h a function? Is h 1-1? Is h onto?
If exists, find the inverse of h?
To find the inverse, recall that,
y  h( x ) if and only if x  h 1 ( y ).
y  h( x )  2 x  1  2 x  y  1
y 1
 x
2
h 1 ( y ) 
y 1
2
Examples
(2). Let g : ( , 0]  [0,  ) given by g ( x )  x 2 .
Is g a function? Is g 1-1? Is g onto?
If exists, find the inverse of g?
To find the inverse, recall that,
y  g ( x ) if and only if x  g 1 ( y ).
y  g ( x)  x 2  y  x 2
 x y
g 1 ( y )   y ...... WHY?
8
6/13/2016
Examples
(3). Let f : R \ {1}  R \ {1} given by f ( x ) 
x
. Is f a function?
x 1
Is f 1-1?
Is f onto?
Suppose f ( a )  f (b), that is,
Let r  R \ {1}, is there an x  R \ {1}
a
b

a 1 b 1
such that
a (b  1)  b ( a  1)
If
ab  a  ab  b
ab
x
 r?
x 1
x
 r , then x  r ( x -1).
x 1
Thus rx  x  r , or x 
r
r 1
Thus f is 1-1 and onto.
Examples
(3 cont). Let f : R \ {1}  R \ {1} given by f ( x ) 
To find the inverse, recall that
x
. Find f 1.
x 1
y  f ( x ) if and only if x  f 1 ( y ).
y
x
 y ( x  1)  x
x 1

yx  y  x

yx  x  y
y

x
y 1
Therefore, f 1 ( y ) 
y
y 1
Notice that f 1  f
9
6/13/2016
Composition of Functions
Conside the functions f : A  B and g : B  C .
The composition of g and f is the function g  f : A  C
given by, for every a  A,
( g  f )( a )  g ( f ( a )).
Example. Let A  {1, 2,3} and B  {x, y, z}, and C  {m, n}.
If f : A  B and g : B  C are given by
f  {(1, x), (2, y ), (3, z )}, and g  {( x, n), ( y, m), ( z, n)}.
Then g  f : A  C is
{(1, n), (2, m), (3, n)}
gof = fog ?
If f : A  B and g : B  A. Then
f  g : B  B while g  f : A  A
Example. Let A  {1, 2,3} and B  {m, n}.
If f : A  B and g : B  A are given by
f  {(1, n), (2, m), (3, n)}, and g  {(m,1), (n,3)}.
Then g  f : A  A is
{(1,3), (2,1), (3,3)}
And f  g : B  B is
{(m, n), (n, n)}
Fact. f  f 1  f 1  f  id
10
Документ
Категория
Без категории
Просмотров
0
Размер файла
178 Кб
Теги
sec3
1/--страниц
Пожаловаться на содержимое документа