Per4 function1

9
February 3, 2003 Applied Discrete Mathematics Week 2: Functions and Sequences 1 and the following and the following mathematical appetizer is mathematical appetizer is about… about… Functions Functions

Transcript of Per4 function1

Page 1: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

1

… … and the following mathematical and the following mathematical appetizer is about…appetizer is about…

FunctionsFunctions

Page 2: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

2

FunctionsFunctionsA A functionfunction f from a set A to a set B is an f from a set A to a set B is an assignmentassignment of exactly one element of B to each element of A.of exactly one element of B to each element of A.We writeWe writef(a) = bf(a) = bif b is the unique element of B assigned by the if b is the unique element of B assigned by the function f to the element a of A.function f to the element a of A.

If f is a function from A to B, we writeIf f is a function from A to B, we writef: Af: ABB(note: Here, “(note: Here, ““ has nothing to do with if… then)“ has nothing to do with if… then)

Page 3: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

3

FunctionsFunctions

If f:AIf f:AB, we say that A is the B, we say that A is the domaindomain of f and B is the of f and B is the codomaincodomain of f. of f.

If f(a) = b, we say that b is the If f(a) = b, we say that b is the imageimage of a and a is the of a and a is the pre-imagepre-image of b. of b.

The The rangerange of f:A of f:AB is the set of all images of B is the set of all images of elements of A.elements of A.

We say that f:AWe say that f:AB B mapsmaps A to B. A to B.

Page 4: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

4

FunctionsFunctions

Let us take a look at the function f:PLet us take a look at the function f:PC withC withP = {Linda, Max, Kathy, Peter}P = {Linda, Max, Kathy, Peter}C = {Boston, New York, Hong Kong, Moscow}C = {Boston, New York, Hong Kong, Moscow}

f(Linda) = Moscowf(Linda) = Moscowf(Max) = Bostonf(Max) = Bostonf(Kathy) = Hong Kongf(Kathy) = Hong Kongf(Peter) = New Yorkf(Peter) = New York

Here, the range of f is C.Here, the range of f is C.

Page 5: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

5

FunctionsFunctions

Let us re-specify f as follows:Let us re-specify f as follows:

f(Linda) = Moscowf(Linda) = Moscowf(Max) = Bostonf(Max) = Bostonf(Kathy) = Hong Kongf(Kathy) = Hong Kongf(Peter) = Bostonf(Peter) = Boston

Is f still a function?Is f still a function? yesyes

{Moscow, Boston, Hong Kong}{Moscow, Boston, Hong Kong}What is its range?What is its range?

Page 6: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

6

FunctionsFunctions

Other ways to represent f:Other ways to represent f:

xx f(x)f(x)

LindaLinda MoscowMoscow

MaxMax BostonBoston

KathyKathy Hong Hong KongKong

PeterPeter BostonBoston

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

Page 7: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

7

FunctionsFunctions

If the domain of our function f is large, it is If the domain of our function f is large, it is convenient to specify f with a convenient to specify f with a formulaformula, e.g.:, e.g.:

f:f:RRRR f(x) = 2xf(x) = 2x

This leads to:This leads to:f(1) = 2f(1) = 2f(3) = 6f(3) = 6f(-3) = -6f(-3) = -6……

Page 8: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

8

FunctionsFunctions

Let fLet f11 and f and f22 be functions from A to be functions from A to RR..Then the Then the sumsum and the and the productproduct of f of f11 and f and f22 are also are also functions from A to functions from A to RR defined by: defined by:(f(f11 + f + f22)(x) = f)(x) = f11(x) + f(x) + f22(x)(x)(f(f11ff22)(x) = f)(x) = f11(x) f(x) f22(x)(x)

Example:Example:ff11(x) = 3x, f(x) = 3x, f22(x) = x + 5(x) = x + 5(f(f11 + f + f22)(x) = f)(x) = f11(x) + f(x) + f22(x) = 3x + x + 5 = 4x + 5(x) = 3x + x + 5 = 4x + 5(f(f11ff22)(x) = f)(x) = f11(x) f(x) f22(x) = 3x (x + 5) = 3x(x) = 3x (x + 5) = 3x22 + 15x + 15x

Page 9: Per4 function1

February 3, 2003 Applied Discrete MathematicsWeek 2: Functions and Sequences

9

FunctionsFunctions

We already know that the We already know that the rangerange of a function f:A of a function f:AB B is the set of all images of elements ais the set of all images of elements aA.A.

If we only regard a If we only regard a subsetsubset S SA, the set of all images A, the set of all images of elements sof elements sS is called the S is called the imageimage of S. of S.

We denote the image of S by f(S):We denote the image of S by f(S):

f(S) = {f(s) | sf(S) = {f(s) | sS}S}