Title: Chapter 7 Functions
1Chapter 7 Functions
2Outline 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
3What 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.
4How do we represent functions
- 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
5How do we represent functions?
- As Ordered Pairs
- f (a,y), (b,p), (c,y), (d,x)
6How do we represent functions?
7How do we represent functions?
8Equality 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(x2) and g(x) x, is f g?
- Identity function, i is such that
- i(x) x for all x ? X
9The Logarithmic Function
- Logb x y ? by x
- Log2 8
- Log10 1000
- Log3 3n
- Log5 1/25
- Loga 1 for a gt 0
10Well 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?
117.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.
12One-to-one and finite sets
13One-to-one example, infinite sets
14Onto 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.
15Onto functions and finite sets
16Onto 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.
17One-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.
18Inverse 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
- Whats the inverse?
19Exponential and Logarithmic functions
- Expb(x) bx for any x ? R and b gt 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)
207.3 The Pigeonhole Principle
- Suppose X and Y are finite sets and N(X) gt N(Y).
Then a function f X ? Y cannot be one-to-one. - Proof by contradiction.
21Using 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.
22The 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) gt kN(Y), then there is some y ? Y such that
the inverse image of y has at least k1 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.
23Pigeonhole
- In a group of 1,500 people, must at least five
people have the same birthday?
247.4 Composition of Functions
25Composition 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)).
26Composition Examples
- F(n) n 1 and g(n) n2
- What is f ? g?
- What is g ? f?
27Composition 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?
287.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).
29Countable 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?
30Rational numbers are countable
31The set of real numbers between 0 and 1 is
uncountable.
- Uses Cantors Diagnolization Argument
- Proof by contradiction
- See board!!
- Any set with an uncountable subset is
uncountable.
32Some 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.