• No results found

Lecture 26: Turing Machines and Decidability

N/A
N/A
Protected

Academic year: 2022

Share "Lecture 26: Turing Machines and Decidability"

Copied!
31
0
0

Loading.... (view fulltext now)

Full text

(1)

CS310 : Automata Theory 2019

Lecture 26: Turing Machines and Decidability

Instructor: S. Akshay

IITB, India

11-03-2019

(2)

Recap: Turing machines and their variants

Turing machines

I Finite state automata with infinite tape

I Formal definition as a 7 tuple.

I Configurations and computations of a TM I Turing recognizable and decidable languages

Variants of a Turing machine I Single vs Multiple heads I Single vs Multiple tapes

I Deterministic vs Non-deterministic TM

(3)

Recap: Turing machines and their variants

Turing machines

I Finite state automata with infinite tape I Formal definition as a 7 tuple.

I Configurations and computations of a TM I Turing recognizable and decidable languages

Variants of a Turing machine I Single vs Multiple heads I Single vs Multiple tapes

I Deterministic vs Non-deterministic TM

(4)

Recap: Turing machines and their variants

Turing machines

I Finite state automata with infinite tape I Formal definition as a 7 tuple.

I Configurations and computations of a TM

I Turing recognizable and decidable languages

Variants of a Turing machine I Single vs Multiple heads I Single vs Multiple tapes

I Deterministic vs Non-deterministic TM

(5)

Recap: Turing machines and their variants

Turing machines

I Finite state automata with infinite tape I Formal definition as a 7 tuple.

I Configurations and computations of a TM I Turing recognizable and decidable languages

Variants of a Turing machine I Single vs Multiple heads I Single vs Multiple tapes

I Deterministic vs Non-deterministic TM

(6)

Recap: Turing machines and their variants

Turing machines

I Finite state automata with infinite tape I Formal definition as a 7 tuple.

I Configurations and computations of a TM I Turing recognizable and decidable languages

Variants of a Turing machine I Single vs Multiple heads I Single vs Multiple tapes

(7)

Decidable languages

I A TMaccepts language Lif it has an accepting runon each word inL.

I A TMdecides languageL if it acceptsL and halts on all inputs.

Decidable and Turing recognizable languages

I A languageL isdecidable (recursive) if there exists a Turing machine M which decidesL (i.e.,M halts on all inputs and M acceptsL).

I A languageL isTuring recognizable (recursively enumerable) if there exists a Turing machine M which acceptsL.

(8)

Algorithms and Decidability

Algorithms ⇐⇒ Decidable (i.e, TM decides it)

I A decision problem P is said to be decidable (i.e., have an algorithm)if the language Lof all yes instances to P is decidable.

I A decision problem P is said to be semi-decidable (i.e., have a semi-algorithm)if the language Lof all yes instances to P is r.e.

I A decision problem P is said to be undecidableif the languageLof all yes instances toP is not decidable.

(9)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

(10)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

(11)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

But how do we encode <B>? In general a TM?

(12)

Encoding Turing machines as strings

Every Turing machine can be encoded as a string in {0,1}

Just encode the description of the machine (in binary)! Every string in{0,1} is a TM

Of course, some strings don’t represent a valid encoding, then we can map them to a TM that does nothing.

Notation

I M →<M >, a string representation ofM. I α→Mα, a TM representation of a string.

(13)

Encoding Turing machines as strings

Every Turing machine can be encoded as a string in {0,1} Just encode the description of the machine (in binary)!

Every string in{0,1} is a TM

Of course, some strings don’t represent a valid encoding, then we can map them to a TM that does nothing.

Notation

I M →<M >, a string representation ofM. I α→Mα, a TM representation of a string.

(14)

Encoding Turing machines as strings

Every Turing machine can be encoded as a string in {0,1} Just encode the description of the machine (in binary)!

Every string in {0,1} is a TM

Of course, some strings don’t represent a valid encoding, then we can map them to a TM that does nothing.

Notation

I M →<M >, a string representation ofM. I α→Mα, a TM representation of a string.

(15)

Encoding Turing machines as strings

Every Turing machine can be encoded as a string in {0,1} Just encode the description of the machine (in binary)!

Every string in {0,1} is a TM

Of course, some strings don’t represent a valid encoding, then we can map them to a TM that does nothing.

Notation

I M →<M >, a string representation ofM. I α→Mα, a TM representation of a string.

(16)

Encoding Turing machines as strings

Every Turing machine can be encoded as a string in {0,1} Just encode the description of the machine (in binary)!

Every string in {0,1} is a TM

Of course, some strings don’t represent a valid encoding, then we can map them to a TM that does nothing.

Notation

I M →<M >, a string representation ofM. I α→M , a TM representation of a string.

(17)

How many Turing machines are there?

Countable set

A set is countable if there is an injective map from the set to N.

The set{0,1} is countable

(18)

How many Turing machines are there?

Countable set

A set is countable if there is an injective map from the set to N. The set {0,1} is countable

(19)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

I (Emptiness problem for DFA) Given a DFA does it accept any word?

I LDFA={<B>|B is a DFA,L(B) =∅}

I (Equivalence problem for DFA) Given two DFAs, do they accept the same language?

I LEQDFA={<A,B >|A,B are DFAs,L(A) =L(B)} I What about NFAs, regular expressions

(20)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

I (Emptiness problem for DFA) Given a DFA does it accept any word?

I LDFA={<B>|B is a DFA,L(B) =∅}

I (Equivalence problem for DFA) Given two DFAs, do they accept the same language?

I LEQDFA={<A,B >|A,B are DFAs,L(A) =L(B)} I What about NFAs, regular expressions

(21)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

I (Emptiness problem for DFA) Given a DFA does it accept any word?

I LDFA={<B>|B is a DFA,L(B) =∅}

I (Equivalence problem for DFA) Given two DFAs, do they accept the same language?

I LEQDFA={<A,B >|A,B are DFAs,L(A) =L(B)} I What about NFAs, regular expressions

(22)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

I (Emptiness problem for DFA) Given a DFA does it accept any word?

I LDFA={<B>|B is a DFA,L(B) =∅}

I (Equivalence problem for DFA) Given two DFAs, do they accept the same language?

I LEQDFA={<A,B >|A,B are DFAs, L(A) =L(B)}

I What about NFAs, regular expressions

(23)

Examples of Decidable languages and problems

I (Acceptance problem for DFA) Given a DFA does it accept a given word?

I LADFA={<B,w >|B is a DFA that accepts input wordw}

I (Emptiness problem for DFA) Given a DFA does it accept any word?

I LDFA={<B>|B is a DFA,L(B) =∅}

I (Equivalence problem for DFA) Given two DFAs, do they accept the same language?

I LEQDFA={<A,B >|A,B are DFAs, L(A) =L(B)}

I What about NFAs, regular expressions

(24)

Relationship among languages

Regular (Decidable ⊆

?

Turing recognizable ⊆

?

All languages

DFA/NFA <Algorithms/Halting TM≤

?

Semi-algorithms/TM

(25)

Relationship among languages

Regular (Decidable ⊆

?

Turing recognizable ⊆

?

All languages

DFA/NFA <Algorithms/Halting TM≤

?

Semi-algorithms/TM

(26)

Relationship among languages

Regular (Decidable ⊆

?

Turing recognizable ⊆

?

All languages

DFA/NFA <Algorithms/Halting TM≤

?

Semi-algorithms/TM

(27)

Languages outside R.E.

Thm: There exist languages that are not R.E I Number of R.E languages is countable. Why?

I Set S of all words over a finite alphabet Σ is countably infinite. I Set of all languages over Σ is the set of subsets ofS and is therefore

uncountable Why? - recall Cantor from Discrete Structure’s course. I So for some such language, there must be no accepting TM. Diagonalization

(28)

Languages outside R.E.

Thm: There exist languages that are not R.E I Number of R.E languages is countable. Why?

I Set S of all words over a finite alphabet Σ is countably infinite.

I Set of all languages over Σ is the set of subsets ofS and is therefore uncountable Why? - recall Cantor from Discrete Structure’s course. I So for some such language, there must be no accepting TM. Diagonalization

(29)

Languages outside R.E.

Thm: There exist languages that are not R.E I Number of R.E languages is countable. Why?

I Set S of all words over a finite alphabet Σ is countably infinite.

I Set of all languages over Σ is the set of subsets ofS and is therefore uncountable Why?

- recall Cantor from Discrete Structure’s course. I So for some such language, there must be no accepting TM. Diagonalization

(30)

Languages outside R.E.

Thm: There exist languages that are not R.E I Number of R.E languages is countable. Why?

I Set S of all words over a finite alphabet Σ is countably infinite.

I Set of all languages over Σ is the set of subsets ofS and is therefore uncountable Why? - recall Cantor from Discrete Structure’s course.

I So for some such language, there must be no accepting TM. Diagonalization

(31)

Languages outside R.E.

Thm: There exist languages that are not R.E I Number of R.E languages is countable. Why?

I Set S of all words over a finite alphabet Σ is countably infinite.

I Set of all languages over Σ is the set of subsets ofS and is therefore uncountable Why? - recall Cantor from Discrete Structure’s course.

I So for some such language, there must be no accepting TM.

Diagonalization

References

Related documents

I Section 9.3, Introduction to Automata Theory, Languages and Computation, Hopcroft, Motwani and Ullman.. I Chapter 5, Introduction to the Theory of Computation,

A languages is known as DSPACE(O(n)), if it is accepted using linear space on a Deterministic Turing machine. Clearly, DSPACE is a subset of NSPACE, but it is not known

Essential Abstractions in GCC GCC Resource Center, IIT Bombay.. July 2010 Spim MD Levels 0,1: Retargeting GCC to Spim: A Recap 13/39. Building a Cross-Compiler

2 July 2011 Spim MD Levels 0,1: Systematic Construction of Machine Descriptions 2/38.. In Search of Modularity in

In general, we use the finite control to process the symbols that are being read on tape.. How does one

A language is decidable (or recursive) if there is a Turing machine accepting it, which has the additional property that it halts on all possible inputs... Variants of a Turing

A language is decidable (or recursive) if there is a Turing machine accepting it, which has the additional property that it halts on all possible inputs.. Every decidable language

Every Turing machine can be encoded as a string in {0, 1} ∗ I Just encode the description of the machine (in binary). I i.e., the 7-tuple: states, alphabet,