1090 7 Representing Numbers
1090 7 Representing Numbers
(Representing Numbers)
Jeff Edmonds
Lecture 7 York University
Representing Numbers
Continuous & Converging
Epsilon Delta Proofs: Key to calculus, analysis, and set theory.
Continuous & Converging
Continuous:
Let the function f(x) be from reals to reals.
f is said to be continuous everywhere
iff "x, f is continuous at x
iff "x, for an arbitrary definition of closeness,
as x' approaches x
f(x') stays close to f(x).
iff "x, ">0, within a sufficiently small range near x,
f does not vary by more than
iff "x, ">0, $>0, "x'[x-,x+], |f(x')-f(x)|<
f(x')
f(x)
f(x)
x'
x
Continuous & Converging
Converge: Consider the infinite sequence.
It is said to converge to the value a
iff for an arbitrary definition of closeness,
the sequence eventually gets and stays close to a
iff ">0, $i, "i'i, |ai'-ai|<.
a
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ….
i'
Continuous & Converging
Try to prove the follow:
• Assume that f(x) is continuous everywhere.
• As 1, 2, 3, 4, 5, … goes to infinity,
• 1
/1, 1/2, 1/3, 1/4, 1/5, … converges to 0
• f(1/1), f(1/2), f(1/3), f(1/4), f(1/5), … converges to f(0)
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ….
i i'
Continuous & Converging
Intermediate Value Theorem:
• "f where f(x) is a continuous function from the reals to the reals
• "a,b with f(a)<0 and f(b)>0,
• $r[a,b] for which f(r)=0.
Binary search gets you closer and closer but not there.
The proof follows our intuition
but is completely mechanical symbol manipulation
like done in Logic 1090
0
f(x)
a r b
Actually, Predicate logic only allows quantification over simple objects.
Here f is a function, so "f is technically second order logic.
Vector Spaces
• A basis of a vector space:
• A tuple [w1,w2,…,wd] of “vectors”
• Linearly independent (none is sum of the others)
• Spans the space uniquely
" vectors v in the entire space
$ real coeficients [a1,a2,…,ad]
so that v is this linear combination of the basis vectors,
v = a1w1+a2w2 +… + adwd
Basis = [w1,w2,…,wd] = [ , ]
v= [a1,a2,…,ad] = [3,-1]
Graphs
Graph: Edges between the nodes (Directed or undirected)
9
Graphs
Graph: Edges between the nodes (Directed or undirected)
Eg: Cities and roads
10
Graphs
Graph: Edges between the nodes (Directed or undirected)
Eg: Computers and networks
11
Graphs
Graph: Edges between the nodes (Directed or undirected)
Eg: Social Networks
12
Graphs
Every node u is in a triangle
"u, $v&w, edge(u,v)edge(u,w)edge(v,w)
u v
u
u v w
u
Does the graph need to be infinite?
Is this it?
Graphs
• Graph G has an finite/infinite number of nodes.
• G is connected.
No fixed length Predicate logic statement can say these.
Proof:
• To talk about k nodes of the graph, we need || k
• ", $G with |G| >> ||, is to short to say
G is connected.
Not completely true. I can say:
" nodes uv $ Path P connecting u to v.
" nodes uv $ integer P encoding a path connecting u to v.
0 i i+1 …
or
S(0) S(1) S(2) S(3) S(4) …
Induction
Claim: Every positive integer is special.
Proof:
• Clearly 0 is special.
• By way of contradiction assume they are not all special.
• Let i be the smallest integer that is not special.
• Well having that distinction would make i very special.
• This contradicts i not being special.
• Hence, every positive integer must be special.
or special
special special special special not special
S(0) S(1) S(2) S(3) S(4) …
Induction
Claim: Every positive integer is special.
Proof:
• Clearly 0 is special.
• By way of contradiction assume they are not all special.
• Let i be the smallest integer that is not special.
• Well having that distinction would make i very special.
• This contradicts i not being special.
• Hence, every positive integer must be special.
or special
special special special special not special
S(0) S(1) S(2) S(3) S(4) …
•A Field has: Fields
•A universe U of values
•Two operations: + and ×
•+ Identity: $0 "a a+0 = a
•× Identity: $1 "a a×1 = a
• "a,b,c
•Associative: a+(b+c) = (a+b)+c & a×(b×c) = (a×b)×c
•Commutative: a+b = b+a & a×b = b×a No
•Distributive: a×(b+c) = (a×b) + (a×c) Differentiates
•+ Inverse: "a $ b a+b=0, i.e. b=-a between
•× Inverse: "a≠0 $b a×b=1, i.e. b=a-1 No + and ×
•Examples:
•Reals, Rationals, & Complex Numbers
•Integers ?
•Invertible Matrices ?
•A Field has: Fields
•A universe U of values
•Two operations: + and ×
•+ Identity: $0 "a a+0 = a (& a×0 = 0)
•× Identity: $1 "a a×1 = a
• "a,b,c
•Associative: a+(b+c) = (a+b)+c & a×(b×c) = (a×b)×c
•Commutative: a+b = b+a & a×b = b×a
•Distributive: a×(b+c) = (a×b) + (a×c)
•+ Inverse: "a $ b a+b=0, i.e. b=-a
•× Inverse: "a≠0 $b a×b=1, i.e. b=a-1
•Does a×0 = 0 ?
Proof: a×0 = (a×0)+0 = (a×0) + (a+(-a))
= ((a×0)+a) + (-a) = ((a×0)+(a×1)) + (-a)
= (a×(0+1)) + (-a) = (a×1) + (-a) = a + (-a) = 0
Constructing Integers
I want to prove everything about the integers
If you start assuming you know nothing about them,
then you can’t start.
If you start assuming you know lots,
then there is nothing left to do.
30
Constructing Integers
x=4
y=5
x+y =
x=3
y=6 My responsibility is
x+y = to ensure that my
algorithm works
Our friend is under the assumption
• a separate execution that my friends do
• with separate stack frame their job correctly.
• with its own local variables.
31
Constructing Integers
x=4
y=5
x+y = 9
x=3
y=6
x+y = 9
x=2
y=7
x+y = 9
x=1
y=8
x+y = 9
Lets trace out the x=0
execution y=9
on a computer. x+y = 9
32
Constructing Integers
To prove everything about the integers,
I need to know something about addition.
•Uncountable
Not covered
•Hierarchy of Infinities
•Some Uncomputable Problem
Lecture 6.0
Jeff Edmonds
York University
COSC 2001
Finite
S = { a | a is a planck size quantum in the universe }
Planck’s length = 10-35 m.
Width of universe = 100 billion light years
= 1027 m.
= 1062 planck’s lengths.
|S| = volume = (width)3 = 10186 planck size quantum
= finite
Anything bigger is not really of this reality.
Countably Infinite
S0 = { | is a 0/1 string of length 5 }
|S0| = 25 2 choices 2 choices … 2 choices
|””| |{}|
= length of = cardnality of
description of set containing all
each item such items
Finite 5 25
Integers Arbitrarily long Countably Infinite
but finite
Reals Infinite Uncountable
(countable)
Some Uncomputable Problem
|Integers| = |Fractions| << |Reals|
Each defined by Each defined by Most defined by
a finite string a finite string an infinite string
Set of TM/Algorithms
• Each defined by
<< Set of Comp. Problems
•For each input I,
a finite string must define what P does.
• Countable in size •Most defined by
an infinite string
•Uncountable in size
Most problems
do not have P M I M(I)≠P(I)
an algorithm!!!
End
Countable Infinity
N = { 0, 1, 2, 3, 4, 5, 6, 7, …. }
0, 1, 2, 3, 4, 5, 6, 7, 8,….
0, 2, 4, 6, 8,….
0, 1, 2, 3, 4, 5, ….…
0, 2, 4, 6, 8,10, ….
f(x) = 2x is a bijection
Countable Infinity
Lesson:
Cantor’s definition only requires that
bijection between the two sets.
No way!
The rationals are dense:
between any two there is a
third. You can’t list them one
by one without leaving out an
infinite number of them.
Countable Infinity
...
6 6
/1 6
/2 6
/3 6
/4 6
/5 6
/6 6
/7 6
/8 All positive
5 5
/1 5
/2 5
/3 5
/4 5
/5 5
/6 5
/7 5
/8 fractions
4 4
/1 4
/2 4
/3 4
/4 4
/5 4
/6 4
/7 4
/8
3 3
/1 3
/2 3
/3 3
/4 3
/5 3
/6
/8 3
/7 3
2 2
/1 2
/2 2
/3 2
/4 2
2 /5
/6 2/7 2/8
Count them
1 1
/1 1
/2 1
/3 1
/4
1
/5 1/6 1/7 1/8
... by mapping.
1 2 3 4 5 6 7 8
Oops we never
get to 2/1!
{ 1, 2, 3, 4, 5, 6, …. } All positive integers
Countable Infinity
...
...
6 6
/1 6
/2 6
/3 6
/4 6
/5 6
/6 6
/7 6
/8 All positive
5 5
/1 5
/2 5
/3 5
/4 5
/5 5
/6 5
/7 5
/8 fractions
4 4
/1 4
/2 4
/3 4
/4 4
/5 4
/6 4
/7 4
/8 Over counting just
means we proved
3 3
/1 3
/2 3
/3 3
/4 3
/5
/8 3
/6 3
/7 3
|N|≥|Q|
2 2
/1
2
/2 2
/3 2
2 /4 /5
/6 2/7 2/8
2
Count them
1 /1 /2
1 1 1
/3
1 1
/4
/5 1/6 1/7 1/8
... by mapping.
1 2 3 4 5 6 7 8
Every rational gets |N|=|Q|
mapped to some integer! Q is “Countable”
{ 1, 2, 3, 4, 5, 6, …. } All positive integers
Countable Infinity
How is it that we can loop
loop a,b,c ≥ 0 over all tuples a,b,c
print(a,b,c); ensuring that we eventually
end loop get to each?
loop a ≥ 0
No, this inner loop will
loop b ≥ 0 never exit.
loop c ≥ 0 We will never get to b=1
print(a,b,c);
Countable Infinity
How is it that we can loop
loop a,b,c ≥ 0 over all tuples a,b,c
print(a,b,c); ensuring that we eventually
end loop get to each?
Though this will
never list them all.
loop sum = 0,1,2,….. Each a,b,c will
loop a = 0,…,sum eventually be listed.
loop b = 0,…,sum-a Eg: 3,7,5 gets printed
c = sum-a-b when sum = 15, a=3,
print(a,b,c); and b=7.
The set of tuples
{a,b,c} is countable.
Countable Infinity
A set S is called countable if |S| ≤ |N|
|S| = |{ , 4, , ….. }|
≤ |{ 1, 2, 3, 4, 5, … }| = |N|
Note a finite set is countable.
If also |S| ≥ |N|, then S is called countably infinite.
Countable Infinity
A set S is called countable if |S| ≤ |N|
|S| = |{ , 4, , ….. }|
≤ |{ 1, 2, 3, 4, 5, … }| = |N|
3: 4
4:
5:
Countable Infinity
A set S is called countable if |S| ≤ |N|
|S| = |{ , 4, , ….. }|
Give each object a
“apple” “four” “chair”
finite description.
≤ |{ 1, 2, 3, 4, 5, … }| = |N|
Two equivalent definitions of a set S being “Countable”
• There is a list containing each object
List, xϵS, iϵN List(i) = x
• Each object xϵS has (at least one) finite description
such that each description uniquely identifies that object.
My name is
Herr Dr Professor Wizard the great great great ….
Just because you have an I call
infinite name does not mean the you
set { } is not countable! Bob
Countable Infinity
A set S is called countable if |S| ≤ |N|
|S| = |{ , 4, , ….. }|
Give each object a
“apple” “four” “chair”
finite description.
≤ |{ 1, 2, 3, 4, 5, … }| = |N|
Two equivalent definitions of a set S being “Countable”
• There is a list containing each object
List, xϵS, iϵN List(i) = x
• Each object xϵS has (at least one) finite description
such that each description uniquely identifies that object.
Language, xϵS, nameϵASCII* Language(name) = x
|S| ≤ |ASCII*| ≤ |N|
Countable Infinity
A set S is called countable if |S| ≤ |N|
|S| = |{ , 4, , ….. }|
Give each object a
“apple” “four” “chair”
finite description.
‘a’ ‘p’ ‘p’ ‘l’ ‘e’ ‘c’ ‘h’ ‘a’ ‘i’ ‘r’ Break each description
‘f’ ‘o’ ‘u’ ‘r’ into a string of characters.
loop reals r
print(r)
end loop Can we loop over all reals
ensuring that we eventually
get to each?
No!
Uncountable Infinity
A set S is called countable if |S| ≤ |N|
|S| = |{ , 4, , ….. }|
≤ |{ 1, 2, 3, 4, 5, … }| = |N|
List, xϵS, iϵN List(i) = x
≤ |{ 1, 2, 3, 4, 5, … }| = |N|
List, xϵS, iϵN List(i) = x
A set S is called uncountable if |S| > |N|
List, xϵS, iϵN List(i)≠x
i.e. find an x is not mapped to any natural number.
Proof by game:
•Let List be an arbitrary mapping from N likely to S.
•I construct a value xϵS.
•Let i be an arbitrary natural number.
•I prove that List(i)≠x
Uncountable Infinity
Proof that |R| > |N| i.e. List, xϵR, iϵN List(i)≠x
•Let List be an arbitrary mapping from N to R.
i x=List(i)
1 12.34323834749308477599304 …
2 8.50949039988484877588487 …
3 930.93994885783998573895002 … Proof by
4 34.39498837792008948859069 … Diagonalization
5 0.00343988348757590125473 …
6 …..
•We find a real number xdiagonal that is not in the list.
The ith digit will be the ith digit of the ith number List(i)
increased by one (mod 10). •Let i be arbitrary in N.
•I prove that List(i)≠xdiagonal
xdiagonal = 0.41004 …
They differ in the ith digit
Uncountable Infinity
Proof that |R| > |N| i.e. List, xϵR, iϵN List(i)≠x
List
List
List
List
List
List
Hierarchy of Infinities
|Integers| = |Fractions| << |Reals|
Each defined by Each defined by Most defined by
a finite string a finite string an infinite string
Set of finite subsets of the integers
{{2,3},{1,3,5,6}, … }
Each defined by a finite string
The set is countable in size
Set of possibly infinite subsets of the integers
{{2,3,…},{1,3,…}, … }
Most defined by a infinite string
The set is uncountable in size
Hierarchy of Infinities
<< |Reals|
Most defined by
an infinite string
Set of finite subsets of the reals
{{2.394..,3.3563..},{1.982..,3.345..,5.32..}, … }
Each defined by a string of countably infinite length.
The set is same size as the reals
Set of possibly infinite subsets of the reals
{{2.394..,3.3563..,…},{1.982..,3.345..,…}, … }
Each defined by a string of uncountably infinite length.
The set is much bigger than the reals!
There is an infinite hierarchy of infinities!
Some Uncomputable Problem
P M I M(I)≠P(I)
|Integers| = |Fractions| << |Reals|
Each defined by Each defined by Most defined by
a finite string a finite string an infinite string
Set of TM/Algorithms
• Each defined by
<< Set of Comp. Problems
•For each input I,
a finite string must define what P does.
• Countable in size •Most defined by
an infinite string
•Uncountable in size
Most problems
do not have
an algorithm!!!
Some Uncomputable Problem
P M I M(I)≠P(I) Some problem
Computable
Known
GCD
End