Deterministic Turing Machines

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

Turing Machines.
Deterministic Turing Machines
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
Lecture 6 Nondeterministic Finite Automata (NFA)
CS 461 – Oct. 21 Begin chapter 3 We need a better (more encompassing) model of computation. Ex. { 1 n 2 n 3 n } couldn’t be accepted by PDA. –How could.
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Turing Machines A more powerful computation model than a PDA ?
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
Costas Busch - LSU1 Turing’s Thesis. Costas Busch - LSU2 Turing’s thesis (1930): Any computation carried out by mechanical means can be performed by a.
CS 3240: Languages and Computation
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines. The next level of Machine… PDAs improved on FSAs by adding memory. We make the memory more flexible to do more complicated tasks.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
Turing’s Thesis.
Turing’s Thesis Costas Busch - LSU.
NFAε - NFA - DFA equivalence
Part VI NP-Hardness.
Lecture2 Regular Language
Non Deterministic Automata
Busch Complexity Lectures: Turing Machines
COSC 3340: Introduction to Theory of Computation
Turing Machines.
Pumping Lemma Revisited
Pushdown Automata PDAs
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
Turing Machines Acceptors; Enumerators
Modeling Computation:
Chapter 9 TURING MACHINES.
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Non Deterministic Automata
4b Lexical analysis Finite Automata
Variations of the Turing Machine
COSC 3340: Introduction to Theory of Computation
4b Lexical analysis Finite Automata
Computability Catch up last lecture. Turing machines. Variations
Formal Definitions for Turing Machines
Hopcroft, Motawi, Ullman, Chap 8
Turing Machines Everything is an Integer
Presentation transcript:

Deterministic Turing Machines

Unique accept state. Also no arrows are coming out. Constituents Infinite tape Head Transition diagram … … q1 q0 qf Unique accept state. Also no arrows are coming out.

Formal definition A Deterministic Turing Machine (DTM) is a sextuple (Q, Σ, Γ, δ, q0, qf) where: Q is a finite set of states Σ is the input alphabet Γ is the tape alphabet, There is a special blank symbol □ in Γ q0 is the start state qf is the final state δ: Q x Γ → Q x Γ x {L,R,S}, where L stands for Left, R stands for Right and S stands for Stay.

Formal definition (cont.) δ(q , a) = (q’ , b, L) means: “if you are in state q and the head in the tape points to symbol a then move to state q’, replace symbol a with symbol b in the tape and move the head one position to the left” Illustration: … … … … a b head head q‘ q‘ a→b,L … a→b,L … … q … q

Determinism Determinism means that I have no choices! The transition function δ sends pair (q, a) to at most one triple (q’, ?, ?) (in other words there is at most one arrow from state q reading symbol a –maybe there are no such arrows). No ε-moves are allowed (I must read something in the tape in order to change state).

Special status Start: Be at initial state , the tape contains only the input and the head points to the first (leftmost symbol of the input) Accept: Reach the accept state. The machine stops the computation and accept (notice that part of the input might not be read). Reject: Be in a state q, read symbol a and find no outgoing arrow under symbol a. Loop for ever: There are some cases that a machine enters a subset of states from which it can’t exit (different than the “reject case”)

Example Find a DTM that computes the language L = {an bn , n ≥ 0}. High level program: Repeat Erase an a. Pass along the rest of as. Erase a b Pass along the rest of bs. Go to the beginning of the input. Until or the input is erased (accept) or you find an unmatched a or b (reject).

Example Find a DTM that computes the language L = {an bn , n ≥ 0}. Answer: a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Example Test the machine for several possible inputs to see if it works as it should. Test inputs: ε (it should accept) aaabbb (it should accept) aaabb (it should reject) aabbb (it should reject) aabba (it should reject)

Test input: ε … … a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: ε … … a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … a a a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x a a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x a x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabbb … … x x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … a a a b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x a a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x a x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aaabb … … No arrow under □ so REJECT! x x x x x a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … a a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a b b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x a x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x b b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabbb … … No arrow under b so REJECT! x x x x b a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabba … … a a b b a a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabba … … x a b b a a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabba … … x a b b a a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabba … … x a x b a a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabba … … x a x b a a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L

Test input: aabba … … No arrow under a so REJECT! x a x b a a → a , R x → x , R x → x , R b → b , R a → x , R b → x , R q0 q1 q2 □ → □ , R □ → □ , L □ → □ , R qf q3 a → a , L b → b , L x → x , L