Advanced Topics in Theoretical Computer Science Part 1: Turing - - PowerPoint PPT Presentation

advanced topics in theoretical computer science
SMART_READER_LITE
LIVE PREVIEW

Advanced Topics in Theoretical Computer Science Part 1: Turing - - PowerPoint PPT Presentation

Advanced Topics in Theoretical Computer Science Part 1: Turing Machines and Turing Computability (2) 6.11.2019 Viorica Sofronie-Stokkermans Universit at Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1 Last time Deterministic Turing


slide-1
SLIDE 1

Advanced Topics in Theoretical Computer Science

Part 1: Turing Machines and Turing Computability (2) 6.11.2019 Viorica Sofronie-Stokkermans Universit¨ at Koblenz-Landau e-mail: sofronie@uni-koblenz.de

1

slide-2
SLIDE 2

Last time

  • Deterministic Turing Machine (DTM)
  • Configuration, transition between configurations, computation

To halt, to hang

  • Representation of Turing machines
  • as in definition
  • diagram (flow-chart) representation

2

slide-3
SLIDE 3

Last time

  • Definitions: TM-computable function
  • TMpart is the set of all partial TM-computable functions f : Nk → N
  • TM is the set of all total TM-computable functions f : Nk → N

Remark: Restrictions when defining TM and TMpart:

  • Only functions over N
  • Only functions with values in N (not in Nm)

This is not a real restriction: Words from other domains can be encoded as natural numbers.

3

slide-4
SLIDE 4

Last time

Types of Turing machines: – Standard deterministic Turing Machines (Standard DTM) – Other types of Turing machines:

  • Tape infinite on both sides
  • Several tapes
  • Non-deterministic Turing machines
  • For every TM with both sides infinite tape which computes a function

f or accepts a language L, there exists a standard DTM M′ which also computes f (resp. accepts L).

  • For every k-DTM which computes a function f (or accepts a language L)

there exists a DTM M′ which computes f (resp. accepts L).

4

slide-5
SLIDE 5

Last time

Universal Turing machines: TM which simulates other Turing machines

  • Universal Turing machine U receives as input

(i) the rules of an arbitrary TM M and (ii) a word w.

  • U simulates M, by always changing the configurations (according to

the transition function δ) the way M would change them. Problem: Turing machines take words (or numbers) as inputs. Can we encode an arbitraty Turing machine as a number or as a word? Solution: G¨

  • delisation

Method for assigning with every Turing machine a number or a word (G¨

  • del

number or G¨

  • del word) such that the Turing machine can be effectively

reconstructed from that number (or word).

5

slide-6
SLIDE 6

Last time

  • Acceptable language
  • Recursively enumerable language
  • Enumerable language
  • Decidable language

relationships between these notions.

6

slide-7
SLIDE 7

Last time

A DTM M decides a language L if

  • for every input word w ∈ L, M halts with band contents Y (yes)
  • for every input word w ∈ L, M halts with band contents N (no)

L is called decidable if there exists a DTM which decides L. Let L be a language over Σ0 with #, Y , N ∈ Σ0. Let M = (K, Σ, δ, s) be a DTM with Σ0 ⊆ Σ.

  • M enumerates L if there exists a state qB ∈ K (the blink state)

such that: L = {w ∈ Σ∗

0 |

E u ∈ Σ∗; s, # ⊢∗

M qB, #w#u}

  • L is called recursively enumerable if there exists a DTM M which

enumerates L.

7

slide-8
SLIDE 8

Acceptable/Recursively enumerable/Decidable

Theorem (Acceptable = Recursively enumerable) A language is recursively enumerable iff it is acceptable. Proposition Every decidable language is acceptable. Proposition The complement of any decidable language is decidable. Proposition (Characterisation of decidability) A language L is decidable iff L and its complement are acceptable.

8

slide-9
SLIDE 9

Recursively enumerable = Type 0

Formal languages are of type 0 if they can be generated by arbitrary grammars (no restrictions). Proposition The recursively enumerable languages (i.e. the languages acceptable by DTMs) are exactly the languages generated by arbitrary grammars (i.e. languages of type 0).

9

slide-10
SLIDE 10

Undecidability of the halting problem

M Turing machine → G(M) G¨

  • delisation

HALT = {(G(M), w) | M halts on input w} Is HALT decidable?

10

slide-11
SLIDE 11

Undecidability of the halting problem

Proposition: HALT = {(G(M), w) | M halts on input w} is not decidable. Proof: Assume, in order to derive a contradiction, that there exists a TM MH which halts on every input and accepts only inputs in HALT. We construct the following TM:

accept reject loops

M x x#x

Copy

MH

Loop

  • 1. Let x be the input.
  • 2. Copy the input. Let x#x be the result.
  • 3. Decide using MH if (x, x) ∈ HALT

4. If yes: loop 5. If no: halt

11

slide-12
SLIDE 12

Undecidability of the halting problem

Proposition: HALT = {(G(M), w) | M halts on input w} is not decidable. Proof: Assume, in order to derive a contradiction, that there exists a TM MH which halts on every input and accepts only inputs in HALT. What happens when we start M with input G(M)?

accept reject loops

M x x#x

Copy

MH

Loop

Case 1: M started with G(M) halts: Then (G(M), G(M)) ∈ HALT Contradiction! Case 2: M started with G(M) does not halt: Then (G(M), G(M))∈HALT Contradiction!

12

slide-13
SLIDE 13

Undecidability proofs: Example

  • Theorem. K = {G(M) | M halts for input G(M)}

is acceptable but undecidable. Proof: Undecidable: Similar to the undecidability proof for HALT. Acceptable: MK := MprepU, (U universal TM; Mprep brings tape in form required by U). Reformulation using numbers instead of words: G¨

  • delization → G¨
  • del numbers

Let M0, M1, . . . , Mn, . . . be an enumeration of all Turing Machines Mn is the TM with G¨

  • del number n.

K = {n | Mn halts on input n}

13

slide-14
SLIDE 14

Today

  • How to prove that a language is undecidable?

14

slide-15
SLIDE 15

Undecidability proofs

Proof via reduction

  • L1, L2 languages
  • L1 known to be undecidable
  • To show: L2 undecidable
  • Idea: Assume L2 decidable. Let M2 be a TM which decides L2. Show

that then we can construct a TM which decides L1. For this, we have to find a computable function f which transforms an instance of L1 into an instance of L2 A w(w ∈ L1 iff f (w) ∈ L2) Let Mf be the TM which computes f . Construct M1 = Mf M2. Then M1 decides L1.

15

slide-16
SLIDE 16

Undecidability proofs

Proof via reduction

  • Definition. L1, L2 languages. L1 ≤ L2 (L1 is reducible to L2) if there exists

a computable function f such that: A w(w ∈ L1 iff f (w) ∈ L2)

  • Theorem. If L1 ≤ L2 and L1 is undecidable then L2 is undecidable.

16

slide-17
SLIDE 17

Undecidability proofs: Example

  • Theorem. H0 = {n | Mn halts for input 0} is undecidable.

Proof: We show that K can be reduced to H0, i.e. that there exists a TM computable function f : N → N such that i ∈ K iff f (i) ∈ H0. Only main idea here, we will come back to this example later

17

slide-18
SLIDE 18

Undecidability proofs: Example

  • Theorem. H0 = {n | Mn halts for input 0} is undecidable.

Proof: We show that K can be reduced to H0, i.e. that there exists a TM computable function f : N → N such that i ∈ K iff f (i) ∈ H0. Want: f (i) = j iff (Mi halts for input i iff Mj halts for input 0). For every i there exists a TM Ai s.t.: s, ## ⊢∗

Ai h, #|i#.

Let MK be the TM which accepts K. We define f (i) := j where j is the G¨

  • del number of Mj = AiMK .

f is TM computable. We show that f has the desired property: f (i) = j ∈ H0 iff Mj = AiMK halts for input 0 (##) iff MK halts for input i iff i ∈ K.

18