130 likes | 239 Views
L ECTURE 12 Theory of Computation Turing Machines Turing Machine Variants. Intro to Theory of Computation. CS 464. Sofya Raskhodnikova. 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.
E N D
LECTURE12 • Theory of Computation • Turing Machines • Turing Machine Variants Intro to Theory of Computation CS 464 Sofya Raskhodnikova Sofya Raskhodnikova; based on slides by Nick Hopper
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 (will consider NTMs later)
Formal Definition of a TM A TMis a 7-tuple P = (Q, Σ, Γ, , q0, qaccept, qreject) Q is a finiteset of states Σ is the input alphabet, where Σ Γis the stack alphabet, where Γ and Σ Γ : Q Γ→ Q Γ {L,R}is the transition function q0 , qaccept, qreject Q are the start, accept and reject states Sofya Raskhodnikova; based on slides by Nick Hopper
Accepting and rejecting A TM on input sting w may either halt (enter qacceptorqreject) or never halt (loop) A TM is a decider if it halts on every input.
Turing-recognizable and decidable languages Turing-recognizable languages Decidable languages Sofya Raskhodnikova; based on slides by Nick Hopper • A language L is Turing-recognizable(recursively-enumerable) if some TM • accepts strings in L and • rejects strings not in L by entering qrejector looping. • A language L is decidable(recursive) if some TM • accepts strings in L and • rejects strings not in L by entering qreject.
q7 0 0 0 1 1 1 0 1 1 0 CONFIGURATIONS 11010q700110
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
LUP = {1i#x1#...#xn | n ¸ i and xi = x1} 111#101#11#101 x11#101#11#101 xx1#101#11#101 .. .. .. .. . . . . xxx#101#11#101
FINITE STATE CONTROL TM variant: multitape TM : Q Γk→ Q Γk {L,R,S}k
FINITE STATE CONTROL FINITE STATE CONTROL Theorem: Every Multitape Turing Machine can be transformed into a single tape Turing Machine 1 0 0 # # 1 0 0 #
SIMULATING MULTIPLE TAPES ● ● ● ● L#100#0#□#R L#100#0#1#R 100 L#100#□#□#R qi qi1 qjRSS qj 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.
TMs are equivalent to… TMs are equivalent to multitape TMs (proof on the board) TMs are equivalent to nondeterministic TMs (proof on the board) TMs are equivalent to double unbounded TMs (proof on the board) TMs are equivalent to FIFO automata. (HW problem) TMs are equivalent to primitive recursive functions. TMs are equivalent to cellular automata.
The Church-Turing Thesis (1936) L is recognized by a program for some computer* ↕ L is recognized by a TM • History • 23 Hilbert’s problems (1900) • stated at International Congress of Mathematicians • 10th problem: Give a procedure for determining if a polynomial in k variables has an integral root. * The computer must be “reasonable” Sofya Raskhodnikova; based on slides by Nick Hopper