22
Functions Functions Let us look at the following well-known function: Let us look at the following well-known function: f(Linda) = Moscow f(Linda) = Moscow f(Max) = Boston f(Max) = Boston f(Kathy) = Hong Kong f(Kathy) = Hong Kong f(Peter) = Boston f(Peter) = Boston What is the image of S = {Linda, Max} ? What is the image of S = {Linda, Max} ? f(S) = {Moscow, Boston} f(S) = {Moscow, Boston} What is the image of S = {Max, Peter} ? What is the image of S = {Max, Peter} ? f(S) = {Boston} f(S) = {Boston}

Per4 function2

Embed Size (px)

Citation preview

FunctionsFunctions

Let us look at the following well-known function:Let us look at the following well-known function:

f(Linda) = Moscowf(Linda) = Moscow

f(Max) = Bostonf(Max) = Boston

f(Kathy) = Hong Kongf(Kathy) = Hong Kong

f(Peter) = Bostonf(Peter) = Boston

What is the image of S = {Linda, Max} ?What is the image of S = {Linda, Max} ?

f(S) = {Moscow, Boston}f(S) = {Moscow, Boston}

What is the image of S = {Max, Peter} ?What is the image of S = {Max, Peter} ?

f(S) = {Boston}f(S) = {Boston}

Properties of FunctionsProperties of Functions

A function f:AA function f:A→→B is said to be B is said to be one-to-oneone-to-one (or (or injectiveinjective), if and only if), if and only if

∀∀x, yx, y∈∈A (f(x) = f(y) A (f(x) = f(y) →→ x = y) x = y)

In other words:In other words: f is one-to-one if and only if it does f is one-to-one if and only if it does not map two distinct elements of A onto the same not map two distinct elements of A onto the same element of B.element of B.

Properties of FunctionsProperties of Functions

And again…And again…

f(Linda) = Moscowf(Linda) = Moscow

f(Max) = Bostonf(Max) = Boston

f(Kathy) = Hong Kongf(Kathy) = Hong Kong

f(Peter) = Bostonf(Peter) = Boston

Is f one-to-one?Is f one-to-one?

No, Max and Peter are No, Max and Peter are mapped onto the same mapped onto the same element of the image.element of the image.

g(Linda) = Moscowg(Linda) = Moscow

g(Max) = Bostong(Max) = Boston

g(Kathy) = Hong Kongg(Kathy) = Hong Kong

g(Peter) = New Yorkg(Peter) = New York

Is g one-to-one?Is g one-to-one?

Yes, each element is Yes, each element is assigned a unique assigned a unique element of the image.element of the image.

Properties of FunctionsProperties of Functions

How can we prove that a function f is one-to-one?How can we prove that a function f is one-to-one?

Whenever you want to prove something, first take a Whenever you want to prove something, first take a look at the relevant definition(s):look at the relevant definition(s):

∀∀x, yx, y∈∈A (f(x) = f(y) A (f(x) = f(y) →→ x = y) x = y)

Example:Example:

f:f:RR→→RR

f(x) = xf(x) = x22

Disproof by counterexample:

f(3) = f(-3), but 3 f(3) = f(-3), but 3 ≠≠ -3, so f is not one-to-one. -3, so f is not one-to-one.

Properties of FunctionsProperties of Functions

… … and yet another example:and yet another example:

f:f:RR→→RR

f(x) = 3xf(x) = 3x

One-to-one: One-to-one: ∀∀x, yx, y∈∈A (f(x) = f(y) A (f(x) = f(y) →→ x = y) x = y)

To show:To show: f(x) f(x) ≠≠ f(y) whenever x f(y) whenever x ≠≠ y y

x x ≠≠ y y

⇔ 3x 3x ≠≠ 3y 3y

⇔ f(x) f(x) ≠≠ f(y), f(y),

so if x so if x ≠≠ y, then f(x) y, then f(x) ≠≠ f(y), that is, f is one-to-one. f(y), that is, f is one-to-one.

Properties of FunctionsProperties of Functions

A function f:AA function f:A→→B with A,B B with A,B ⊆⊆ R is called R is called strictly strictly increasingincreasing, if , if

∀∀x,yx,y∈∈A (x < y A (x < y →→ f(x) < f(y)), f(x) < f(y)),

and and strictly decreasingstrictly decreasing, if, if

∀∀x,yx,y∈∈A (x < y A (x < y →→ f(x) > f(y)). f(x) > f(y)).

Obviously, a function that is either strictly increasing Obviously, a function that is either strictly increasing or strictly decreasing is or strictly decreasing is one-to-oneone-to-one..

Properties of FunctionsProperties of Functions

A function f:AA function f:A→→B is called B is called ontoonto, or , or surjectivesurjective, if and , if and only if for every element bonly if for every element b∈∈B there is an element aB there is an element a∈∈A A with f(a) = b.with f(a) = b.

In other words, f is onto if and only if its In other words, f is onto if and only if its rangerange is its is its entire codomainentire codomain..

A function f: AA function f: A→→B is a B is a one-to-one correspondenceone-to-one correspondence, or , or a a bijectionbijection, if and only if it is both one-to-one and onto., if and only if it is both one-to-one and onto.

Obviously, if f is a bijection and A and B are finite sets, Obviously, if f is a bijection and A and B are finite sets, then |A| = |B|.then |A| = |B|.

Properties of FunctionsProperties of Functions

Examples:Examples:

In the following examples, we use the arrow In the following examples, we use the arrow representation to illustrate functions f:Arepresentation to illustrate functions f:A→→B. B.

In each example, the complete sets A and B are In each example, the complete sets A and B are shown.shown.

Properties of FunctionsProperties of Functions

Is f injective?Is f injective?

No.No.

Is f surjective?Is f surjective?

No.No.

Is f bijective?Is f bijective?

No.No.

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

Properties of FunctionsProperties of Functions

Is f injective?Is f injective?

No.No.

Is f surjective?Is f surjective?

Yes.Yes.

Is f bijective?Is f bijective?

No.No.

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

PaulPaul

Properties of FunctionsProperties of Functions

Is f injective?Is f injective?

Yes.Yes.

Is f surjective?Is f surjective?

No.No.

Is f bijective?Is f bijective?

No.No.

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

LLüübeckbeck

Properties of FunctionsProperties of Functions

Is f injective?Is f injective?

No! f is not evenNo! f is not evena function!a function!

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

LLüübeckbeck

Properties of FunctionsProperties of Functions

Is f injective?Is f injective?

Yes.Yes.

Is f surjective?Is f surjective?

Yes.Yes.

Is f bijective?Is f bijective?

Yes.Yes.

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

LLüübeckbeckHelenaHelena

InversionInversion

An interesting property of bijections is that they An interesting property of bijections is that they have an have an inverse functioninverse function..

The The inverse functioninverse function of the bijection f:A of the bijection f:A→→B is the B is the function ffunction f-1-1:B:B→→A with A with

ff-1-1(b) = a whenever f(a) = b. (b) = a whenever f(a) = b.

InversionInversion

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

LLüübeckbeckHelenaHelena

ff

ff-1-1

InversionInversion

Example:Example:

f(Linda) = Moscowf(Linda) = Moscow

f(Max) = Bostonf(Max) = Boston

f(Kathy) = Hong Kongf(Kathy) = Hong Kong

f(Peter) = Lf(Peter) = Lüübeckbeck

f(Helena) = New Yorkf(Helena) = New York

Clearly, f is bijective.Clearly, f is bijective.

The inverse function fThe inverse function f-1-1 is given by:is given by:

ff-1-1(Moscow) = Linda(Moscow) = Linda

ff-1-1(Boston) = Max(Boston) = Max

ff-1-1(Hong Kong) = Kathy(Hong Kong) = Kathy

ff-1-1(L(Lüübeck) = Peterbeck) = Peter

ff-1-1(New York) = Helena(New York) = Helena

Inversion is only Inversion is only possible for bijectionspossible for bijections(= invertible functions)(= invertible functions)

InversionInversion

LindaLinda

MaxMax

KathyKathy

PeterPeter

BostonBoston

New YorkNew York

Hong KongHong Kong

MoscowMoscow

LLüübeckbeckHelenaHelena

ff

ff-1-1

ff-1-1:C:C→→P is no P is no function, because it function, because it is not defined for all is not defined for all elements of C and elements of C and assigns two assigns two images to the pre-images to the pre-image New York.image New York.

CompositionComposition

The The compositioncomposition of two functions g:A of two functions g:A→→B and B and f:Bf:B→→C, denoted by fC, denoted by f°°g, is defined by g, is defined by

(f(f°°g)(a) = f(g(a))g)(a) = f(g(a))

This means that This means that • firstfirst, function g is applied to element a, function g is applied to element a∈∈A,A, mapping it onto an element of B, mapping it onto an element of B,• thenthen, function f is applied to this element of , function f is applied to this element of B, mapping it onto an element of C. B, mapping it onto an element of C.• ThereforeTherefore, the composite function maps , the composite function maps from A to C. from A to C.

CompositionComposition

Example:Example:

f(x) = 7x – 4, g(x) = 3x,f(x) = 7x – 4, g(x) = 3x,

f:f:RR→→RR, g:, g:RR→→RR

(f(f°°g)(5) = f(g(5)) = f(15) = 105 – 4 = 101g)(5) = f(g(5)) = f(15) = 105 – 4 = 101

(f(f°°g)(x) = f(g(x)) = f(3x) = 21x - 4g)(x) = f(g(x)) = f(3x) = 21x - 4

CompositionComposition

Composition of a function and its inverse:Composition of a function and its inverse:

(f(f-1-1°°f)(x) = ff)(x) = f-1-1(f(x)) = x(f(x)) = x

The composition of a function and its inverse is The composition of a function and its inverse is the the identity functionidentity function i(x) = x. i(x) = x.

GraphsGraphs

TheThe graphgraph of a functionof a function f:Af:A→→B is the set of B is the set of ordered pairs {(a, b) | aordered pairs {(a, b) | a∈∈A and f(a) = b}.A and f(a) = b}.

The graph is a subset of AThe graph is a subset of A××B that can be used to B that can be used to visualize f in a two-dimensional coordinate visualize f in a two-dimensional coordinate system.system.

Floor and Ceiling FunctionsFloor and Ceiling Functions

The The floorfloor and and ceilingceiling functions map the real functions map the real numbers onto the integers (numbers onto the integers (RR→→ZZ).).

The The floorfloor function assigns to r function assigns to r∈∈RR the largest z the largest z∈∈ZZ with zwith z≤≤r, denoted by r, denoted by rr..

Examples:Examples: 2.32.3 = 2, = 2, 22 = 2, = 2, 0.50.5 = 0, = 0, -3.5-3.5 = -4 = -4

The The ceilingceiling function assigns to r function assigns to r∈∈RR the smallest the smallest zz∈∈ZZ with z with z≥≥r, denoted by r, denoted by rr..

Examples:Examples: 2.32.3 = 3, = 3, 22 = 2, = 2, 0.50.5 = 1, = 1, -3.5-3.5 = -3 = -3