Docsity

Algorithm analysis Design and Microprocessor - Turing Machines, Study notes of Design and Analysis of Algorithms

Partial preview of the text

Download Algorithm analysis Design and Microprocessor - Turing Machines and more Study notes Design and Analysis of Algorithms in PDF only on Docsity!

Turing Machines

  • (^) There are languages that are not context-free.
  • (^) What can we say about the most powerful

automata and the limits of computation?.

  • (^) Alan Turing (1912 - 1954).

Standard Turing Machine

Control unit q 0

Tape

Read-write head

Standard Turing Machine

: Q    Q    {L, R}

current symbol

head move direction

replacin g symbol

Example

(q 0 , a) = (q 1 , d, R)

current symbol

head move to the right

replacin g symbol

Example

M = (Q, , , , q 0 , , F)

Q = {q 0 , q 1 } (q 0 , a) = (q 0 , b, R)

 = {a, b} (q 0 , b) = (q 0 , b, R)

 = {a, b, } (q 0 , ) = (q 1 , , L)

F = {q 1 }

Example

M = (Q, , , , q 0 , , F)

Q = {q 0 , q 1 } (q 0 , a) = (q 1 , a, R)

 = {a, b} (q 0 , b) = (q 1 , b, R)

 = {a, b, } (q 0 , ) = (q 1 , , R)

F =  (q 1 , a) = (q 0 , a, L)

(q 1 , b) = (q 0 , b, L)

(q 1 , ) = (q 0 , , L)

Instantaneous Description

move: abq 1 cd  abeq 2 d

if (q 1 , c)  (q 2 , e, R)

Instantaneous Description

x 1 qix 2  y 1 qjy 2

x 1 qix 2  y 1 qjy 2

Example

L = 0*

M = (Q, , , , q 0 , , F)?

Example

L = {anbn^ | n  1 }

M = (Q, , , , q 0 , , F)?

Turing Machines as Language

Transducers

q 0 w  qfw^

function: w^ = f(w)

Turing Machines as Language

Transducers

A function f with domain D is said to be Turing- computable if there exists some Turing machine M = (Q, , , , q 0 , , F) such that:

q 0 w  qff(w) qf  F

for all w  D.

Example

f(w) = ww w  {1}+

M = (Q, , , , q 0 , , F)?

Example

f(x, y) = true if x  y

or f(x, y) = false otherwise

M = (Q, , , , q 0 , , F)?