1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.

Slides:



Advertisements
Similar presentations
CS3012 Formal Languages and Compilers Frank Guerin Room 227 Lectures Monday11:00MT3 Tuesday9:00105 St. Marys Tutorials Thursday13:00 Thursday 14:00definitely.
Advertisements

Formal Languages Languages: English, Spanish,... PASCAL, C,... Problem: How do we define a language? i.e. what sentences belong to a language? e.g.Large.
Lecture 19. Reduction: More Undecidable problems
YES-NO machines Finite State Automata as language recognizers.
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 Module 3: Classifying Problems One of the main themes of this course will be to classify problems in various ways –By solvability Solvable, “half-solvable”,
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
1 Module 15 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
Lecture 9 Recursive and r.e. language classes
1 Lecture 14 Language class LFSA –Study limits of what can be done with FSA’s –Closure Properties –Comparing to other language classes.
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Lecture 8 Recursively enumerable (r.e.) languages
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]
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Lecture 2: Fundamental Concepts
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
Module 5 Topics Proof of the existence of unsolvable problems
1 Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 26 Decision problems about regular languages –Basic problems are solvable halting, accepting, and emptiness problems –Solvability of other problems.
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Lecture 10 Proving more specific problems are not recursive Reduction technique –Use subroutine theme to show that if one problem is unsolvable, so is.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
Lecture 18 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA and therefore a subset.
1 Lecture 2 Topics –Importance of this material Fundamental Limitations –Connecting Problems and Languages Problems –Search, function and decision problems.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
1 Strings and Languages Operations Concatenation Exponentiation Kleene Star Regular Expressions.
1 Lecture 13 Turing machine model of computation –Sequential access memory (tape) –Limited data types and instructions –Graphical representation –Formal.
1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Lecture 7 Topics –Problems about program behavior At least problem input is a program/algorithm –Halting Problem Fundamental problem about program behavior.
1 Lecture 23 Decision problems about regular languages –Programs can be inputs to other programs FSA’s, NFA’s, regular expressions –Basic problems are.
1 Lecture 13 Turing machine model of computation –Sequential access memory (tape) –Limited data types and instructions –Formal Definition –Equivalence.
1 Module 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Strings and Languages Operations Concatenation Exponentiation Kleene Star Regular Expressions.
1 Module 10 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
MA/CSSE 474 Theory of Computation Functions, Closure, Decision Problems.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
CS 3813: Introduction to Formal Languages and Automata Chapter 12 Limits of Algorithmic Computation These class notes are based on material from our textbook,
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
NP-Completeness  For convenience, the theory of NP - Completeness is designed for decision problems (i.e. whose solution is either yes or no).  Abstractly,
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 Strings and Languages Operations Concatenation Exponentiation Kleene Star Regular Expressions.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
Decidability.
Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex 1.
Chapters 11 and 12 Decision Problems and Undecidability.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
Lecture # 2.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
Turing -Recognizable vs. -Decidable
LECTURE # 07.
Terminology and Symbols
Presentation transcript:

1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem Analysis of programs which solve decision problems –Four types of inputs: yes, no, crash, loop inputs –Solving and not solving decision problems Classifying Decision Problems –Formal definition of solvable and unsolvable decision problems

2 Analyzing Decision Problems Can be defined by two sets

3 Decision Problems and Sets Decision problems consist of 3 sets –The set of legal input instances (or universe of input instances) –The set of “yes” input instances –The set of “no” input instances Yes InputsNo Inputs Set of All Legal Inputs

4 Example Decision sorting –Input: list of integers –Yes/No question: Is the list in nondecreasing order? –Give a yes input instance for this problem. –Give a no input instance for this problem. –Give an illegal input instance for this problem.

5 Redundancy Only two of these sets are needed; the third is redundant –Given The set of legal input instances (or universe of input instances) –This is given by the description of a typical input instance The set of “yes” input instances –This is given by the yes/no question –We can compute The set of “no” input instances

6 Typical Input Universe  *: The set of all finite length strings over finite alphabet  –Examples {a}*: {/\, a, aa, aaa, aaaa, aaaaa, … } {a,b}*: {/\, a, b, aa, ab, ba, bb, aaa, aab, aba, abb, … } {0,1}*: {/\, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, … } The set of all integers If the input universe is understood, a decision problem can be specified by just giving the set of yes input instances

7 Language Recognition Problem Input Universe –  * for some finite alphabet  Yes input instances –Some set L subset of  * No input instances –  * - L When  is understood, a language recognition problem can be specified by just stating what L is.

8 Equivalence of Decision Problems and Languages All decision problems can be formulated as language recognition problems –Simply develop an encoding scheme for representing all inputs of the decision problem as strings over some fixed alphabet  –The corresponding language is just the set of strings encoding yes input instances In what follows, we will often use decision problems and languages interchangeably

9 Visualization Yes Inputs Original Decision Problem No Inputs Encoding Scheme over alphabet  Language L  * - L Corresponding Language Recognition Problem

10 Analyzing Programs which Solve Decision Problems Four possible outcomes

11 Program Declaration Suppose a program P is designed to solve some decision problem . What does P’s declaration look like? –bool main(input_type x) { What should P return on a yes input instance –return (true); or return (yes); We’ll use both What should P return on a no input instance –return (false); or return (no); Again, we’ll use both

12 Program Declaration II Suppose a program P is designed to solve a language recognition problem . What does P’s declaration look like? –bool main(string x) { We will assume that the string declaration is correctly defined for the input alphabet  –If  = {a,b}, then string will define variables consisting of only a’s and b’s –If  = {a, b, …, z, A, …, Z}, then string will define variables consisting of any string of alphabet characters

13 Programs and Inputs Notation –P denotes a program –x denotes an input for program P 4 possible outcomes of running P on x –P halts and says yes: P accepts input x –P halts and says no: P rejects input x –P halts without saying yes or no: P crashes on input x We typically ignore this case as it can be combined with rejects –P never halts: P infinite loops on input x

14 Programs and the Set of Legal Inputs Based on the 4 possible outcomes of running P on x, P partitions the set of legal inputs into 4 groups –Y(P): The set of inputs P accepts When the problem is a language recognition problem, Y(P) is often represented as L(P) –N(P): The set of inputs P rejects –C(P): The set of inputs P crashes on –I(P): The set of inputs P infinite loops on Because L(P) is often used in place of Y(P) as described above, we use notation I(P) to represent this set

15 Illustration All Inputs Y(P)N(P)C(P) I(P)

16 Analyzing Programs and Decision Problems Distinguish the two carefully

17 Program solving a decision problem Formal Definition: –A program P solves decision problem  if and only if The set of legal inputs for P is identical to the set of input instances of  Y(P) is the same as the set of yes input instances for  N(P) is the same as the set of no input instances for  –Otherwise, program P does not solve problem  Note C(P) and I(P) must be empty in order for P to solve problem  Y(P)N(P)C(P) I(P)

18 Solvable Problem A decision problem  is solvable if and only if there exists some C ++ program P which solves  –When the decision problem is a language recognition problem for language L, we often say that L is solvable or L is decidable A decision problem  is unsolvable if and only if all C ++ programs P do not solve  –Similar comment as above

19 Illustration of Solvability Inputs of Program P Y(P)N(P) C(P)I(P)C(P)I(P) Inputs of Problem  Yes InputsNo Inputs

20 Program half- solving a problem Formal Definition: –A program P half-solves problem  if and only if The set of legal inputs for P is identical to the set of input instances of  Y(P) is the same as the set of yes input instances for  N(P) union C(P) union I(P) is the same as the set of no input instances for  –Otherwise, program P does not half-solve problem  Note C(P) and I(P) need not be empty Y(P)N(P)C(P) I(P)

21 Half-solvable Problem A decision problem  is half-solvable if and only if there exists some C ++ program P which half-solves  –When the decision problem is a language recognition problem for language L, we often say that L is half-solvable A decision problem  is not half-solvable if and only if all C ++ programs P do not half- solve 

22 Illustration of Half-Solvability Inputs of Program P Y(P)N(P) C(P)I(P) Inputs of Problem  Yes InputsNo Inputs

23 Hierarchy of Decision Problems Solvable The set of half-solvable decision problems is a proper subset of the set of all decision problems The set of solvable decision problems is a proper subset of the set of half-solvable decision problems. Half-solvable All decision problems

24 Why study half-solvable problems? A correct program must halt on all inputs Why then do we define and study half-solvable problems? One Answer: the set of half-solvable problems is the natural class of problems associated with general computational models like C ++ –Every program half-solves some decision problem –Some programs do not solve any decision problem In particular, programs which do not halt do not solve their corresponding decision problems

25 Key Concepts Four possible outcomes of running a program on an input The four subsets every program divides its set of legal inputs into Formal definition of –a program solving (half-solving) a decision problem –a problem being solvable (half-solvable) Be precise: with the above two statements!