lec8
lec8
q1
q2 qn
• Read character under head, write
character out, move the head right
q1 q0
or left (or stay).
Finite control
2







fi
Turing Machine
Transition function
δ : Q × Γ → Q × Γ × {L, R, S}
• go to state p
• write b δ(q, a) = (p, b, L)
• move head Left
• Missing transitions lead to hell state.
“Blue screen of death.” “Machine crashes.
3







Turing machine variants
Equivalent Turing Machines
4

fi
fi
Turing machine variants
Multi-track Tapes
7




fi
fi
Turing machine variants
Multiple Read/Write Heads
What does the transition function for the equivalent nominal TM look like?
8




Turing machine variants
Multiple Read/Write Heads
What does the transition function for the equivalent nominal TM look like?
9




Determinism in Turing Machines
10

Determinism in Turing Machines
Deterministic vs Non-Deterministic
Deterministic Non-Deterministic
accept
…
f(n) f(n)
… reject
accept or
reject
accept
11



Power of NTM vs. DTM?
A DTM can simulate a NTM in the following ways:
13






Universal Turing Machine
Some notation
M: Turing machine
⟨M⟩: a string uniquely describing M (we will see that it can be thought of as a
number)
w: An input string.
⟨M, w⟩: A unique string encoding both M and input w.
14








Universal Turing Machine
Introduction
15











Universal Turing Machine
Coding of TMs
Lemma: If a language L over alphabet {0,1} is accepted by some TM M, then there
is a one-tape TM M′ that accepts L, such that
• Γ = {0,1,B}
• states numbered 1,...,k
• q1 is a unique start state
• q3 is a unique halt/accept state
• q3 is a unique halt/reject state
Note: To represent a TM, we need only list its set of transitions - everything else is
implicit by the above.

16












Listing Transition
17






Encoding a transition
11101010000100100110100100000101011 . . . . . 11 . . . . . . . 11 . . . . . . . 111
• Begins, ends with 111
• Transitions separated by 11
• Fields within transition separated by 1
• Individual elds represented by 0s
19


fi



TMs are (binary) numbers
20







How Mu works
Con guration
Three tapes
1 1 1 t1 1 1 t2 1 1 … t3k 1 1 1 # w
Input M Input w
21







fi





Universal Turing Machine
How Mu works: Phase 1 (validate)
• Copy w to Tape 2
• Write 0 on Tape 3 indicating it is in the start state
• If at any time, Tape 3 holds 00 (or 000), then halt and accept (or reject)
$100110 Tape 2
Current contents of M’s tape
$0 Tape 3
Current state of M
23










Universal Turing Machine
How Mu works - Phase 3 (simulation)
$100110 Tape 2
Current contents of M’s tape
$0 Tape 3
Current state of M
24











Universal Turing Machine
How Mu works - Phase 3 - (simulation, after a single move)
$000110
Current contents of M’s tape write a 0 under tape 2’s head
$00000
Current state of M
25









Examples
https://rosettacode.org/wiki/Universal_Turing_machine#Python
26

Universal Turing Machine
Examples
• See:
27