32
Chapter 7 Functions Dr. Curry Guinn

Chapter 7 Functions

  • Upload
    sienna

  • View
    26

  • Download
    0

Embed Size (px)

DESCRIPTION

Chapter 7 Functions. Dr. Curry Guinn. Outline of Today. Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The Pigeonhole Principle Section 7.4: Composition of functions Section 7.5: Cardinality. What is a function?. A function f f : X → Y - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 7  Functions

Chapter 7 Functions

Dr. Curry Guinn

Page 2: Chapter 7  Functions

Outline of Today

• Section 7.1: Functions Defined on General Sets

• Section 7.2: One-to-One and Onto• Section 7.3: The Pigeonhole Principle• Section 7.4: Composition of functions• Section 7.5: Cardinality

Page 3: Chapter 7  Functions

What is a function?

• A function f f : X → Y– Maps a set X to a set Y – is a relation between

• the elements of X (called the inputs) and• the elements of Y (called the outputs)

– with the property that each input is related to one and only one output.

• X is the domain.• Y is the co-domain. • The set of all values f(x) is called the range.

Page 4: Chapter 7  Functions

How do we represent functions

• Arrow diagrams• f : X → Y

• What is the domain?– {a,b,c,d}

• What is the co-domain?– {x, y, z, p, q, r, s}

• What is the range?– {x, y, p}

• What is the inverse image of y?– {a, c}

Page 5: Chapter 7  Functions

How do we represent functions?

• As Ordered Pairs

• f = { (a,y), (b,p), (c,y), (d,x) }

Page 6: Chapter 7  Functions

How do we represent functions?

• As machines

Page 7: Chapter 7  Functions

How do we represent functions?

• By Formula

• f(x) = 2x2 + 3

Page 8: Chapter 7  Functions

Equality of functions

• Two functions, f and g, are equal if– Both map from set X to set Y– And– f(x) = g(x) for all x X.

• If f(x) = SQRT(x^2) and g(x) = x, is f = g?• Identity function, i is such that

– i(x) = x for all x X

Page 9: Chapter 7  Functions

The Logarithmic Function

• Logb x = y by = x

• Log2 8

• Log10 1000

• Log3 3n

• Log5 1/25

• Loga 1 for a > 0

Page 10: Chapter 7  Functions

“Well defined” function

• Remember: a function must map an input to a single, unique value

• F: R → R such that – f(x) = SQRT(-x2) for all real numbers X.

• Why is this not well defined?

Page 11: Chapter 7  Functions

7.2: One-to-one and onto

• A function is f : X → Y is one-to-one when• If f(x1) = f(x2), then x1 must be equal to

x2.

• To show a function is one-to-one, assume f(a) = f(b) for arbitrary a and b. Show a = b.

Page 12: Chapter 7  Functions

One-to-one and finite sets

• See board

Page 13: Chapter 7  Functions

One-to-one example, infinite sets

• f(n) = 2n + 1• f(n) = n^2

Page 14: Chapter 7  Functions

Onto functions

• A function f : X → Y is onto if for every y in the co-domain, that is, every y Y, there exist some x X, such that f(x) = y.

• To prove something is onto, pick an arbitrary element in Y and find an x in X that maps to the y.

Page 15: Chapter 7  Functions

Onto functions and finite sets

• See board

Page 16: Chapter 7  Functions

Onto examples, infinite sets

• Show the following are or are not onto:• f: Z → Z by f(n) = 2n + 1.• f: Z → Z by f(n) = n + 5.

Page 17: Chapter 7  Functions

One-to-one correspondences

• If a function f : X → Y is both one-to-one and onto, there is a one-to-one correspondence (or bijection) from the set X to set Y.

• Show f: Z → Z by f(n) = n + 5 has a one-to-one correspondence.

Page 18: Chapter 7  Functions

Inverse functions

• If a function f : X → Y is has as one-to-one correspondence, the there is an inverse function f-1: Y → X such that if f(x) = y, then f-1(y) = x.

• f(x) = n + 5• What’s the inverse?

Page 19: Chapter 7  Functions

Exponential and Logarithmic functions

• Expb(x) = bx for any x R and b > 0.

• Logb(x) = y, for any x R+ if x = by

• Show logb(x/y) = logb(x) – logb(y)

• Hint: Let u = logb(x) and v = logb(y)

Page 20: Chapter 7  Functions

7.3: The Pigeonhole Principle

• Suppose X and Y are finite sets and N(X) > N(Y). Then a function f : X → Y cannot be one-to-one.

• Proof by contradiction.

Page 21: Chapter 7  Functions

Using the Pigeonhole Principle

• Prove there must be at least 2 people in New York city with the same number of hairs on their head.

• How many integers must you pick in order for them to have at least one pair with the same remainder when divided by 3.

Page 22: Chapter 7  Functions

The Generalized Pigeon Hole Principle

• For any function f from a finite set X to a finite set Y and for any positive integer k, if N(X) > k*N(Y), then there is some y Y such that the inverse image of y has at least k+1 distinct elements of X.

• If you have 85 people, and there are 26 possible initials of their last name, at least one initial must be used at least ___ times.

Page 23: Chapter 7  Functions

Pigeonhole

• In a group of 1,500 people, must at least five people have the same birthday?

Page 24: Chapter 7  Functions

7.4 Composition of Functions

Page 25: Chapter 7  Functions

Composition of functions

• The composition of two functions occurs when the output of one function is the input to another.

• Let f: X → Y’ and g: Y → Z where the range of f is a subset of the domain of g. Define a new function g f(x) = g(f(x)).

Page 26: Chapter 7  Functions

Composition Examples

• F(n) = n + 1 and g(n) = n2

• What is f g?

• What is g f?

Page 27: Chapter 7  Functions

Composition of one-to-one functions

• If both f and g are one-to-one, is f g one-to-one?

• Proof: See board

• If both f and g are onto, is f g onto?

Page 28: Chapter 7  Functions

7.5 Cardinality• The cardinality of a set is how many members it

has.• Let X and Y be sets. X has the same cardinality

as Y iff there exists a one-to-one correspondence from X to Y.– X has the same cardinality as X (Reflexive)– If X has the same cardinality as Y, Y has the same

cardinality as X (Symmetric)– If X has the same cardinality as Y, and Y has the

same cardinality as Z, then x has the same cardinality as Z (Transitive).

Page 29: Chapter 7  Functions

Countable Sets

• A set X is countably infinite iff has the same cardinality as the set of positive integers.

• Is the set of all integers countable?• F(n) = {

0 if n = 1-n/2 if n is even(n-1)/2 if n is odd }

Is this one-to-one? Onto?

Page 30: Chapter 7  Functions

Rational numbers are countable

Page 31: Chapter 7  Functions

The set of real numbers between 0 and 1 is uncountable.

• Uses Cantor’s Diagnolization Argument

• Proof by contradiction

• See board!!

• Any set with an uncountable subset is uncountable.

Page 32: Chapter 7  Functions

Some interesting results

• The set of all computer programs in a given computer language is countable.– How?– Each program is a finite set of strings.– Convert to binary.– Now each program is a unique number in the

set of integers.– The set of all programs is a subset of the set

of all integers. Therefore countable.