Lecture 7
Lecture 7
Adnane Saoud
1
Summary of lecture 6
Lecture 6
§ Turing machines
§ Recognizers and deciders
§ Equivalence of variants of the Turing machine model
§ Church-Turing Thesis
Lecture 7
§ Notation for encodings and TMs
§ Decidability of various problems about automata and grammars:
§ Decidability for TMs.
§ Diagonalization method
§ The reducibility method
2
Church-Turing Thesis ~1936
Algorithm = Turing
machine
Intuitive Formal
3
Hilbert’s 10th Problem
In 1900 David Hilbert posed 23 problems
#10) Give an algorithm for solving Diophantine equations.
Diophantine equations:
Equations of polynomials where solutions must be integers.
Example: 3𝑥 ! − 2𝑥𝑦 − 𝑦 ! 𝑧 = 7 solution: 𝑥 = 1, 𝑦 = 2, 𝑧 = −2
Note: 𝐷 is T-recognizable.
4
Notation for encodings
5
Notation for encodings and TMs
6
TM – example revisited
TM 𝑀 recognizing 𝐵 = a! b! c! 𝑘 ≥ 0
𝑀 = “On input 𝑤
1. Check if 𝑤 ∈ a∗ b∗ c∗ , reject if not.
2. Count the number of a’s, b’s, and c’s in 𝑤.
3. Accept if all counts are equal; reject if not.”
7
Decidability of DFAs
and NFAs
8
Acceptance Problem for DFAs
10
Emptiness Problem for DFAs
11
Equivalence problem for DFAs
𝐿 𝐴 𝐿 𝐵
Symmetric difference
12
Equivalence problem for DFAs
Exercise:
Let 𝐸𝑄REX = { 𝑅" , 𝑅! | 𝑅" and 𝑅! are regular expressions and 𝐿 𝑅" = 𝐿 𝑅! }
Can we now conclude that 𝐸𝑄REX is decidable?
a) Yes, it follows immediately from things we’ve already shown.
b) Yes, but it would take significant additional work.
c) No, intersection is not a regular operation.
13
Decidability of GFGs
14
Acceptance Problem for CFGs
Let 𝐴CFG = { 𝐺, 𝑤 | 𝐺 is a CFG and 𝑤 ∈ 𝐿 𝐺 }
Theorem: ACFG is decidable
Proof: Give TM 𝐷A−CFG that decides 𝐴CFG .
𝐷A−CFG = “On input 𝐺, 𝑤
1. Convert 𝐺 into CNF.
2. Try all derivations of length 2|𝑤| − 1.
3. Accept if any generate 𝑤.
Reject if not. Recall Chomsky Normal Form (CNF) only allows
rules:
A → BC
B→b
15
Acceptance Problem for CFGs
Let 𝐴CFG = { 𝐺, 𝑤 | 𝐺 is a CFG and 𝑤 ∈ 𝐿 𝐺 }
Theorem: ACFG is decidable
Proof: Give TM 𝐷A−CFG that decides 𝐴CFG .
𝐷A−CFG = “On input 𝐺, 𝑤
1. Convert 𝐺 into CNF.
2. Try all derivations of length 2|𝑤| − 1.
3. Accept if any generate 𝑤.
Reject if not.
16
Acceptance Problem for CFGs
Exercise:
Can we conclude that 𝐴PDA is decidable?
a) Yes.
b) No, PDAs may be nondeterministic.
c) No, PDAs may not halt.
17
Emptiness Problem for CFGs
18
Equivalence Problem for CFGs
19
Equivalence Problem for CFGs
Exercise:
Why can’t we use the same technique we used to show 𝐸𝑄DFA is decidable
to show that 𝐸𝑄CFG is decidable?
20
Decidability of TMs
21
Acceptance Problem for TMs
Description of 𝑀, input 𝑤
𝑈
22
Acceptance Problem for TMs
23
The Size of Infinity
Informally, two sets have the same size if we can pair up their members.
This definition works for finite sets.
Apply it to infinite sets too.
24
Countable Sets
Let ℚ+ = ,⁄ 6 -3
- 𝑚, 𝑛 ∈ ℕ} 7 3
Show ℕ and ℚ& have the same size ⋮ ⋮
27