0% found this document useful (0 votes)
53 views

1090 7 Representing Numbers

The document discusses representing numbers through logic and proofs. It covers topics like epsilon-delta proofs, which are key to calculus and analysis. It discusses continuous and converging functions, and how proofs of continuity and convergence follow intuition but are symbol manipulations. The document also discusses vector spaces, graphs, induction, fields, constructing integers, and finite fields. It provides examples and explanations of these topics at a high level, with the overall message being that logical representations and proofs for numbers and structures follow patterns but require precise symbol manipulation.

Uploaded by

Samyak Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

1090 7 Representing Numbers

The document discusses representing numbers through logic and proofs. It covers topics like epsilon-delta proofs, which are key to calculus and analysis. It discusses continuous and converging functions, and how proofs of continuity and convergence follow intuition but are symbol manipulations. The document also discusses vector spaces, graphs, induction, fields, constructing integers, and finite fields. It provides examples and explanations of these topics at a high level, with the overall message being that logical representations and proofs for numbers and structures follow patterns but require precise symbol manipulation.

Uploaded by

Samyak Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 86

Logic for Computer Science

(Representing Numbers)

Calculous Epsilon/Delta Proofs


Vector Spaces
Graphs
Induction
Fields
Constructing Integers
Finite Fields
Proofs for Integers
Finite, Countable, and Uncountable

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)

The proof follows our intuition


but is completely mechanical symbol manipulation
like done in Logic 1090
 af(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

Any finite graph structure can be expressed


by a Predicate logic statement
whose length  size of structure.
Graphs
Every node v has in an out degree 1
"v, $u, & "u, uu  edge(u,v) ]
[edge(u,v) & "w, ww  edge(v,w) ]
& $w, [edge(v,w)

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.

I meant where  quantifies only over nodes.


AB Induction
Proofs with Implications
• If A is true then B is true.
• This may because A causes B.
• The counter positive is B  A
because if B is not true, then A can’t be true
because otherwise B would be true.
Hence B may cause A.
• Or C may cause both A and B.
• Or maybe cause and effect is not involved at all.
• A ⇒ B formally means ¬(A and ¬B)
• Bring the negation in gives ¬A or B
If A is false, then the statement A ⇒ B follows.
If B is true, then A ⇒ B again follows.
Induction
Let S(i) be a statement that for each i maybe true or false.
Goal: Prove that "i S(i).
Proof:
• Prove S(0) is true.
• Prove: "i S(i)  S(i+1)
• Let i be arbitrary.
• Assume that S(i) is true.
• Prove that it follows that S(i+1) is true.
• By way of induction, "i S(i) is true.
S(0)  S(1)  S(2)  S(3)  S(4)  …
Predicate logic statement:
[S(0) & "i S(i)S(i+1)]  "i S(i)
Induction
Predicate logic statement:
[S(0) & "i S(i)S(i+1)]  "i S(i)
Do we KNOW this is true in our universe?

0 i i+1 …

Do we KNOW that this process reaches all i?

S(0)  S(1)  S(2)  S(3)  S(4)  …

Induction is an axiom that we must define to be true.


It says something about the nature of the integers.
Induction
Predicate logic statement:
[S(0) & "i S(i)S(i+1)]  "i S(i)
AB iff BA
º ["i S(i)]  [S(0) & "i S(i)S(i+1)]
$i S(0)
 [S(i)S(i+1)]
or
$i S(i) & S(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.

Ok, I will assume (axioms) as little as I can get away with.


Constructing Integers
Lets start by building the objects: 0,1,2,3,…
In Predicate logic, we can have an infinite number of
objects in your universe.
You can make global statements about them with "i.
You can have a few constants.
Your axioms need to be finite.
Ok, lets start with the constant 0.

In Predicate logic, we have functions like x+y


producing an objects from a pair of objects.

Ok, lets have the function s(i) that given i


returns the successor i+1
Constructing Integers
My integers are
• 0=0
• 1 = s(0)
• 2 = s(s(0))
• 3 = s(s(s(0)))
• 4 = s(s(s(s(0))))
• ….

Remember what happened to the line of nodes.

0 s(0) s(s(0)) s(s(s(0))) That’s as good


as we can do.
We can say s(s(s(s(0))))  0,
but we can only say of few of these.
Constructing Integers
To prove everything about the integers,
I need to know something about addition.
Constructing Integers
I have x and y
Recursion
and must compute • You can have as many
sum(x,y)
friends as you want.
• You give each a sub instance.
I give my friend – Meets the precondition
(x-1) and (y+1). – Smaller
Size = x-1 • Trust them to give you
the output for their instances.
I return sum(x-1,y+1)

I return sum(x-1,y+1) = sum(x,y)


Constructing Integers
I have 0 and y
Recursion
and must compute • If your input has size zero,
sum(0,y)
you must solve it yourself.
I return y
Constructing Integers
x=4
y=5 My responsibility is
x+y = to ensure that my
algorithm works
under the assumption
that my friends do
their job correctly.
Stack Frame:
A particular execution
of one routine
on one particular input instance.

Lets trace out the


execution
on a computer.

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.

Lets trace out the


execution
on a computer.

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.

This tells me that what x+y does can be captured by


• "y, sum(0,y) = y
• "x&y, sum(s(x),y) = sum(x,s(y))

Similarly for xy,


• "y, mult(0,y) = 0
• "x&y, mult(s(x),y) = sum( mult(x,y), y )

Similarly for yx,


• "y, exp(y,0) = 1
• "x&y, exp(y,s(x)) = mult( exp(y,x), y )
Constructing Integers
To prove everything about the integers,
I need to know something about addition.

This tells me that what x-y does can be captured by


• "x&y, z, y+z=x

Similarly for x/y,


• "x&y, z, yz= x

Similarly for logy(x),


• "x&y, z, yz = x
Constructing Integers
Actually we only consider
positive integers.

This tells me that what x-y does can be captured by


• "x&y, z, y+z=x max(x-y,0)
or (y>x and z=0)

Similarly for x/y, x/y 


• "x&y, z, yz=≤x
and y(z+1)>x

Similarly for logy(x), logy(x) 


• "x&y, z, yz =≤x
and y(z+1) >x
Constructing Integers
There. If we insist on all of these things,
then we must get the integers!

I’m afraid not.


No fixed length Predicate logic statement  say:
“The universe only has an finite/infinite number of ints.”
Proof:
• To talk about k integers, we need ||  k
• But here k=. No finite  is long enough.
Finite Fields
+ 0 1 2 3 4
•Integers mod 5 (Z/5)
•Universe U = {0,1,2,3,4} 0 0 1 2 3 4
•Two operations + and × 1 1 2 3 4 0
• 3+4 = 7 =mod 5 2 2 2 3 4 0 1
• 3×4 = 12 =mod 5 2 3 3 4 0 1 2
4 4 0 1 2 3
•Don’t think of mod 5
as a function mod5(7) = 2. × 0 1 2 3 4
•Think of it as equivalence classes 0 0 0 0 0 0
… -8 =mod 5 -3 =mod 5 2 =mod 5 7 … 1 0 1 2 3 4
•Must prove + & × are well defined 2 0 2 4 1 3
[a]modp × [b]modp = [a+ip]×[b+jp] 3 0 3 1 4 2
= a×b + (aj+bi+ijp)p 4 0 4 3 2 1
Finite Fields
+ 0 1 2 3 4
My integer construction is not violated.
0 0 1 2 3 4
0, s(0), s(s(0)), s(s(s(0))), s(s(s(s(0))))
1 1 2 3 4 0
5 =0 mod 5
2 2 3 4 0 1
s(s(s(s(s(0))))) = 0 3 3 4 0 1 2
4 4 0 1 2 3
"y, sum(0,y) = y
• "x&y, sum(s(x),y) = sum(x,s(y)) × 0 1 2 3 4
0 0 0 0 0 0
Similarly for xy, 1 0 1 2 3 4
• "y, mult(0,y) = 0
• "x&y, 2 0 2 4 1 3
mult(s(x),y) = sum( mult(x,y), y ) 3 0 3 1 4 2
4 0 4 3 2 1
Finite Fields
+ 0 1 2 3 4
•Special value 0
0 0 1 2 3 4
• a+0 = a
• a×0 = 0 1 1 2 3 4 0
•Special value 1 2 2 3 4 0 1
• a×1 = a 3 3 4 0 1 2
4 4 0 1 2 3
× 0 1 2 3 4
0 0 0 0 0 0
1 0 1 2 3 4
2 0 2 4 1 3
3 0 3 1 4 2
4 0 4 3 2 1
Finite Fields
+ 0 1 2 3 4
0 0 1 2 3 4
•Associative:
1 1 2 3 4 0
•a+(b+c) = (a+b)+c
•a×(b×c) = (a×b)×c 2 2 3 4 0 1
•Commutative: 3 3 4 0 1 2
•a+b = b+a 4 4 0 1 2 3
•a×b = b×a
•Distributive: × 0 1 2 3 4
•a×(b+c) = a×b + a×c 0 0 0 0 0 0
1 0 1 2 3 4
2 0 2 4 1 3
3 0 3 1 4 2
4 0 4 3 2 1
Finite Fields
+ 0 1 2 3 4
•Inverses:
0 0 1 2 3 4
• "a $ b a+b=0, i.e. b=-a
?
•2+(-2) =mod 5 0 1 1 2 3 4 0
•2 + 3 = 5 =mod 5 0 2 2 3 4 0 1
• "a≠0 $b a×b=1, i.e. b=a -1 3 3 4 0 1 2
?
•2×(½) =mod 5 1 4 4 0 1 2 3
•2×3 = 6 =mod 5 1
× 0 1 2 3 4
Such inverse always exist 0 0 0 0 0 0
iff 1 0 1 2 3 4
mod prime p
2 0 2 4 1 3
•Integers mod prime p  field: 3 0 3 1 4 2
• "prime p "a $ b a×b=mod p1 4 0 4 3 2 1
Finite Fields

•Problems for computers:


•Reals
•Too much space
•Lack of precision
•Integers
•Lack of inverses
•Grow too big
•Better field?
•Finite field, eg integers mod a prime
Proofs for Integers
I still want to prove everything about the integers
Prove:
{All these assumptions/axioms }
⇒ some great fact you want to prove about the integers.
Then you get for free:
Integers
⇒{All these assumptions/axioms }
⇒ some great fact you want to prove about the integers.
•Description Length and Carnality
•Countable
•Countable via a List

•Uncountable
Not covered

•Countable via Finite Descriptions

•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

S1 = {  |  is a 0/1 string of length arbitrarily long but finite }


interpret  as the description of an integer in binary eg 1012=5
= { n | n is an integer }
interpret  as an ascii string eg “cat”
= { s | s is a finite string in ascii }
interpret  as the description of a fraction eg “3/4”
= { x | x is a fraction/rational }
interpret  as the description of a Turing Machine / Alg
= { M | M is a TM }

|S1| = 2 arbitrarily long but finite = |Integers| = countable


Uncountable
S0 = {  |  is a 0/1 string of length 5 }
|S0| = 25 2 choices  2 choices  …  2 choices
S2 = {  |  is a 0/1 string of length infinite }
interpret  as the description of a real in binary eg 0.10010…2
01234…
= { r | r is a real in (0..1) }
interpret  as a function from ints to {0,1}
eg f(0) = 1, f(1) = 0, f(2) = 0, f(3) = 1, f(4) = 0, …
= { f | f:ints{0,1} }
interpret  as a function from finite strings to {N,Y}
eg L(0) = Y, L(1) = N, L(10) = N, L(11) = Y, L(100) = N, …
ie L is a language.
= { L | L:strings{0,1} } = { L | L is a language }
= { P | P is a computational problem }
infinite = |Reals| = uncountable
|S2| = 2
Description Length vs Cardnality

|””| |{}|
= 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

A finite set contains some integer number of elements.


•{ , 4, }
The size of an infinite set is bigger than any integer.
•The set of natural numbers N = {1,2,3,4,… }
•The set of fractions Q = {1/2, 2/3, ... }
•The set of reals R = {2.34323…, 34.2233…, , e, …}
Are these infinite sets the same “size”?
Two sets have the same size
if there is a bijection between them.
|{ , 4, }|
= |{ 1, 2, 3 }| = 3
Cantor (1874)
Countable Infinity

Do N and E have the same


cardinality?

N = { 0, 1, 2, 3, 4, 5, 6, 7, …. }

E = The even, natural numbers.


Countable Infinity

E and N do not have the same


cardinality!
E is a proper subset of N with
plenty left over.

0, 1, 2, 3, 4, 5, 6, 7, 8,….
0, 2, 4, 6, 8,….

f(x)=x is not a bijection.


Countable Infinity

E and N do have the same


cardinality!

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.

Not that all 1-1 correspondences


are onto.

This distinction never arises when the


sets are finite.
Countable Infinity

If this makes you feel


uncomfortable…..

TOUGH! It is the price that you


must pay to reason about infinity
Countable Infinity

•The set of integers N = {1,2,3,4,… }


•The set of fractions Q = {1/2, 2/3, ... }

Are these infinite sets the same “size”?


Two sets have the same size
if there is a mapping between them.
|{ , 4, }|
= |{ 1, 2, 3 }| = 3
Countable Infinity

•The set of integers N = {1,2,3,4,… }


•The set of fractions Q = {1/2, 2/3, ... 1,2,3,4,… }
Q looks bigger.
Are these infinite sets the same “size”?
Two sets have the same size
if there is a mapping between them.
|{ , 4, }|
= |{ 1, 2, 3 }| = 3
Countable Infinity

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

Don’t jump to conclusions!


There is a clever way to list
the rationals, one at a time,
without missing a single
one!
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|

• There is a list containing each object


List, xϵS,  iϵN List(i) = x
Each integer (index in list)
i x = List(i) lists at most one object xϵS
1:
Each object xϵS
2: appears some where in the list

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.

61 70 70 6C 65 63 68 61 69 72 Convert each character


66 6F 75 72 to Hex-Ascii.
Concatenate the Hex
≤ |{ 6170706C65, 666F7572, 6368616972, … }|
into one Hex integer.
≤ |{ 1, 2, 3, 4, 5, … }| = |N| The number of such
integers is at most the
number of integers.
Hence, this set of
objects is countable.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of fractions
|Q| = |{1/2, 2/3, 11/8 ,... }| Give each object a
finite description.
“1/2 ” “2/3” “11/8” Break each description
into a string of characters.
‘1’ ‘/’ ‘2 ‘2’ ‘/’ ‘3’ ‘1’ ‘1’ ‘/’ ‘8’
Convert each character
31 2F 32 32 2F 32 31 31 2F 38
to Hex-Ascii.
Concatenate the Hex
≤ |{312F32, 322F32, 31312F38, … }| into one Hex integer.
The number of such
≤ |{ 1, 2, 3, 4, 5, … }| = |N| integers is at most the
number of integers.
Hence, this set of
objects is countable.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of finite sets of integers
|S| = |{ {3,23,…,98}. ... }| Give each object a
finite description.
“{3,23,…,98}”
Break each description
into a string of characters.
‘{’ ‘3’ ‘,’ ‘2’ ‘3’ ‘,’ …. ‘,’ ‘9’ ‘8’ ‘3’ ‘7’ ‘}’

7B 33 2C 32 32 2C … 2C 39 38 33 37 7D Convert each character


to Hex-Ascii.
7B332C32322C…2C393833377D Concatenate the Hex
into one Hex integer.
≤ |{ 1, 2, 3, 4, 5, … }| = |N| The number of such
integers is at most the
number of integers.
Hence, this set of
objects is countable.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of finite sets of integers
|S| = |{ {3,23,…,98}. ... }| Give each object a
finite description.
“{3,23,…,98}” “{23,3,…,98}”
It is ok if an object
‘{’ ‘3’ ‘,’ ‘2’ ‘3’ ‘,’ …. ‘,’ ‘9’ ‘8’ ‘3’ ‘7’ ‘}’ is given more than
one description.
7B 33 2C 32 32 2C … 2C 39 38 33 37 7D
As long as each
7B332C32322C…2C393833377D description
uniquely identifies
≤ |{ 1, 2, 3, 4, 5, … }| = |N| an object.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of reals
|R| = |{2.34323…, 34.2233…, , e, …}| Give each object a
finite description.

Does  or e require and infinite description?


No. , e describe them just fine.

Does 0.101001000100001000001…. needs an infinite description.


0 1 2 3 4 5
No. I just describe it just fine.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of reals
|R| = |{2.34323…, 34.2233…, , e, …}| Give each object a
finite description.

We say that a real number x repeats if the


pattern of digits repeats after a finite number
0.345 123 123 123 123 123…
Is the set of all repeating real numbers countable.
Yes. Each has a distinguishing finite description, namely
0.345123
x = 0.345 123 123 123 123 123…
1000x = 345. 123 123 123 123 123…
999x = 345
x = 345/999
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of reals
|R| = |{2.34323…, 34.2233…, , e, …}| Give each object a
finite description.

We say that a real number x is computable


if there exists a TM M that on no input will print out
each of its digits in decimal notation, 3.4642946….
Given that a real number has an infinite number of
digits, at no point will it have printed out all of its digits.
But for every integer i, at some point in time, M will
have printed out the first i digits of x.
Is the set of all computable real numbers countable.
Yes. Each computable number has a distinguishing
finite description, namely this TM M.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of reals
|R| = |{2.34323…, 34.2233…, , e, …}| Give each object a
finite description.

Tell me a real number that needs an infinite description.


Impossible. If you can tell it to me,
then it has a finite description.
We say that a real number x is random if it is produced
by flipping a 10 sided dice for each of its infinite
number of digits.
Is the set of all random real numbers countable.
No. Each random number does need an
infinite amount of information to specify it.
Countable Infinity
A set S is called countable if |S| ≤ |N|
The set of reals
|R| = |{2.34323…, 34.2233…, , e, …}| Give each object a
finite description.
Most real seems to require an infinite description.
|R| >> |{ 1, 2, 3, … }| = |N|

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

Each integer i is able to hit at most one element List(i)=xϵS.


If this can hit every element of element xϵS,
then |S| ≤ |N|.
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
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

You might also like