Lecture 10 Turing Machine
Lecture 10 Turing Machine
The Entscheidungs
problem
FINITE
STATE
q10
CONTROL
AI N P U T
0 → 0, R → , R
qaccept
0 → 0, R
→ , R
qreject 0 → 0, R
→ , L
L11.6
CONFIGURATIONS
11010q700110
q7
1 1 0 1 0 0 0 1 1 0
x → x, L
2 n
0 → 0, L
{0 |n≥0}
q2
→ , R
→ , L
x → x, R x → x, R
q0 q1 q3
0 → , R 0 → x, R
x → x, R
→ , R 0 → 0, R
→ , R 0 → x, R
qreject qaccept q4
x → x, R
→ , R
x → x, L
2 n q 0000
0 →0 0, L
{0 |n≥0}
q2 q1000
→ , R xq300
→ , L
x → x, R x0qx40→ x, R
q0 q1 x0xq
q 3
3
0 → , R 0 → x, R x0q2x
x → x, R xq 0x0, R
→ , R 0 2→
→ , R 0 → x, R
q2x0x
qreject qaccept q24 x0x
q
x → x, R
→ , R
MUL = {1i#1j#1k | ij = k and i, j, k ≥ 1}
11#111#111111
x1#111#111111
x1#yyy#zzz111
x1#111#zzz111
xx#yyy#zzzzzz
LP = {1i#x1#...#xn | n i and xi = x1}
111#101#11#101
x11#101#11#101
xx1#101#11#101
. . . . .. .. .. ..
xxx#101#11#101
Formal Definition of a TM
A TM is a 7-tuple P = (Q, Σ, Γ, , q0, qaccept , qreject)
Q is a finite set of states
Σ is the input alphabet, where Σ
Γ is the tape alphabet, where Γ and Σ Γ
: Q Γ → Q Γ {L,R} is the transition
q 0 , qaccept , qreject Q are
function
the start, accept and reject states
decidable
• A language L is decidable
(recursive) if some TM
1. accepts strings in L and
2. rejects strings not in L by entering qreject .
: Q Γ → Q Γ {L,R,S}
Theorem. Every stay put TM can be transformed into a traditional TM (that
goes only L/R)
If (q,x) = (p,y,S)
(q,x) = (q’,y,R)
(q’,z) = (p,z,L)
Transitions where machine move L/R will remain same
Slides have been taken from https://cs-people.bu.edu/sofya/cs332/
L11.17
TM variant: multitape TM
FINITE STATE
CONTROL
: Q Γk → Q Γk
{L,R,S}k L11.18
Slides have been taken from https://cs-people.bu.edu/sofya/cs332/
Multitape TMs are equivalent to
single-tape TMs
Theorem. Every multitape TM can be transformed
into an equivalent single-tape TM.
1 0 0
FINITE STATE
CONTROL 0 1
FINITE STATE
CONTROL 𝑙 1 0 0 # 0 1 # 1 𝑟
Slides have been taken from https://cs-people.bu.edu/sofya/cs332/
TM variant: multitape TM
FINITE STATE
CONTROL
: Q Γk → Q Γk
{L,R,S}k Sofya Raskhodnikova; based on slides by Nick Hopper L11.20
Multitape TMs are equivalent to
single-tape TMs
Theorem. Every multitape TM can be transformed into an
equivalent single-tape TM.
1 0 0
FINITE STATE
CONTROL
FINITE STATE
CONTROL 𝑙 𝑟
1 0 0 # #
Sofya Raskhodnikova; based on slides by Nick Hopper
SIMULATING MULTIPLE TAPES
●● ● ●
100 00 ##□#R
L#100#□#□#R
L#100#
L#100# 1 #R
qqijjRSS
qi1 qi1□ qi1□□qj101RSS
1. “Format” tape.
1 0 0
FINITE STATE
CONTROL
FINITE STATE
CONTROL 1 0 0 # # #
To show one type of machine
can simulate another…
1. Explain how to initialize the new machine.
2. Explain how the new machine simulates each
step of the old machine.
04/07/2025
Nondeterministic Turing Machine
𝑄 Γ { 𝐿 , 𝑅 , 𝑆}
:𝑄× Γ →2
Theorem: Every Nondeterministic Turing Machine has an
equivalent Deterministic Turing Machine
Doubly unbounded TMs
A TM with doubly unbounded tape is like an ordinary TM
but
• Its tape is infinite on the left and on the right.
Initially, only the input is written on the tape and the head
is on the first nonblack symbol.
04/07/2025 L11.26
TMs are equivalent to…
L11.28