BU CS 332 Theory of Computation Lecture 11: Reading: TM Variants - - PowerPoint PPT Presentation

bu cs 332 theory of computation
SMART_READER_LITE
LIVE PREVIEW

BU CS 332 Theory of Computation Lecture 11: Reading: TM Variants - - PowerPoint PPT Presentation

BU CS 332 Theory of Computation Lecture 11: Reading: TM Variants Sipser Ch 3.2 Closure Properties Mark Bun March 1, 2020 The Basic Turing Machine (TM) Input Tape Finite control Input is written on an


slide-1
SLIDE 1

BU CS 332 – Theory of Computation

Lecture 11:

  • TM Variants
  • Closure Properties

Reading: Sipser Ch 3.2

Mark Bun March 1, 2020

slide-2
SLIDE 2

The Basic Turing Machine (TM)

3/3/2020 CS332 ‐ Theory of Computation 2

Tape 𝑏 𝑐 𝑏 𝑏 Finite control …

  • Input is written on an infinitely long tape
  • Head can both read and write, and move in both

directions

  • Computation halts when control reaches

“accept” or “reject” state

Input

slide-3
SLIDE 3

0 → 0, 𝑆 ⊔ → ⊔, 𝑆

accept reject

0 → 0, 𝑆 ⊔ → ⊔, 𝑆

Example

𝑟0 𝑟1

slide-4
SLIDE 4

Formal Definition of a TM

A TM is a 7‐tuple

  • is a finite set of states
  • is the input alphabet (does not include )
  • is the tape alphabet (contains

and )

  • is the transition function

…more on this later

  • is the start state
  • is the accept state
  • is the reject state (

)

3/3/2020 CS332 ‐ Theory of Computation 4

slide-5
SLIDE 5

TM Transition Function

means “move left” and means “move right” means:

  • Replace 𝑏 with 𝑐 in current cell
  • Transition from state 𝑞 to state 𝑟
  • Move tape head right

means:

  • Replace 𝑏 with 𝑐 in current cell
  • Transition from state 𝑞 to state 𝑟
  • Move tape head left UNLESS we are at left end of tape, in

which case don’t move

3/3/2020 CS332 ‐ Theory of Computation 5

slide-6
SLIDE 6

Configuration of a TM

A string with captures the state of a TM together with the contents of the tape

3/3/2020 CS332 ‐ Theory of Computation 6

slide-7
SLIDE 7

Configuration of a TM: Formally

A configuration is a string where and

  • Tape contents =

(followed by blanks )

  • Current state =
  • Tape head on first symbol of

3/3/2020 CS332 ‐ Theory of Computation 7

slide-8
SLIDE 8

How a TM Computes

Start configuration: One step of computation:

  • yields

if

  • yields

if

  • yields

if Accepting configuration: = Rejecting configuration: =

3/3/2020 CS332 ‐ Theory of Computation 8

slide-9
SLIDE 9

How a TM Computes

accepts input if there is a sequence of configurations

  • such that:
  • =
  • yields for every
  • is an accepting configuration

the set of all strings which accepts is Turing‐recognizable if for some TM :

  • halts on

in state

  • halts on

in state OR runs forever

3/3/2020 CS332 ‐ Theory of Computation 9

slide-10
SLIDE 10

Recognizers vs. Deciders

the set of all strings which accepts is Turing‐recognizable if for some TM :

  • halts on

in state

  • halts on

in state OR runs forever is (Turing‐)decidable if for some TM which halts on every input

  • halts on

in state

  • halts on

in state

3/3/2020 CS332 ‐ Theory of Computation 10

slide-11
SLIDE 11

Back to Hilbert’s Tenth Problem

Computational Problem: Given a Diophantine equation, does it have a solution over the integers?

  • is Turing‐recognizable
  • is not decidable (1949‐70)

3/3/2020 CS332 ‐ Theory of Computation 11

slide-12
SLIDE 12

TM Variants

3/3/2020 CS332 ‐ Theory of Computation 12

slide-13
SLIDE 13

How Robust is the TM Model?

Does changing the model result in different languages being recognizable / decidable? So far we’ve seen… ‐ We can require that FAs/PDAs have a single accept state ‐ (CFGs can always be put in Chomsky Normal Form) ‐ Adding nondeterminism does not change the languages recognized by finite automata Turing machines have an astonishing level of robustness

3/3/2020 CS332 ‐ Theory of Computation 13

slide-14
SLIDE 14

Extensions that do not increase the power of the TM model

  • TMs that are allowed to “stay put” instead of moving

left or right Proof that TMs with “stay put” are no more powerful: Simulation: Convert any TM with “stay put” into an equivalent TM without Replace every “stay put” instruction in with a move right instruction, followed by a move left instruction in ’

3/3/2020 CS332 ‐ Theory of Computation 14

slide-15
SLIDE 15

Extensions that do not increase the power of the TM model

  • TMs with a 2‐way infinite tape, unbounded left to right

Proof that TMs with 2‐way infinite tapes are no more powerful: Simulation: Convert any TM with 2‐way infinite tape into a 1‐way infinite TM with a “two‐track tape”

3/3/2020 CS332 ‐ Theory of Computation 15

Tape 𝑏 𝑐 𝑏 … Input …

slide-16
SLIDE 16

Formalizing the Simulation

  • New tape alphabet:

New state set:

  • means “ , working on upper track”

means “ , working on lower track” New transitions:

If 𝜀 𝑞, 𝑏 𝑟, 𝑐, 𝑀, let 𝜀′ 𝑞, , 𝑏, 𝑏 𝑟, , 𝑐, 𝑏 , 𝑆 Also need new transitions for moving right, lower track, hitting $, initializing input into 2‐track format

3/3/2020 CS332 ‐ Theory of Computation 16

slide-17
SLIDE 17

TMs are equivalent to…

  • TMs with “stay put”
  • TMs with 2‐way infinite tapes
  • Multi‐tape TMs
  • Nondeterministic TMs
  • Random access TMs
  • Enumerators
  • Finite automata with access to an unbounded queue = 2‐

stack PDAs

  • Primitive recursive functions
  • Cellular automata

3/3/2020 CS332 ‐ Theory of Computation 17

slide-18
SLIDE 18

Church‐Turing Thesis

The equivalence of these models is a mathematical theorem Church‐Turing Thesis: Each of these models captures our intuitive notion of algorithms The Church‐Turing Thesis is not a mathematical statement!

3/3/2020 CS332 ‐ Theory of Computation 18

slide-19
SLIDE 19

Multi‐Tape TMs

3/3/2020 CS332 ‐ Theory of Computation 19

𝑐 𝑐 𝑏 𝑏 𝑏 Finite control 𝑏 𝑐 ⊔ 𝑏 𝑏 ⊔ 𝑐 𝑏 𝑏 𝑑

Fixed number of tapes (can’t change during computation) Transition function

slide-20
SLIDE 20

Multi‐Tape TMs are Equivalent to Single‐Tape TMs

Theorem: Every ‐tape TM with can be simulated by an equivalent single‐tape TM

3/3/2020 CS332 ‐ Theory of Computation 20

𝑐 𝑐 𝑏 𝑏 Finite control 𝑏 𝑐 ⊔ 𝑏 ⊔ 𝑐 𝑏 𝑏 ⊔ 𝑐 𝑏 𝑏 𝑑 # 𝑏 𝑐 ⊔ 𝑏 # 𝑐 𝑐 𝑏 𝑏 # Finite control