Late 19th Century
Slide is inspired form https://www.cmi.ac.in/~sri/Courses/TOC2013/Slides/lecture0.pdf
The Hilbert Program
and
The Entscheidungs
problem
Aimed to formalize all of mathematics in a consistent, complete, and finite
system of axioms and rules of inference.
Slide is inspired form https://www.cmi.ac.in/~sri/Courses/TOC2013/Slides/lecture0.pdf
Church-Turing Thesis
-Calculus Turing Machine
Alonzo Church Alan Turing
Formal definition of algorithm (computation)
TURING MACHINE (TM)
FINITE
STATE
q10
CONTROL
AI N P U T
UNBOUNDED (on the right) TAPE
read write move
0 → 0, R → , R
qaccept
0 → 0, R
→ , R
qreject 0 → 0, R
→ , L
A TM can loop forever
TM versus PDA
TM can both write to and read from the tape
The head can move left and right
The input does not have to be read entirely
Accept and Reject take immediate effect
Infinite tape on the right, stick on the left
TM is deterministic (NTM is nondeterministic)
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
04/07/2025 Sofya Raskhodnikova; based on slides by Nick Hopper L11.3
Implementation-level Description of a TM
• Describe (in English) the instructions for a TM
– How to move the head
– What to write on the tape
• Example
1. Scan the tape from left to right and, for every 1 read
until non-1 symbol is encountered
• replace 1 with x,
• find the next on the right and replace it with .
• If no matching found, reject.
04/07/2025 Sofya Raskhodnikova; based on slides by Nick Hopper
Accepting and rejecting
A TM on input sting w may
either halt (enter qaccept or qreject)
or never halt (loop)
A TM is a decider if it halts on every input.
Sofya Raskhodnikova; based on slides by Nick Hopper L11.4
Language of a TM
A TM recognizes a language L if it accepts all
strings in L and no other strings.
• A language is called recognizable (or
enumerable) if some TM recognizes it.
A TM decides a language L if it accepts all
strings in L and rejects all strings not in L.
• A language is called decidable (or
recursive) if some TM decides it.
Sofya Raskhodnikova; based on slides by Nick Hopper L11.5
Recognizable vs. decidable languages
• A language L is recognizable (enumerable) if
some TM
1. accepts strings in L and
2. does not accept strings not in L recognizable
by entering qreject or looping.
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 .
04/07/2025 Sofya Raskhodnikova; based on slides by Nick Hopper L11.6
TM variant: Stay put TM
• is a TM that can stay on a same cell on a transition, i.e. it
has following transition function
: 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
Fixed number of tapes,
(can’t change during computation)
: 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
Fixed number of tapes,
(can’t change during computation)
: 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.
2. For each move of the k-tape TM:
Scan left-to-right, finding current symbols
Scan left-to-right, writing new symbols
Scan left-to-right, moving each tape head.
3. If a tape head goes off right end, insert blank.
If tape head goes off left end, move back right.
Multitape TMs are equivalent to
single-tape TMs
Theorem. Every multitape TM can be transformed
into an equivalent single-tape TM decider.
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…
TMs are equivalent to multitape TMs
TMs are equivalent to nondeterministic TMs
TMs are equivalent to doubly unbounded TMs
L11.28