Transcript Lecture 6

Lecture 6
• Topics
– Proof of the existence of unsolvable problems
• Problems/languages not in REC
• Proof Technique
– There are more problems/languages than
programs/algorithms
– Countable and uncountable infinities
1
Overview
• We will show that there are more languages
than algorithms
– Actually more languages than programs in any
computational model (programming language)
• Implication
– Some problems are not solvable
2
How do we compare the relative
sizes of infinite sets?
Bijection (yes)
Proper subset (no)
3
Bijections
• Two sets have EQUAL size if there exists a
bijection between them
– bijection is a 1-1 and onto function between
two sets
• Examples
– Set {1, 2, 3} and Set {A, B, C}
– Positive even numbers and positive integers
4
Bijection Example
• Positive Integers Positive Even Integers
1
2
3
...
i
…
2
4
6
...
2i
...
5
Proper subset
• Finite sets
– S1 proper subset of S2 implies S2 is strictly
bigger than S1
• Example
– women proper subset of people
– number of women less than number of people
• Infinite sets
– Counterexample
• even numbers and integers
6
Two sizes of infinity
Countable
Uncountable
7
Countably infinite set S
• Definition 1
– S is equal in size (bijection) to N
• N is the set of natural numbers {1, 2, 3, …}
• Definition 2 (Key property)
– There exists a way to list all the elements of set
S (enumerate S) such that the following is true
• Every element appears at a finite position in the
infinite list
8
Uncountable infinity
• Any set which is not countably infinite
• Examples
– Set of real numbers
– Set of all languages
• Further gradations within this set, but we
ignore them
9
The set of all algorithms is
countably infinite
• Every algorithm can be represented as a C++
program
– Church’s Thesis
• Every C++ program is a finite string
• Thus, the set of all legal C++ programs is a
language LC
• This language LC is a subset of *
10
* is countably infinite
• Enumeration ordering
– All length 0 strings
• ||0 = 1 string: l
– All length 1 strings
• || strings
– All length 2 strings
• ||2 strings
– ...
11
The set of all languages is
uncountably infinite
• Diagonalization proof technique
– Proof by contradiction
12
High Level Proof
• Assume that the set is countably infinite
• This implies there exists a list L where
– Every language is Li for some number i
– No other assumptions about L
• Using L, we construct a new language D
which is not on L
– Contradiction: L cannot exist
• Thus the uncountably infinite result follows
13
Representing L
L0
L1
L2
L3
L4
l
0
1
00 01 ...
IN
IN
IN
IN
IN
IN OUT IN OUT IN
OUT OUT OUT OUT OUT
OUT IN
IN OUT OUT
•#Rows is countably infinite
•By assumption
•#Cols is countably infinite
• * is countably infinite
OUT IN OUT OUT IN
...
• Consider each string to be a feature
– A set contains or does not contain each string
14
Constructing D
• We construct D by using a unique feature
(string) to differentiate D from Li
– Typically use ith string for language Li
– Thus the name diagonalization
D
l
0
L0
L1
L2
OUT
IN IN
L3
L4
OUT IN
1
00 01 ...
IN
IN
IN
IN OUT
IN IN OUT IN
OUT OUT OUT
IN OUT OUT
IN OUT
IN OUT
OUT IN OUT OUT OUT
IN
...
15
Questions
L0
L1
L2
L3
L4
l
0
1
00 01 ...
IN
IN
IN
IN
IN
IN OUT IN OUT IN
OUT OUT OUT OUT OUT
OUT IN
IN OUT OUT
OUT IN OUT OUT IN
...
• Do we need to use the diagonal?
– Every other column and every row?
– Every other row and every column?
• What properties are needed to construct D?
16
Languages
REC
REC is a proper subset of the set of all languages.
17
Summary
• Equal size infinite sets: bijections
– Countable and uncountable infinities
• More languages than algorithms
– Number of algorithms countably infinite
– Number of languages uncountably infinite
– Diagonalization technique
• Construct D using infinite set of features
• REC is a proper subset of the set of all
languages
18