SlideShare ist ein Scribd-Unternehmen logo
1 von 57
1
Discrete Math
CS 2800
Johnnie Baker
jbaker@cs.kent.edu
Module Topic
Basic Structures: Functions and Sequences
Acknowledgement
Most of these slides were either created by
Professor Bart Selman at Cornell University or
else are modifications of his slides
2
Functions
Suppose we have:
How do you describe the yellow function?
What’s a function ? f(x) = -(1/2)x – 1/2
x
f(x)
Functions
More generally:
Definition:
Given A and B, nonempty sets, a function f from A to B is an assignment
of exactly one element of B to each element of A. We write f(a)=b if b is
the element of B assigned by function f to the element a of A.
If f is a function from A to B, we write f : AB.
Note: Functions are also called mappings or transformations.
B
5
Functions
A = {Michael, Toby , John , Chris , Brad }
B = { Kathy, Carla, Mary}
Let f: A  B be defined as f(a) = mother(a).
Michael
Toby
John
Chris
Brad
Kathy
Carol
Mary
A
B
6
Functions
More generally:
f: RR, f(x) = -(1/2)x – 1/2
domain co-domain
A - Domain of f B- Co-Domain of f
B
7
Functions
More formally: a function f : A  B is a subset of AxB where
 a  A, ! b  B and <a,b>  f.
A
B
A
B
a point!
a collection of
points!
Why not?
Functions - image & preimage
For any set S  A, image(S) = {b : a  S, f(a) = b}
So, image({Michael, Toby}) = {Kathy} image(A) = B - {Carol}
image(S)
image(John) = {Kathy} pre-image(Kathy) = {John, Toby, Michael}
range of f
image(A)
Michael
Toby
John
Chris
Brad
Kathy
Carol
Mary
A B
9
Functions - injection
A function f: A  B is one-to-one (injective, an injection) if
a,b,c, (f(a) = b  f(c) = b)  a = c
Not one-to-one
Every b  B has
at most 1
preimage.
Michael
Toby
John
Chris
Brad
Kathy
Carol
Mary
10
Functions - surjection
A function f: A  B is onto (surjective, a surjection) if b 
B, a  A f(a) = b
Not onto
Every b  B has
at least 1
preimage.
Michael
Toby
John
Chris
Brad
Kathy
Carol
Mary
11
Functions – one-to-one-correspondence
or bijection
A function f: A  B is bijective if it is one-to-one and onto.
Anna
Mark
John
Paul
Sarah
Carol
Jo
Martha
Dawn
Eve
Every b  B has
exactly 1
preimage.
An important
implication of this
characteristic:
The preimage (f-1)
is a function!
They are
invertible.
Anna
Mark
John
Paul
Sarah
Carol
Jo
Martha
Dawn
Eve
12
Functions: inverse function
Definition:
Given f, a one-to-one correspondence from set A to set B, the inverse
function of f is the function that assigns to an element b belonging to B
the unique element a in A such that f(a)=b. The inverse function is
denoted f-1 . f-1 (b)=a, when f(a)=b.
B
13
Functions - examples
Suppose f: R+  R+, f(x) = x2.
Is f one-to-one?
Is f onto?
Is f bijective?
yes
yes
yes
This function is invertible.
14
Functions - examples
Suppose f: R  R+, f(x) = x2.
Is f one-to-one?
Is f onto?
Is f bijective?
no
yes
no
This function is not invertible.
15
Functions - examples
Suppose f: R  R, f(x) = x2.
Is f one-to-one?
Is f onto?
Is f bijective?
no
no
no
17
Functions - composition
Let f: AB, and g: BC be functions. Then the composition of
f and g is:
(f o g)(x) = f(g(x))
Note: (f o g) cannot be defined unless the range of g is a subset of the domain of f.
“f composed with g”
18
Example:
Let f(x) = 2 x +3; g(x) = 3 x + 2;
(f o g) (x) = f(3x + 2) = 2 (3 x + 2 ) + 3 = 6 x + 7.
(g o f ) (x) = g (2 x + 3) = 3 (2 x + 3) + 2 = 6 x + 11.
As this example shows, (f o g) and (g o f) are not necessarily equal – i.e,
the composition of functions is not commutative.
19
Note:
(f -1 o f) (a) = f -1(f(a)) = f -1(b) = a.
(f o f -1) (b) = f (f -1(b)) = f-(a) = b.
Therefore (f-1o f ) = IA and (f o f-1) = IB where IA and IB are the identity
function on the sets A and B. (f -1) -1= f
20
Some important functions
Absolute value:
Domain R; Co-Domain = {0}  R+
|x| = x if x ≥0
-x if x < 0
Ex: |-3| = 3; |3| = 3
Floor function (or greatest integer function):
Domain = R; Co-Domain = Z
x  = largest integer not greater than x
Ex: 3.2 = 3; -2.5 =-3
21
Some important functions
Ceiling function:
Domain = R;
Co-Domain = Z
x = smallest integer greater than x
Ex: 3.2 = 4; -2.5 =-2
≤
≤
≤
≤
+
+
+
+
+
+
23
Some important functions
Factorial function: Domain = Range = N Error on range
n! = n (n-1)(n-2) …, 3 x 2 x 1
Ex: 5! = 5 x 4 x 3 x 2 x 1 = 120
Note: 0! = 1 by convention.
24
Some important functions
Mod (or remainder):
Domain = N x N+ = {(m,n)| m N, n  N+ }
Co-domain Range = N
m mod n = m - m/n n
Ex: 8 mod 3 = 8 - 8/3 3 = 2
57 mod 12 = 9;
Note: This function computes the remainder when m is divided by n.
The name of this function is an abbreviation of m modulo n, where modulus means with
respect to a modulus (size) of n, which is defined to be the remainder when m is divided
by n. Note also that this function is an example in which the domain of the function is a
2-tuple.
25
Some important functions:
Exponential Function
Exponential function:
Domain = R+ x R = {(a,x)| a  R+, x  R }
Co-domain Range = R+
f(x) = a x
Note: a is a positive constant; x varies.
Ex: f(n) = a n = a x a …, x a (n times)
How do we define f(x) if x is not a positive integer?
26
Some important functions:
Exponential function
Exponential function:
How do we define f(x) if x is not a positive integer?
Important properties of exponential functions:
(1) a (x+y) = ax ay; (2) a 1 = a (3) a 0 = 1
See:
)(
...
;
;
12123
11112
timesnaaa
aaaaaaa
aaaaaa
n






27
We get:
aathereforeaaaaaa
aathereforeaaaa
athereforeaaaaa
bbbbbb






2
1
22
1
2
1
2
1
2
1
2
1
1
)(0
00011
)(
11
1
By similar arguments:
mnmnn
m
mxxxmx
kk
aaathereforeatimesmaaa
aa
)()(,)()(
1
1



Note: This determines ax for all x rational. x is irrational by continuity (we’ll skip “details”).
28
Some important functions:
Logarithm Function
Logarithm base a:
Domain = R+ x R = {(a,x)| a  R+, a>1, x  R }
Co-domain Range = R
y = log a (x)  ay = x
Ex: log 2 (8) =3; log 2 (16) =3; 3 < log 2 (15) <4.
Key properties of the log function (they follow from those for exponential):
1. log a (1)=0 (because a0 =1)
2. log a (a)=1 (because a1 =a)
3. log a (xy) = log a (x) + log a (x) (similar arguments)
4. log a (xr) = r log a (x)
5. log a (1/x) = - log a (x) (note 1/x = x-1)
6. log b (x) = log a (x) / log a (b)
29
Logarithm Functions
Examples:
log 2 (1/4)= - log 2 (4)= - 2.
log 2 (-4) undefined
log 2 (210 35 )= log 2 (210) + log 2 (35 )=10 log 2 (2) + 5log 2 (3 )=
= 10 + 5 log 2 (3 )
30
Limit Properties of Log Function
0
)log(
lim
)log(lim




x
x
x
x
x
As x gets large, log(x) grows without bound.
But x grows MUCH faster than log(x)…more soon on growth rates.
31
Some important functions:
Polynomials
Polynomial function:
Domain = usually R
Co-domain Range = usually R
Pn(x) = anxn + an-1xn-1 + … + a1x1 + a0
n, a nonnegative integer is the degree of the polynomial;
an 0 (so that the term anxn actually appears)
(an, an-1, …, a1, a0) are the coefficients of the polynomial.
Ex:
y = P1(x) = a1x1 + a0 linear function
y = P2(x) = a2x2 + a1x1 + a0 quadratic polynomial or function
32
Exponentials grow MUCH faster than polynomials:
10lim 0



bif
b
xaa
x
k
k
x

We’ll talk more about growth rates in the next module….
Sequences
34
Sequences
Definition:
A sequence {ai} is a function f: A  N  {0}  S, where we write
ai to indicate f(i). We call ai term I of the sequence.
Examples:
Sequence {ai}, where ai = i is just a0 = 0, a1 = 1, a2 = 2, …
Sequence {ai}, where ai = i2 is just a0 = 0, a1 = 1, a2 = 4, …
Sequences of the form a1, a2, …, an are often used in computer science.
(always check whether sequence starts at a0 or a1)
These finite sequences are also called strings. The length of a string is the number of
terms in the string. The empty string, denoted by , is the string that has no terms.
35
Geometric and Arithmetic Progressions
Definition: A geometric progression is a sequence of the form
 ,,,,,, 32 n
arararara
The initial term a and the common ratio r are real numbers
Definition: An arithmetic progression is a sequence of the form
 ,,,3,2,, ndadadadaa 
The initial term a and the common difference d are real numbers
Note: An arithmetic progression is a discrete analogue of the linear function f(x) = dx + a
Notice differences in growth rate.
37
Summation
The symbol  (Greek letter sigma) is used to denote summation.
The limit:
ai
i1
k
  a1  a2  K  ak
ai
i1

  lim
n
ai
i1
n

i is the index of the summation, and the choice of letter i is arbitrary;
the index of the summation runs through all integers, with its lower limit 1
and ending upper limit k.
38
Summation
The laws for arithmetic apply to summations

cai  bi 
i1
k
  c ai
i1
k
  bi
i1
k

Use associativity to separate the b terms from the a terms.
Use distributivity to factor the c’s.
39
Summations you should know…
What is S = 1 + 2 + 3 + … + n?
You get n copies of (n+1). But we’ve over added by a factor of 2.
So just divide by 2.
S = 1 + 2 + … + n
S = n + n-1 + … + 1
2s = n+1 + n+1 + … + n+1
Write the sum.
Write it again.
Add together.
k
k1
n
 
n(n  1)
2
(little) Gauss in 4th grade. 
Why whole number?
40
What is S = 1 + 3 + 5 + … + (2n - 1)?
Sum of first n odds.

(2k 1)
k1
n
  2 k
k1
n
  1
k1
n

 2
n(n  1)
2





 n
 n2
What is S = 1 + 3 + 5 + … + (2n - 1)?
Sum of first n odds.

 n2
What is S = 1 + r + r2 + … + rn
Geometric Series

rk
k 0
n
  1 r  K  rn

r rk
k 0
n
  r  r2
 K  rn1
Multiply by r
Subtract the summations
rk
k 0
n
  r rk
k 0
n
  1 rn1
factor
(1 r) rk
k 0
n
  1 rn1
divide rk
k 0
n
 
1 rn 1
(1 r)
DONE!
What about:
rk
k 0

  1 r  K  rn
 K

n
lim
1 rn1
(1 r)
If r  1 this
blows up.
If r < 1 we can say something.
rk
k 0

 
n
lim rk
k 0
n


1
(1 r)
Try r = ½.
Useful Summations
45
Infinite Cardinality
How can we extend the notion of cardinality to infinite sets?
Definition: Two sets A and B have the same cardinality if and only if
there exists a bijection (or a one-to-one correspondence) between
them, A ~ B.
We split infinite sets into two groups:
1. Sets with the same cardinality as the set of natural numbers
2. Sets with different cardinality as the set of natural numbers
46
Infinite Cardinality
Definition: A set is countable if it is finite or has the same cardinality
as the set of positive integers.
Definition: A set is uncountable if it is not countable.
Definition: The cardinality of an infinite set S that is countable is denotes
by ‫א‬0 (where ‫א‬ is aleph, the first letter of the Hebrew alphabet). We
write |S| = ‫א‬0 and say that S has cardinality “aleph null”.
Note: Georg Cantor defined the notion of cardinality and was the first to realize that infinite sets can have
different cardinalities. ‫א‬0 is the cardinality of the natural numbers; the next larger cardinality is
aleph-one ‫א‬1, then, ‫א‬2 and so on.
47
Infinite Cardinality:
Odd Positive Integers
Example: The set of odd positive integers is a countable set.
Let’s define the function f, from Z+ to the set of odd positive numbers,
f(n) = 2 n -1
We have to show that f is both one-to-one and onto.
a) one-to-one
Suppose f(n)= f(m)  2n-1 = 2m-1  n=m
b) onto
Suppose that t is an odd positive integer. Then t is 1 less than an even
integer 2k, where k is a natural number. hence t=2k-1= f(k).
48
Infinite Cardinality:
Odd Positive Integers
2
49
Infinite Cardinality:
Integers
Example: The set of integers is a countable set.
Lets consider the sequence of all integers, starting with 0: 0,1,-1,2,-
2,….
We can define this sequence as a function:
oddNn
n
evenNnn
,
2
)1(
,
2



f(n) =
Show at home that it’s one-to-one and onto
20 1 -1 2
50
Infinite Cardinality:
Rational Numbers
Example: The set of positive rational numbers is a countable set. Hmm…
51
Infinite Cardinality:
Rational Numbers
Example: The set of positive rational numbers is a countable set
Key aspect to list the rational numbers as a sequence – every positive number is the
quotient p/q of two positive integers.
Visualization of the proof.
p+q=4 p+q=5 p+q=6
Since all positive rational numbers
are listed once, the set of positive
rational numbers is countable.
52
Uncountable Sets:
Cantor's diagonal argument
The set of all infinite sequences of zeros and ones is uncountable.
Consider a sequence,
10,,,,, 21  iin aoranaaa 
For example:
So in general we have:
i.e., sn,m is the mth element of the nth sequence on the list.
53
It is possible to build a sequence, say s0, in such a way that its first element is
different from the first element of the first sequence in the list, its second element is
different from the second element of the second sequence in the list, and, in general,
its nth element is different from the nth element of the nth sequence in the list. In other
words, s0,m will be 0 if sm,m is 1, and s0,m will be 1 if sm,m is 0.
Uncountable Sets:
Cantor's diagonal argument
54
The sequence s0 is distinct from all the sequences in the list. Why?
Let’s say that s0 is identical to the 100th sequence, therefore, s0,100=s100,100.
In general, if it appeared as the nth sequence on the list, we would have s0,n = sn,n,
which, due to the construction of s0, is impossible.
Note: the diagonal elements are highlighted,
showing why this is called the diagonal argument
Uncountable Sets:
Cantor's diagonal argument
55
From this it follows that the set T, consisting of all infinite sequences of
zeros and ones, cannot be put into a list s1, s2, s3, ... Otherwise, it would
be possible by the above process to construct a sequence s0 which would
both be in T (because it is a sequence of 0's and 1's which is by the
definition of T in T) and at the same time not in T (because we can
deliberately construct it not to be in the list). T, containing all such
sequences, must contain s0, which is just such a sequence. But since s0
does not appear anywhere on the list, T cannot contain s0.
Therefore T cannot be placed in one-to-one correspondence with the
natural numbers. In other words, the set of infinite binary strings is
uncountable.
Uncountable Sets:
Cantor's diagonal argument
56
Real Numbers
Example; The set of real numbers is an uncountable set.
Let’s assume that the set of real numbers is countable.
Therefore any subset of it is also countable, in particular the interval
[0,1].
How many real numbers are in interval [0, 1]?
57
Real Numbers
How many real numbers are in interval [0, 1]?
0.4 3 2 9 0 1 3 2 9 8 4 2 0 3 9 …
0.8 2 5 9 9 1 3 2 7 2 5 8 9 2 5 …
0.9 2 5 3 9 1 5 9 7 4 5 0 6 2 1 …
…
“Countably many! There’s part of
the list!”
“Are you sure they’re all there?”
0.5 3 6 …
So we say the reals are
“uncountable.”
Counterexample:
Use diagonalization
to create a new number
that differs in the ith
position of the
ith number
by 1.

Weitere ähnliche Inhalte

Was ist angesagt?

Relations and Functions
Relations and FunctionsRelations and Functions
Relations and Functionstoni dimella
 
3.2 Logarithmic Functions
3.2 Logarithmic Functions3.2 Logarithmic Functions
3.2 Logarithmic Functionslgemgnani
 
Lecture 2 family of fcts
Lecture 2   family of fctsLecture 2   family of fcts
Lecture 2 family of fctsnjit-ronbrown
 
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program CorrectnessCMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctnessallyn joy calcaben
 
Relations & Functions
Relations & FunctionsRelations & Functions
Relations & FunctionsJ Edwards
 
Types of functions 05272011
Types of functions 05272011Types of functions 05272011
Types of functions 05272011Boyet Aluan
 
Concept map function
Concept map functionConcept map function
Concept map functionzabidah awang
 
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...ssuserd6b1fd
 
1.4 review on log exp-functions
1.4 review on log exp-functions1.4 review on log exp-functions
1.4 review on log exp-functionsmath265
 
1.5 notation and algebra of functions
1.5 notation and algebra of functions1.5 notation and algebra of functions
1.5 notation and algebra of functionsmath123c
 
PPt on Functions
PPt on FunctionsPPt on Functions
PPt on Functionscoolhanddav
 
Lec 03 - Combinational Logic Design
Lec 03 - Combinational Logic DesignLec 03 - Combinational Logic Design
Lec 03 - Combinational Logic DesignVajira Thambawita
 
Chapter 1 functions
Chapter 1  functionsChapter 1  functions
Chapter 1 functionsUmair Pearl
 
8.4 logarithmic functions
8.4 logarithmic functions8.4 logarithmic functions
8.4 logarithmic functionshisema01
 
Algebra 2. 9.15. Intro to quadratics
Algebra 2. 9.15. Intro to quadraticsAlgebra 2. 9.15. Intro to quadratics
Algebra 2. 9.15. Intro to quadraticsdmatkeson21
 
Average value by integral method
Average value by integral methodAverage value by integral method
Average value by integral methodArun Umrao
 
Higher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and FunctionsHigher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and Functionstimschmitz
 

Was ist angesagt? (20)

Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
 
Relations and Functions
Relations and FunctionsRelations and Functions
Relations and Functions
 
3.2 Logarithmic Functions
3.2 Logarithmic Functions3.2 Logarithmic Functions
3.2 Logarithmic Functions
 
Lecture 2 family of fcts
Lecture 2   family of fctsLecture 2   family of fcts
Lecture 2 family of fcts
 
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program CorrectnessCMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
 
Relations & Functions
Relations & FunctionsRelations & Functions
Relations & Functions
 
Types of functions 05272011
Types of functions 05272011Types of functions 05272011
Types of functions 05272011
 
Concept map function
Concept map functionConcept map function
Concept map function
 
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
 
1.4 review on log exp-functions
1.4 review on log exp-functions1.4 review on log exp-functions
1.4 review on log exp-functions
 
1.5 notation and algebra of functions
1.5 notation and algebra of functions1.5 notation and algebra of functions
1.5 notation and algebra of functions
 
PPt on Functions
PPt on FunctionsPPt on Functions
PPt on Functions
 
Lec 03 - Combinational Logic Design
Lec 03 - Combinational Logic DesignLec 03 - Combinational Logic Design
Lec 03 - Combinational Logic Design
 
Graph of functions
Graph of functionsGraph of functions
Graph of functions
 
Chapter 1 functions
Chapter 1  functionsChapter 1  functions
Chapter 1 functions
 
8.4 logarithmic functions
8.4 logarithmic functions8.4 logarithmic functions
8.4 logarithmic functions
 
Algebra 2. 9.15. Intro to quadratics
Algebra 2. 9.15. Intro to quadraticsAlgebra 2. 9.15. Intro to quadratics
Algebra 2. 9.15. Intro to quadratics
 
Average value by integral method
Average value by integral methodAverage value by integral method
Average value by integral method
 
Relations and Functions
Relations and FunctionsRelations and Functions
Relations and Functions
 
Higher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and FunctionsHigher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and Functions
 

Ähnlich wie Chpt 2-functions-seqs v.5

01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdfRajuSingh806014
 
Functions and graphs
Functions and graphsFunctions and graphs
Functions and graphsSujata Tapare
 
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLESTYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLESMohanSonawane
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6homeworkping3
 
Higher Maths 121 Sets And Functions 1205778086374356 2
Higher Maths 121 Sets And Functions 1205778086374356 2Higher Maths 121 Sets And Functions 1205778086374356 2
Higher Maths 121 Sets And Functions 1205778086374356 2Niccole Taylor
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10Boipelo Radebe
 
Relations & functions
Relations & functionsRelations & functions
Relations & functionsindu thakur
 
phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2Bui Loi
 
Maths chapter wise Important questions
Maths chapter wise Important questionsMaths chapter wise Important questions
Maths chapter wise Important questionsSrikanth KS
 
Calculus - 1 Functions, domain and range
Calculus - 1 Functions, domain and rangeCalculus - 1 Functions, domain and range
Calculus - 1 Functions, domain and rangeIdrisJeffreyManguera
 
Functions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsFunctions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsMath Academy Singapore
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfAakashKushwaha26
 
02-Basic Structures .ppt
02-Basic Structures .ppt02-Basic Structures .ppt
02-Basic Structures .pptAcct4
 

Ähnlich wie Chpt 2-functions-seqs v.5 (20)

01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf
 
Functions and graphs
Functions and graphsFunctions and graphs
Functions and graphs
 
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLESTYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
TYPES OF FUNCTION FOR JEE PREPARATION WITH EXAMPLES
 
Functions & graphs
Functions & graphsFunctions & graphs
Functions & graphs
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
 
Higher Maths 121 Sets And Functions 1205778086374356 2
Higher Maths 121 Sets And Functions 1205778086374356 2Higher Maths 121 Sets And Functions 1205778086374356 2
Higher Maths 121 Sets And Functions 1205778086374356 2
 
Functions
FunctionsFunctions
Functions
 
Introductory calculus
Introductory calculusIntroductory calculus
Introductory calculus
 
Functions (Theory)
Functions (Theory)Functions (Theory)
Functions (Theory)
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
 
Functions
FunctionsFunctions
Functions
 
phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2
 
Maths chapter wise Important questions
Maths chapter wise Important questionsMaths chapter wise Important questions
Maths chapter wise Important questions
 
Calculus - 1 Functions, domain and range
Calculus - 1 Functions, domain and rangeCalculus - 1 Functions, domain and range
Calculus - 1 Functions, domain and range
 
Functions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levelsFunctions 1 - Math Academy - JC H2 maths A levels
Functions 1 - Math Academy - JC H2 maths A levels
 
Functions
FunctionsFunctions
Functions
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdf
 
Function of DM
Function of DM Function of DM
Function of DM
 
02-Basic Structures .ppt
02-Basic Structures .ppt02-Basic Structures .ppt
02-Basic Structures .ppt
 

Kürzlich hochgeladen

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 

Kürzlich hochgeladen (20)

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 

Chpt 2-functions-seqs v.5

  • 1. 1 Discrete Math CS 2800 Johnnie Baker jbaker@cs.kent.edu Module Topic Basic Structures: Functions and Sequences
  • 2. Acknowledgement Most of these slides were either created by Professor Bart Selman at Cornell University or else are modifications of his slides 2
  • 3. Functions Suppose we have: How do you describe the yellow function? What’s a function ? f(x) = -(1/2)x – 1/2 x f(x)
  • 4. Functions More generally: Definition: Given A and B, nonempty sets, a function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a)=b if b is the element of B assigned by function f to the element a of A. If f is a function from A to B, we write f : AB. Note: Functions are also called mappings or transformations. B
  • 5. 5 Functions A = {Michael, Toby , John , Chris , Brad } B = { Kathy, Carla, Mary} Let f: A  B be defined as f(a) = mother(a). Michael Toby John Chris Brad Kathy Carol Mary A B
  • 6. 6 Functions More generally: f: RR, f(x) = -(1/2)x – 1/2 domain co-domain A - Domain of f B- Co-Domain of f B
  • 7. 7 Functions More formally: a function f : A  B is a subset of AxB where  a  A, ! b  B and <a,b>  f. A B A B a point! a collection of points! Why not?
  • 8. Functions - image & preimage For any set S  A, image(S) = {b : a  S, f(a) = b} So, image({Michael, Toby}) = {Kathy} image(A) = B - {Carol} image(S) image(John) = {Kathy} pre-image(Kathy) = {John, Toby, Michael} range of f image(A) Michael Toby John Chris Brad Kathy Carol Mary A B
  • 9. 9 Functions - injection A function f: A  B is one-to-one (injective, an injection) if a,b,c, (f(a) = b  f(c) = b)  a = c Not one-to-one Every b  B has at most 1 preimage. Michael Toby John Chris Brad Kathy Carol Mary
  • 10. 10 Functions - surjection A function f: A  B is onto (surjective, a surjection) if b  B, a  A f(a) = b Not onto Every b  B has at least 1 preimage. Michael Toby John Chris Brad Kathy Carol Mary
  • 11. 11 Functions – one-to-one-correspondence or bijection A function f: A  B is bijective if it is one-to-one and onto. Anna Mark John Paul Sarah Carol Jo Martha Dawn Eve Every b  B has exactly 1 preimage. An important implication of this characteristic: The preimage (f-1) is a function! They are invertible. Anna Mark John Paul Sarah Carol Jo Martha Dawn Eve
  • 12. 12 Functions: inverse function Definition: Given f, a one-to-one correspondence from set A to set B, the inverse function of f is the function that assigns to an element b belonging to B the unique element a in A such that f(a)=b. The inverse function is denoted f-1 . f-1 (b)=a, when f(a)=b. B
  • 13. 13 Functions - examples Suppose f: R+  R+, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective? yes yes yes This function is invertible.
  • 14. 14 Functions - examples Suppose f: R  R+, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective? no yes no This function is not invertible.
  • 15. 15 Functions - examples Suppose f: R  R, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective? no no no
  • 16.
  • 17. 17 Functions - composition Let f: AB, and g: BC be functions. Then the composition of f and g is: (f o g)(x) = f(g(x)) Note: (f o g) cannot be defined unless the range of g is a subset of the domain of f. “f composed with g”
  • 18. 18 Example: Let f(x) = 2 x +3; g(x) = 3 x + 2; (f o g) (x) = f(3x + 2) = 2 (3 x + 2 ) + 3 = 6 x + 7. (g o f ) (x) = g (2 x + 3) = 3 (2 x + 3) + 2 = 6 x + 11. As this example shows, (f o g) and (g o f) are not necessarily equal – i.e, the composition of functions is not commutative.
  • 19. 19 Note: (f -1 o f) (a) = f -1(f(a)) = f -1(b) = a. (f o f -1) (b) = f (f -1(b)) = f-(a) = b. Therefore (f-1o f ) = IA and (f o f-1) = IB where IA and IB are the identity function on the sets A and B. (f -1) -1= f
  • 20. 20 Some important functions Absolute value: Domain R; Co-Domain = {0}  R+ |x| = x if x ≥0 -x if x < 0 Ex: |-3| = 3; |3| = 3 Floor function (or greatest integer function): Domain = R; Co-Domain = Z x  = largest integer not greater than x Ex: 3.2 = 3; -2.5 =-3
  • 21. 21 Some important functions Ceiling function: Domain = R; Co-Domain = Z x = smallest integer greater than x Ex: 3.2 = 4; -2.5 =-2
  • 23. 23 Some important functions Factorial function: Domain = Range = N Error on range n! = n (n-1)(n-2) …, 3 x 2 x 1 Ex: 5! = 5 x 4 x 3 x 2 x 1 = 120 Note: 0! = 1 by convention.
  • 24. 24 Some important functions Mod (or remainder): Domain = N x N+ = {(m,n)| m N, n  N+ } Co-domain Range = N m mod n = m - m/n n Ex: 8 mod 3 = 8 - 8/3 3 = 2 57 mod 12 = 9; Note: This function computes the remainder when m is divided by n. The name of this function is an abbreviation of m modulo n, where modulus means with respect to a modulus (size) of n, which is defined to be the remainder when m is divided by n. Note also that this function is an example in which the domain of the function is a 2-tuple.
  • 25. 25 Some important functions: Exponential Function Exponential function: Domain = R+ x R = {(a,x)| a  R+, x  R } Co-domain Range = R+ f(x) = a x Note: a is a positive constant; x varies. Ex: f(n) = a n = a x a …, x a (n times) How do we define f(x) if x is not a positive integer?
  • 26. 26 Some important functions: Exponential function Exponential function: How do we define f(x) if x is not a positive integer? Important properties of exponential functions: (1) a (x+y) = ax ay; (2) a 1 = a (3) a 0 = 1 See: )( ... ; ; 12123 11112 timesnaaa aaaaaaa aaaaaa n      
  • 27. 27 We get: aathereforeaaaaaa aathereforeaaaa athereforeaaaaa bbbbbb       2 1 22 1 2 1 2 1 2 1 2 1 1 )(0 00011 )( 11 1 By similar arguments: mnmnn m mxxxmx kk aaathereforeatimesmaaa aa )()(,)()( 1 1    Note: This determines ax for all x rational. x is irrational by continuity (we’ll skip “details”).
  • 28. 28 Some important functions: Logarithm Function Logarithm base a: Domain = R+ x R = {(a,x)| a  R+, a>1, x  R } Co-domain Range = R y = log a (x)  ay = x Ex: log 2 (8) =3; log 2 (16) =3; 3 < log 2 (15) <4. Key properties of the log function (they follow from those for exponential): 1. log a (1)=0 (because a0 =1) 2. log a (a)=1 (because a1 =a) 3. log a (xy) = log a (x) + log a (x) (similar arguments) 4. log a (xr) = r log a (x) 5. log a (1/x) = - log a (x) (note 1/x = x-1) 6. log b (x) = log a (x) / log a (b)
  • 29. 29 Logarithm Functions Examples: log 2 (1/4)= - log 2 (4)= - 2. log 2 (-4) undefined log 2 (210 35 )= log 2 (210) + log 2 (35 )=10 log 2 (2) + 5log 2 (3 )= = 10 + 5 log 2 (3 )
  • 30. 30 Limit Properties of Log Function 0 )log( lim )log(lim     x x x x x As x gets large, log(x) grows without bound. But x grows MUCH faster than log(x)…more soon on growth rates.
  • 31. 31 Some important functions: Polynomials Polynomial function: Domain = usually R Co-domain Range = usually R Pn(x) = anxn + an-1xn-1 + … + a1x1 + a0 n, a nonnegative integer is the degree of the polynomial; an 0 (so that the term anxn actually appears) (an, an-1, …, a1, a0) are the coefficients of the polynomial. Ex: y = P1(x) = a1x1 + a0 linear function y = P2(x) = a2x2 + a1x1 + a0 quadratic polynomial or function
  • 32. 32 Exponentials grow MUCH faster than polynomials: 10lim 0    bif b xaa x k k x  We’ll talk more about growth rates in the next module….
  • 34. 34 Sequences Definition: A sequence {ai} is a function f: A  N  {0}  S, where we write ai to indicate f(i). We call ai term I of the sequence. Examples: Sequence {ai}, where ai = i is just a0 = 0, a1 = 1, a2 = 2, … Sequence {ai}, where ai = i2 is just a0 = 0, a1 = 1, a2 = 4, … Sequences of the form a1, a2, …, an are often used in computer science. (always check whether sequence starts at a0 or a1) These finite sequences are also called strings. The length of a string is the number of terms in the string. The empty string, denoted by , is the string that has no terms.
  • 35. 35 Geometric and Arithmetic Progressions Definition: A geometric progression is a sequence of the form  ,,,,,, 32 n arararara The initial term a and the common ratio r are real numbers Definition: An arithmetic progression is a sequence of the form  ,,,3,2,, ndadadadaa  The initial term a and the common difference d are real numbers Note: An arithmetic progression is a discrete analogue of the linear function f(x) = dx + a
  • 36. Notice differences in growth rate.
  • 37. 37 Summation The symbol  (Greek letter sigma) is used to denote summation. The limit: ai i1 k   a1  a2  K  ak ai i1    lim n ai i1 n  i is the index of the summation, and the choice of letter i is arbitrary; the index of the summation runs through all integers, with its lower limit 1 and ending upper limit k.
  • 38. 38 Summation The laws for arithmetic apply to summations  cai  bi  i1 k   c ai i1 k   bi i1 k  Use associativity to separate the b terms from the a terms. Use distributivity to factor the c’s.
  • 39. 39 Summations you should know… What is S = 1 + 2 + 3 + … + n? You get n copies of (n+1). But we’ve over added by a factor of 2. So just divide by 2. S = 1 + 2 + … + n S = n + n-1 + … + 1 2s = n+1 + n+1 + … + n+1 Write the sum. Write it again. Add together. k k1 n   n(n  1) 2 (little) Gauss in 4th grade.  Why whole number?
  • 40. 40 What is S = 1 + 3 + 5 + … + (2n - 1)? Sum of first n odds.  (2k 1) k1 n   2 k k1 n   1 k1 n   2 n(n  1) 2       n  n2
  • 41. What is S = 1 + 3 + 5 + … + (2n - 1)? Sum of first n odds.   n2
  • 42. What is S = 1 + r + r2 + … + rn Geometric Series  rk k 0 n   1 r  K  rn  r rk k 0 n   r  r2  K  rn1 Multiply by r Subtract the summations rk k 0 n   r rk k 0 n   1 rn1 factor (1 r) rk k 0 n   1 rn1 divide rk k 0 n   1 rn 1 (1 r) DONE!
  • 43. What about: rk k 0    1 r  K  rn  K  n lim 1 rn1 (1 r) If r  1 this blows up. If r < 1 we can say something. rk k 0    n lim rk k 0 n   1 (1 r) Try r = ½.
  • 45. 45 Infinite Cardinality How can we extend the notion of cardinality to infinite sets? Definition: Two sets A and B have the same cardinality if and only if there exists a bijection (or a one-to-one correspondence) between them, A ~ B. We split infinite sets into two groups: 1. Sets with the same cardinality as the set of natural numbers 2. Sets with different cardinality as the set of natural numbers
  • 46. 46 Infinite Cardinality Definition: A set is countable if it is finite or has the same cardinality as the set of positive integers. Definition: A set is uncountable if it is not countable. Definition: The cardinality of an infinite set S that is countable is denotes by ‫א‬0 (where ‫א‬ is aleph, the first letter of the Hebrew alphabet). We write |S| = ‫א‬0 and say that S has cardinality “aleph null”. Note: Georg Cantor defined the notion of cardinality and was the first to realize that infinite sets can have different cardinalities. ‫א‬0 is the cardinality of the natural numbers; the next larger cardinality is aleph-one ‫א‬1, then, ‫א‬2 and so on.
  • 47. 47 Infinite Cardinality: Odd Positive Integers Example: The set of odd positive integers is a countable set. Let’s define the function f, from Z+ to the set of odd positive numbers, f(n) = 2 n -1 We have to show that f is both one-to-one and onto. a) one-to-one Suppose f(n)= f(m)  2n-1 = 2m-1  n=m b) onto Suppose that t is an odd positive integer. Then t is 1 less than an even integer 2k, where k is a natural number. hence t=2k-1= f(k).
  • 49. 49 Infinite Cardinality: Integers Example: The set of integers is a countable set. Lets consider the sequence of all integers, starting with 0: 0,1,-1,2,- 2,…. We can define this sequence as a function: oddNn n evenNnn , 2 )1( , 2    f(n) = Show at home that it’s one-to-one and onto 20 1 -1 2
  • 50. 50 Infinite Cardinality: Rational Numbers Example: The set of positive rational numbers is a countable set. Hmm…
  • 51. 51 Infinite Cardinality: Rational Numbers Example: The set of positive rational numbers is a countable set Key aspect to list the rational numbers as a sequence – every positive number is the quotient p/q of two positive integers. Visualization of the proof. p+q=4 p+q=5 p+q=6 Since all positive rational numbers are listed once, the set of positive rational numbers is countable.
  • 52. 52 Uncountable Sets: Cantor's diagonal argument The set of all infinite sequences of zeros and ones is uncountable. Consider a sequence, 10,,,,, 21  iin aoranaaa  For example: So in general we have: i.e., sn,m is the mth element of the nth sequence on the list.
  • 53. 53 It is possible to build a sequence, say s0, in such a way that its first element is different from the first element of the first sequence in the list, its second element is different from the second element of the second sequence in the list, and, in general, its nth element is different from the nth element of the nth sequence in the list. In other words, s0,m will be 0 if sm,m is 1, and s0,m will be 1 if sm,m is 0. Uncountable Sets: Cantor's diagonal argument
  • 54. 54 The sequence s0 is distinct from all the sequences in the list. Why? Let’s say that s0 is identical to the 100th sequence, therefore, s0,100=s100,100. In general, if it appeared as the nth sequence on the list, we would have s0,n = sn,n, which, due to the construction of s0, is impossible. Note: the diagonal elements are highlighted, showing why this is called the diagonal argument Uncountable Sets: Cantor's diagonal argument
  • 55. 55 From this it follows that the set T, consisting of all infinite sequences of zeros and ones, cannot be put into a list s1, s2, s3, ... Otherwise, it would be possible by the above process to construct a sequence s0 which would both be in T (because it is a sequence of 0's and 1's which is by the definition of T in T) and at the same time not in T (because we can deliberately construct it not to be in the list). T, containing all such sequences, must contain s0, which is just such a sequence. But since s0 does not appear anywhere on the list, T cannot contain s0. Therefore T cannot be placed in one-to-one correspondence with the natural numbers. In other words, the set of infinite binary strings is uncountable. Uncountable Sets: Cantor's diagonal argument
  • 56. 56 Real Numbers Example; The set of real numbers is an uncountable set. Let’s assume that the set of real numbers is countable. Therefore any subset of it is also countable, in particular the interval [0,1]. How many real numbers are in interval [0, 1]?
  • 57. 57 Real Numbers How many real numbers are in interval [0, 1]? 0.4 3 2 9 0 1 3 2 9 8 4 2 0 3 9 … 0.8 2 5 9 9 1 3 2 7 2 5 8 9 2 5 … 0.9 2 5 3 9 1 5 9 7 4 5 0 6 2 1 … … “Countably many! There’s part of the list!” “Are you sure they’re all there?” 0.5 3 6 … So we say the reals are “uncountable.” Counterexample: Use diagonalization to create a new number that differs in the ith position of the ith number by 1.