Professional Documents
Culture Documents
Csci471 Intro Lecture 6
Csci471 Intro Lecture 6
LECTURE 6
Today:
• Undecidable Languages
1
Meiram Murzabulatov
A universal Turing Machine
• Since TMs and programs are equivalent, we can think of TMs as
programs.
• Since programs are strings, we can consider languages whose
elements are programs.
• 〈M〉denotes an encoding of a TM M as a string
Theorem. We can make a Universal TM, a TM that takes any TM
description〈M〉 and any string w as input and simulates the
computation of M on w. 〈M,w〉
〈M〉 encoding of M
FINITE
CONTROL
〈 w〉 tape contents 〈w〉= 〈w1,…,wn〉
〈 q 0〉 state
Encodings of DFAs, NFAs, CFGs, etc
EQDFA = { 〈𝐷!, 𝐷"〉 | 𝐷!, 𝐷" are DFAs and 𝐿(𝐷!) = 𝐿(𝐷") }
A bijection 𝑓: ℕ → 𝔼 𝐢𝐬 𝑓 𝑛 = 2𝑛
Meiram Murzabulatov; based on slides by Sofya Raskhodnikova 15
Are there uncountable sets?
An element of L: a
An element of P(L): {a} or {b} or {a,b}
Let S = { x Î L | x Ï f(x) }
L = {a, b} P(L) ={Ø, {a}, {b}, {a,b}}
f(a)={b} f(b)={a,b}
a is not an element of f(a)={b}, so S={a}
b is an element of f(b)={a,b}, so S={a} (b is not in S)
Meiram Murzabulatov; based on slides by Sofya Raskhodnikova 21
Let L be any set and P(L) be the power set of L
Let S = { x Î L | x Ï f(x) }
{ 〈M〉 | M is a TM } is countable
strings of 0s and 1s
L P(L)
For all sets L, P(L) has more elements than L
L P(L)
For all sets L, P(L) has more elements than L
28
Using reductions to prove
undecidability
We want to prove that language L is undecidable.
ETM = { 𝑴 ∣ 𝑴 is a TM and 𝑳 𝑴 = ∅}
Proof: Suppose to the contrary that ETM is decidable,
and let R be a TM that decides it.
We construct TM S that decides ATM.
S = `` On input 〈𝑴, 𝒘〉, where 𝑴 is a TM and w is a string:
(We need to run TM R on some input, but which ???)
ETM = { 𝑴 ∣ 𝑴 is a TM and 𝑳 𝑴 = ∅}
Proof: Suppose to the contrary that ETM is decidable,
and let R be a TM that decides it.
We construct TM S that decides ATM.
S = `` On input 〈𝑴, 𝒘〉, where 𝑴 is a TM and w is a string:
1. Construct TM 𝑀′.
𝑀′ = `` On input x,
1. If x≠w, reject.
2. If x=w, run TM M on input w.
3. If it accepts, accept.’’
2. Run TM R on input <𝑴′>.
8/29/23
3. If R rejects , accept. O.w. reject.’’
Meiram Murzabulatov; based on slides by Sofya Raskhodnikova
ü 32
The Halting Problem