1 turing machines there are languages that are not context-free. what can we say about the most...

30
1 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).

Upload: ami-atkins

Post on 16-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 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

1

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).

Page 2: 1 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

2

Standard Turing Machine

Control unitq0

Tape

Read-write head

Page 3: 1 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

3

Standard Turing Machine

M = (Q, , , , q0, �, F)

Q: finite set of internal states

: finite set of symbols - tape alphabet

� : blank

{�}: finite set of symbols - input alphabet

: Q Q {L, R} transition function

q0 Q: initial state

F Q: set of final states

Page 4: 1 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

4

Standard Turing Machine

: Q Q {L, R}

current symbol

head move direction

replacing symbol

Page 5: 1 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

5

Example

(q0, a) = (q1, d, R)

current symbol

head move to the right

replacing symbol

Page 6: 1 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

6

Halt State

• A state for which is not defined.

• Assume that all final states are halt states.

Page 7: 1 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

7

Example

M = (Q, , , , q0, �, F)

Q = {q0, q1} (q0, a) = (q0, b, R)

= {a, b} (q0, b) = (q0, b, R)

= {a, b, �} (q0, �) = (q1, �, L)

F = {q1}

Page 8: 1 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

8

Example

M = (Q, , , , q0, �, F)

Q = {q0, q1} (q0, a) = (q1, a, R)

= {a, b} (q0, b) = (q1, b, R)

= {a, b, �} (q0, �) = (q1, �, R)

F = (q1, a) = (q0, a, L)

(q1, b) = (q0, b, L)

(q1, �) = (q0, �, L)

Page 9: 1 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

9

Instantaneous Description

a1a2 ... ak-1qakak+1 ... an

current state current symbol

Page 10: 1 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

10

Instantaneous Description

move: abq1cd abeq2d

if (q1, c) (q2, e, R)

Page 11: 1 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

11

Instantaneous Description

x1qix2 y1qjy2

x1qix2 y1qjy2

Page 12: 1 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

12

Turing Machines as Language Accepters

Let M = (Q, , , , q0, �, F) be a TM.

L(M) = {w + | q0w x1qfx2 where qf F and x1, x2

*}

Page 13: 1 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

13

Example

L = 0*

M = (Q, , , , q0, �, F) ?

Page 14: 1 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

14

Example

L = {anbn | n 1}

M = (Q, , , , q0, �, F) ?

Page 15: 1 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

15

Example

L = {anbncn | n 1}

M = (Q, , , , q0, �, F) ?

Page 16: 1 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

16

Turing Machines as Language Transducers

q0w qfw^

function: w^ = f(w)

Page 17: 1 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

17

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, , , , q0, �, F) such that:

q0w qff(w) qf F

for all w D.

Page 18: 1 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

18

Example

f(x, y) = x + y

M = (Q, , , , q0, �, F) ?

Page 19: 1 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

19

Example

f(w) = ww w {1}+

M = (Q, , , , q0, �, F) ?

Page 20: 1 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

20

Example

f(x, y) = true if x y or f(x, y) = false otherwise

M = (Q, , , , q0, �, F) ?

Page 21: 1 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

21

Combining Turing Machines

x + y if x yf(x, y) =

0 if x y

M = (Q, , , , q0, �, F) ?

Page 22: 1 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

22

Combining Turing Machines

Comparer C

Adder A

EraserE

x y

x y

x, y f(x, y)

x + y

0

Page 23: 1 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

23

Combining Turing Machines

qcw(x)0w(y) qAw(x)0w(y) if x y

qcw(x)0w(y) qEw(x)0w(y) if x y

qAw(x)0w(y) qAfw(x + y)0

qEw(x)0w(y) qEf0

Page 24: 1 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

24

Macroinstructions

if a then qj else qk

(qi, a) = (qj0, a, R)

(qi, b) = (qk0, b, R)

(qj0, c) = (qj, c, L)

(qk0, c) = (qk, c, L)

Page 25: 1 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

25

Subprograms

Region separator

Workspace for A

# #

Workspace for B

Page 26: 1 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

26

Example

f(x, y) = x y

For each 1 in x, create a 1-string of length y.

Page 27: 1 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

27

Turing's Thesis

• Turing machine appears to be simple.

• Turing seems to approach a typical digital computer.

Page 28: 1 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

28

Turing's Thesis

Any computation that can be carried out by mechanical means can be performed by some Turing machine.

Page 29: 1 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

29

Turing's Thesis

• Anything done by existing digital computers can be done by a Turing machine.

• No problem solvable by an algorithm cannot be solved by a Turing machine.

• No alternative mechanical computation model is more powerful than the Turing machine model.

Page 30: 1 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

30

Homework

• Exercises: 2, 5, 8, 9, 16, 19 of Section 9.1.

• Exercises: 1, 2, 3, 4, 9 of Section 9.2.

• Presentations:

Section 12.1: Computability and Decidability + Halting Problem

Section 13.1: Recursive Functions

Post Systems + Church's Thesis

Section 13.2: Measures of Complexity + Complexity Classes