cm0081 undecidable problems about turing machines

28
Automata and Formal Languages - CM0081 Undecidable Problems About Turing Machines Andrés Sicard-Ramírez Universidad EAFIT Semester 2018-1

Upload: dinhnhu

Post on 25-Jan-2017

235 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: CM0081 Undecidable Problems About Turing Machines

Automata and Formal Languages - CM0081Undecidable Problems About Turing Machines

Andrés Sicard-Ramírez

Universidad EAFIT

Semester 2018-1

Page 2: CM0081 Undecidable Problems About Turing Machines

Reductions

DefinitionLet 𝑃1 and 𝑃2 be two problems. A reduction from 𝑃1 to 𝑃2 is a Turingmachine that takes an instance of 𝑃1 written on its tape and halts with aninstance of 𝑃2 that have the same answer (i.e. a reduction is an algorithm).

yes

no

yes

no

𝑃1 𝑃2

Undecidable Problems About Turing Machines 2/28

Page 3: CM0081 Undecidable Problems About Turing Machines

Reductions

Theorem (9.7.a)If there is a reduction from 𝑃1 to 𝑃2 then if 𝑃1 is undecidable then so 𝑃2.(Hint: Suppose the 𝑃2 is decidable and find a contradiction).

Theorem (9.7.b)If there is a reduction from 𝑃1 to 𝑃2 then if 𝑃1 is not recursively enumerablethen so 𝑃2. (Hint: Suppose the 𝑃2 is recursively enumerable and find acontradiction).

Undecidable Problems About Turing Machines 3/28

Page 4: CM0081 Undecidable Problems About Turing Machines

Reductions

Theorem (9.7.a)If there is a reduction from 𝑃1 to 𝑃2 then if 𝑃1 is undecidable then so 𝑃2.(Hint: Suppose the 𝑃2 is decidable and find a contradiction).

Theorem (9.7.b)If there is a reduction from 𝑃1 to 𝑃2 then if 𝑃1 is not recursively enumerablethen so 𝑃2. (Hint: Suppose the 𝑃2 is recursively enumerable and find acontradiction).

Undecidable Problems About Turing Machines 4/28

Page 5: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

NotationHenceforth, we’ll regard strings as the Turing machines they represent.

Two languagesLe = {𝑀 ∣ 𝐿(𝑀) = ∅},

Lne = {𝑀 ∣ 𝐿(𝑀) ≠ ∅}.

Undecidable Problems About Turing Machines 5/28

Page 6: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Theorem (9.8)Lne is recursively enumerable,

ProofConstruction of a non-determinist TM to accept Lne:†

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.8].Undecidable Problems About Turing Machines 6/28

Page 7: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Theorem (9.8)Lne is recursively enumerable,

ProofConstruction of a non-determinist TM to accept Lne:†

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.8].Undecidable Problems About Turing Machines 7/28

Page 8: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Theorem (9.9)Lne is not recursive.

Undecidable Problems About Turing Machines 8/28

Page 9: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Proof.1. Reduction from Lu to Lne where the pair (𝑀, 𝑤) is converted in 𝑀 ′,

such that 𝑤 ∈ 𝐿(𝑀), if only if, 𝐿(𝑀 ′) ≠ ∅.

2. The key is to have 𝑀 ′ ignore its input.†

3. Lne is not recursive by Theorem 9.7.a.

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.9].Undecidable Problems About Turing Machines 9/28

Page 10: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Proof.1. Reduction from Lu to Lne where the pair (𝑀, 𝑤) is converted in 𝑀 ′,

such that 𝑤 ∈ 𝐿(𝑀), if only if, 𝐿(𝑀 ′) ≠ ∅.2. The key is to have 𝑀 ′ ignore its input.†

3. Lne is not recursive by Theorem 9.7.a.

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.9].Undecidable Problems About Turing Machines 10/28

Page 11: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Proof.1. Reduction from Lu to Lne where the pair (𝑀, 𝑤) is converted in 𝑀 ′,

such that 𝑤 ∈ 𝐿(𝑀), if only if, 𝐿(𝑀 ′) ≠ ∅.2. The key is to have 𝑀 ′ ignore its input.†

3. Lne is not recursive by Theorem 9.7.a.

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.9].Undecidable Problems About Turing Machines 11/28

Page 12: CM0081 Undecidable Problems About Turing Machines

Turing Machines that Accept the Empty Language

Theorem (9.10)Le is not recursively enumerable. (Hint: Le is the complement of Lne).

Undecidable Problems About Turing Machines 12/28

Page 13: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Set of the recursively enumerable languagesREL = {𝐿 ∣ 𝐿 is recursively enumerable }.

Properties (subsets) of the recursively enumerable languagesProperty 𝑃 of REL: 𝑃 ⊆ REL.

Example (Trivial properties)𝑃 (𝐿) = ∅ or 𝑃(𝐿) = REL.

Example𝑃 (𝐿): 𝐿 is a language regular.

Undecidable Problems About Turing Machines 13/28

Page 14: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Set of the recursively enumerable languagesREL = {𝐿 ∣ 𝐿 is recursively enumerable }.

Properties (subsets) of the recursively enumerable languagesProperty 𝑃 of REL: 𝑃 ⊆ REL.

Example (Trivial properties)𝑃 (𝐿) = ∅ or 𝑃(𝐿) = REL.

Example𝑃 (𝐿): 𝐿 is a language regular.

Undecidable Problems About Turing Machines 14/28

Page 15: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Set of the recursively enumerable languagesREL = {𝐿 ∣ 𝐿 is recursively enumerable }.

Properties (subsets) of the recursively enumerable languagesProperty 𝑃 of REL: 𝑃 ⊆ REL.

Example (Trivial properties)𝑃 (𝐿) = ∅ or 𝑃(𝐿) = REL.

Example𝑃 (𝐿): 𝐿 is a language regular.

Undecidable Problems About Turing Machines 15/28

Page 16: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Set of the recursively enumerable languagesREL = {𝐿 ∣ 𝐿 is recursively enumerable }.

Properties (subsets) of the recursively enumerable languagesProperty 𝑃 of REL: 𝑃 ⊆ REL.

Example (Trivial properties)𝑃 (𝐿) = ∅ or 𝑃(𝐿) = REL.

Example𝑃 (𝐿): 𝐿 is a language regular.

Undecidable Problems About Turing Machines 16/28

Page 17: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Theorem (Rice’s theorem, 9.11)Every non-trivial property of REL is undecidable.

How to prove Rice’s theorem?We identify a property 𝑃 by the Turing machines 𝑀 such that 𝐿(𝑀) ∈ 𝑃 .

Theorem (Rice’s theorem (second version))If 𝑃 ⊆ REL is a non-trivial property then

𝐿𝑃 = {𝑀 ∣ 𝐿(𝑀) ∈ 𝑃}

is undecidable.

Undecidable Problems About Turing Machines 17/28

Page 18: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Theorem (Rice’s theorem, 9.11)Every non-trivial property of REL is undecidable.

How to prove Rice’s theorem?We identify a property 𝑃 by the Turing machines 𝑀 such that 𝐿(𝑀) ∈ 𝑃 .

Theorem (Rice’s theorem (second version))If 𝑃 ⊆ REL is a non-trivial property then

𝐿𝑃 = {𝑀 ∣ 𝐿(𝑀) ∈ 𝑃}

is undecidable.

Undecidable Problems About Turing Machines 18/28

Page 19: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Theorem (Rice’s theorem, 9.11)Every non-trivial property of REL is undecidable.

How to prove Rice’s theorem?We identify a property 𝑃 by the Turing machines 𝑀 such that 𝐿(𝑀) ∈ 𝑃 .

Theorem (Rice’s theorem (second version))If 𝑃 ⊆ REL is a non-trivial property then

𝐿𝑃 = {𝑀 ∣ 𝐿(𝑀) ∈ 𝑃}

is undecidable.

Undecidable Problems About Turing Machines 19/28

Page 20: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Proof: Case ∅ ∉ 𝑃 .1. Let 𝐿 be a language and 𝑀𝐿 be a Turing machine such 𝐿 ≠ ∅,

𝐿 ∈ 𝑃 and 𝐿 = 𝐿(𝑀𝐿). Reduction from Lu to 𝐿𝑃 where the pair(𝑀, 𝑤) is converted in 𝑀 ′ such that:†

i) 𝐿(𝑀 ′) = ∅ (i.e. 𝑀 ′ ∉ 𝐿𝑃 ) if 𝑤 ∉ 𝐿(𝑀) andii) 𝐿(𝑀 ′) = 𝐿 (i.e. 𝑀 ′ ∈ 𝐿𝑃 ) if 𝑤 ∈ 𝐿(𝑀).

2. 𝐿𝑃 is not recursive by Theorem 9.7.a.

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.10].Undecidable Problems About Turing Machines 20/28

Page 21: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Proof: Case ∅ ∉ 𝑃 .1. Let 𝐿 be a language and 𝑀𝐿 be a Turing machine such 𝐿 ≠ ∅,

𝐿 ∈ 𝑃 and 𝐿 = 𝐿(𝑀𝐿). Reduction from Lu to 𝐿𝑃 where the pair(𝑀, 𝑤) is converted in 𝑀 ′ such that:†

i) 𝐿(𝑀 ′) = ∅ (i.e. 𝑀 ′ ∉ 𝐿𝑃 ) if 𝑤 ∉ 𝐿(𝑀) andii) 𝐿(𝑀 ′) = 𝐿 (i.e. 𝑀 ′ ∈ 𝐿𝑃 ) if 𝑤 ∈ 𝐿(𝑀).

2. 𝐿𝑃 is not recursive by Theorem 9.7.a.

†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.10].Undecidable Problems About Turing Machines 21/28

Page 22: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Proof: Case ∅ ∉ 𝑃 .1. Let 𝐿 be a language and 𝑀𝐿 be a Turing machine such 𝐿 ≠ ∅,

𝐿 ∈ 𝑃 and 𝐿 = 𝐿(𝑀𝐿). Reduction from Lu to 𝐿𝑃 where the pair(𝑀, 𝑤) is converted in 𝑀 ′ such that:†

i) 𝐿(𝑀 ′) = ∅ (i.e. 𝑀 ′ ∉ 𝐿𝑃 ) if 𝑤 ∉ 𝐿(𝑀) andii) 𝐿(𝑀 ′) = 𝐿 (i.e. 𝑀 ′ ∈ 𝐿𝑃 ) if 𝑤 ∈ 𝐿(𝑀).

2. 𝐿𝑃 is not recursive by Theorem 9.7.a.†Figure from Hopcroft, Motwani and Ullman [2007, Fig. 9.10].

Undecidable Problems About Turing Machines 22/28

Page 23: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Proof: Case ∅ ∈ 𝑃 .1. By the previous case, 𝑃 is undecidable, i.e. 𝐿𝑃 is undecidable.2. 𝐿𝑃 = 𝐿𝑃 .3. Suppose 𝐿𝑃 is decidable then 𝐿𝑃 would be also decidable

(contradiction).4. Therefore, 𝐿𝑃 is undecidable.

Undecidable Problems About Turing Machines 23/28

Page 24: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

All the problems about Turing machines that involve only the languagethat the TM accepts are undecidable.

ExamplesIs the language accepted by the TM empty?Is the language accepted by the TM finite?Is the language accepted by the TM regular?Is the language accepted by the TM context-free language?Does the language accepted by the TM contain the string “helloworld”?Does the language accepted by the TM contain all the even numbers?

Undecidable Problems About Turing Machines 24/28

Page 25: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

All the problems about Turing machines that involve only the languagethat the TM accepts are undecidable.

ExamplesIs the language accepted by the TM empty?Is the language accepted by the TM finite?Is the language accepted by the TM regular?Is the language accepted by the TM context-free language?Does the language accepted by the TM contain the string “helloworld”?Does the language accepted by the TM contain all the even numbers?

Undecidable Problems About Turing Machines 25/28

Page 26: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Rice’s theorem does not imply that everything about Turing machines isundecidable.

ExampleIt is decidable if a Turing machine has five states.

Undecidable Problems About Turing Machines 26/28

Page 27: CM0081 Undecidable Problems About Turing Machines

Rice’s Theorem

Rice’s theorem does not imply that everything about Turing machines isundecidable.ExampleIt is decidable if a Turing machine has five states.

Undecidable Problems About Turing Machines 27/28

Page 28: CM0081 Undecidable Problems About Turing Machines

References

Hopcroft, J. E., Motwani, R. and Ullman, J. D. (2007). Introduction toAutomata theory, Languages, and Computation. 3rd ed. Pearson Education.

Undecidable Problems About Turing Machines 28/28