CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.

Slides:



Advertisements
Similar presentations
Applied Computer Science II Chapter 4: Decidability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
1 CSC3130 Formal Languages and Automata Theory Tutorial 9 Undecidable Problem KN Hung SHB 1026.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Introduction to Computability Theory
The Halting Problem Sipser 4.2 (pages ). CS 311 Mount Holyoke College 2 Taking stock All languages Turing-recognizable Turing-decidable Context-free.
The Halting Problem Sipser 4.2 (pages ).
CSCI 2670 Introduction to Theory of Computing October 19, 2005.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
CHAPTER 4 Decidability Contents Decidable Languages
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.1: Decidable Languages) David Martin With modifications.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
CS 310 – Fall 2006 Pacific University CS310 The Halting Problem Section 4.2 November 15, 2006.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Computer Language Theory
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Midterm 2 review Jundong Liu School of EECS
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CSCI 2670 Introduction to Theory of Computing October 12, 2005.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
CSCI 2670 Introduction to Theory of Computing
The Acceptance Problem for TMs
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Recursively Enumerable and Recursive Languages
This statement is false.
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Reductions
Lecture12 The Halting Problem
CSCI 2670 Introduction to Theory of Computing
Reductions Costas Busch - LSU.
BCS 2143 Theory of Computer Science
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Decidable Languages Costas Busch - LSU.
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
CS21 Decidability and Tractability
Formal Languages, Automata and Models of Computation
Intro to Theory of Computation
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
Presentation transcript:

CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics

Computability Theory Decidability

Motivation Turing machines: a general purpose computer; Formalizes the notion of an algorithm (Church-Turing thesis) We now turn our attention into the power of algorithms (i.e. Turing machines) to solve problems Try to understand the limitation of computers

Is studying decidability useful? An example of a decidable problem: Is a string a member of a context-free language? This problem is at the heart of the problem of recognizing and compiling programs in a programming language

Preliminaries Acceptance problem: Does DFA B accept input string w? For convenience we use languages to represent various computational problems So, the acceptance problem can be expressed as a language A DFA = { | B is a DFA that accepts input string w}

Preliminaries A DFA = { | B is a DFA that accepts input string w} The problem of testing whether a DFA B accepts a string w is the same as testing whether is a member of the language A DFA Thus, showing that the language is decidable is the same as showing that the computational problem is decidable!

Examples of Decidable Languages A DFA = { | B is a DFA that accepts input string w} Theorem: A DFA is a decidable language Proof idea: Design a TM M that decides A DFA How? On input Simulate B on input w If simulation ends in accepting state, accept, otherwise reject

Examples of Decidable Languages A NFA = { | B is a NFA that accepts input string w} Theorem: A NFA is a decidable language Proof idea: Design a TM M that decides A NFA How? On input Convert NFA B into equivalent DFA C Run previous TM on input If that TM accepts, accept, otherwise reject

Examples of Decidable Languages A REX = { | R is a regular expression that generates string w} Theorem: A REX is a decidable language Proof idea: Design a TM M that decides A REX How? On input Convert R into equivalent NFA C Run previous TM on input If that TM accepts, accept, otherwise reject

Examples of Decidable Languages A CFG = { | G is a CFG that generates string w} Theorem: A CFG is a decidable language Proof idea: Design a TM M that decides A CFG How? (Interested students can read the book p. 156)

Examples of Decidable Languages Theorem: Every CFG is a decidable

Relationships among classes of languages regular Context-free decidable enumerable

The Haling Problem One of the most philosophically important theorems of the theory of computation Computers (and computation) are limited ina very fundamental way Common, every-day problem are unsolvable Does a program sort an array of integers? Both program and specification are precise But, automating the verification is undecidable No computer program can perform the task of checking the program against the specification!

Halting Problem Halting problem: Does a Turing machine accept a string? A TM = { | M is a Turing machine that accepts string w} Theorem: A TM is undecidable

Halting Problem Before proving that A TM is undecidable, note that A TM is enumerable How? Design a Turing Machine U that recongnizes A TM On input Simulate M on w If M ever enters its accept state, accept, and if M ever enters its reject state reject U is called a universal Turing machine

Diagonalization Diagonalization: a very crucial technique that is useful to prove undecidability A TM Question: what does it mean to say that two infinite sets are the same size? Answered by Georg cantor in 1873 How? Pair them off!

Correspondence Recall a correspondence f: A  B is a bijection: Injective Surjective Question: what does it mean to say that two infinite sets are the same size? Answer: A and B are the same size if there is a correspondence from A to B

Correspondence Question: in a crowded room, how can we tell if there are more people than chairs, or more chairs than people?

Correspondence Question: in a crowded room, how can we tell if there are more people than chairs, or more chairs than people? Answer: Establish a correspondence: ask everyone to sit down!

Correspondence Claim: The set of Natural numbers has the same size as the set of even numbers!

Correspondence Claim: The set of Natural numbers has the same size as the set of even numbers! Proof: Establish a correspondence Let f(i)=2i Remark: a proper subset of A can be the same size as A!!!!

Countable Definition: A set A is countable iff Either it is finite, or It has the same size as N, the set of natural numbers We have just seen that the set of even numbers is countable Claim: The set Z of integers is countable Proof: Define f:N  Z by f(i)=i/2 If i is even f(i)=-(ceil(i/2) +1) if i is odd

Challenge In Heaven, there is a hotel with a countable number of rooms One day, the society of Prophets, Oracles, and AI researchers hold a convention that books every room in the hotel Then one more guest arrives, angrily demanding a room You are the manager. What to do?

Challenge Then one more guest arrives, angrily demanding a room You are the manager. What to do? Answer: Ask the guest in room i to move to room i+1, and put the new comer in room 1!

Challenge Then a countable number of guests arrive, all angrily demanding a room Now What to do?

Challenge Then a countable number of guests arrive, all angrily demanding a room Now What to do? Answer: Ask the guest in room i to move to room 2i, and put the new comers in odd numbered rooms !!!! (Infinity is such an amazing thing!!)

Rational Numbers Let Q ={m/n | m and n are natural numbers} Theorem: Q is countable What is the correspondence between N and Q?

Rational Numbers 1/11/21/31/41/51/61/71/8 …….. 2/12/22/32/42/52/62/72/8 …….. 3/13/23/33/43/53/63/73/8 …….. 4/14/24/34/44/54/64/74/8 ……

Rational Numbers 1/11/21/31/41/51/61/71/8 …….. 2/12/22/32/42/52/62/72/8 …….. 3/13/23/33/43/53/63/73/8 …….. 4/14/24/34/44/54/64/74/8 …….. Enumerate numbers along Northeast and Southwest diagonals, and skip duplicates

Rational Numbers 1/11/21/31/41/51/61/71/8 …….. 2/12/22/32/42/52/62/72/8 …….. 3/13/23/33/43/53/63/73/8 …….. 4/14/24/34/44/54/64/74/8 …….. Does this mean that every infinite set is countable?

The Real Numbers Theorem: R, the set of reals is uncountable Cantor introduced the diagonalization method to prove this theorem!

The Real Numbers Theorem: R, the set of reals is uncountable Proof: By contradiction Assume there is a correspondence between N and R Write it down We show now that there a number x not in the list! n f(n) …… … … …

Diagonalization Proof: By contradiction Pick x between 0 and 1, so non-zero digits follow decimal point First fractional digit of f(1) is 1 Pick first fractional digit of x to be different, say 2 Second fractional digit of f(2) is 4 Pick second fractional digit of x to be different, say 6 And so on …. X=0.2487…. Thus x is not the image of any natural which is a contradiction So, R is uncountable! n f(n) …… … … …

Important implications Previous theorem has an important application to the theory of computation It shows that some languages are not decidable! Or even Turing machine recognizable There are languages that are not enumerable The set of Turing machines is countable The set of languages is uncountable

Important implications Theorem: The halting problem is undecidable Proof uses diagonalization technique (see bok those interested) Theorem: A language is decidable if and only if it is both Turing-recognizable and co-Turing recognizable In other words, a language is decidable if and only if it and its compliment are Turing- recognizable (enumerable)

enumerable A non-enumerable language Corollory: if L is not decidable, then either L or its compliment is not enumerable Co-enumerable decidable ????

Conclusions Decidable languages Halting problem diagonalization method undecidable example