Theory of Computation CSCI 3434, Spring 2010

Size: px
Start display at page:

Download "Theory of Computation CSCI 3434, Spring 2010"

Transcription

1 Homework 4: Solutions Theory of Computation CSCI 3434, Spring This was listed as a question to make it clear that you would lose points if you did not answer these questions or work with another student in the class. Some of the content in these solutions was taken from wikipedia. 2. A context-sensitive grammar (CSG) is an unrestricted grammar where every rule is of the form: α β where β α S ε is allowed only if S does not appear on the right-hand side of any rule A context-sensitive language (CSL) is a language that can be generated by a CSG. CSLs can be computed by a linearly-bounded Turing Machine, a TM that uses only the space used by the input. Construct CSGs for the following languages over Σ = {0, 1}: a. { 0 n 1 n 0 n 1 n n 0} S BCDT 0101 ε Generates strings of characters with equal numbers T ABCDT ABCD of B, C, and D, and 1 fewer A. ========== BA AB CA AC Rules to rearrange letters and CB BC DA AD put them in correct order DB BD DC CD ========= DT T1 CT U0 These rules turn the non-terminals A-D into CU U0 BU V1 the appropriate terminals. The end symbol BV V1 AV X0 goes from T to U to V to X to insure that we can t AX X0 X 0 change them when they re out of order. There was 1 fewer A, so turn end symbol to 0 when finished. Note this can be done a bit more simply if we start with the initial 0s at the beginning. b. { ww w {0, 1}* }

2 c. {0 n x 1 n x n } S ZLQ 01 ε Z is last 0 before start of x; Q is first 1 after x. L A0LB A1LB 1 0 1P 0P Generate x, along with an A and B for each char. P AB ABP Generate additional As and Bs beyond len of x. ========= 0A A0 1A A1 Rearrange non-terminals to push As to the left B0 0B B1 1B and Bs to the right. BA AB ========= ZA 0Z BQ Q1 When A passes Z or B passes Q, make into 0 or 1. Z 0 Q 1 Turn Z into 1 and Q and into Construct TMs for the following languages over Σ = {0, 1}: a. { 0 n 1 n 0 n n 0} Idea: Use a 2-tape TM (2TM). Copy the first group of 0s to tape 2. Then read these 0s (can read from right to left on tape 2) while reading 1s on tape 1 to verify there are the same number. Read tape 2 again (left to right this time) while reading the last group of 0s on tape 1 to verify there are the same number. b. { v#w w {0, 1}*, v is a substring of w } Idea: Use a 2TM. Read v and copy it to tape 1. Then nondeterministically determine (guess) when in w to begin comparing to v as follows: When # is read, move to beginning of w on tape 1 and back to the beginning of tape 2. Begin reading w, and at each character, nondeterministically begin reading v if you haven t already begun reading it. Once you begin reading v, verify that each character of v matches the current character of w. Continue reading both v and w until a character differs (reject), you reach the end of v (accept), or you reach the end of v without reaching the end of w (reject). 4. Construct TMs for the following functions with Σ = {0, 1}: a. f (x)=x+1, x is a binary integer Idea: Read to the end of the input. If the last character is a 0, change it to 1 and you re done. If it s a 1, change it to 0, then move one character to the left and repeat. If you get to a blank (in front of the first digit) without yet encountering a 0 to change to a 1, replace this leading blank with a 1.

3 b. f (x,y)=x+y, x,y are binary integers Idea: Use a 3TM. Copy x to tape 2 and y to tape 3, clearing tape 1 as it s read. Then begin at the end of the strings on tapes 2 and 3. Move from right to left, placing the correct sum on tape 1, and keeping track of carry bits using the states of the 3TM. c. f (0 i ) = 0 m, m = i 2 Idea: Use a 3TM. Copy all i 0s to tape 2, and i -1 0s to tape 3. Tape 2 will always contain i 0s, and tape 3 will be a counter showing how many more times i 0s (copied from tape 2) need to be appended to tape Describe the Kuroda normal form. Modify this definition to allow languages that include the empty string. Why is the Kuroda normal form useful to programmers? A grammar is in Kuroda normal form if all rules are of the following types: AB CD A BC A B A a Where A, B, C, and D are non-terminals and a is a terminal. We could modify Kuroda normal form to allow the empty string by adding a similar rule to that for CSGs, where we allow the rule S ε only if S does not appear on the right side of any rule. Kuroda normal form has many of the same advantages as Chomsky normal form: while any CSG that doesn t contain the empty string can be written in KNF, but derivation trees are all binary, allowing them to be more easily described than derivations in an arbitrary CSG. This allows a parsing algorithm similar to the CYK algorithm for CFGs. 6. Describe the Chomsky Hierarchy of languages. Give a Venn diagram that includes the following language types: context-free, context-sensitive, deterministic context-free, finite, recursively enumerable, regular. Give a table that gives a machine that can accept each of these languages (and only those languages e.g., do not say a Turing Machine accepts regular languages).

4 Recursively Context-Sensitive Context-Free Deterministic Context-Free Regular Finite context-free context-sensitive deterministic context-free finite recursively enumerable regular PDA linear-bounded TM DPDA DFM or NFM without any loops TM DFM, NFM 7. What is the Church-Turing thesis? 8. Show that the following problems are undecidable: a. P Accept : Given a TM M and input x, is x L(M) (does M accept x)? Note that this differs from P Halt, because a TM may halt simply because there are no allowed transitions from the current configuration (state and tape symbol) without transitioning to the accept state. P Halt P Accept : Given any P Halt instance, with a TM M and input x, construct another TM M' that simulates M on any input, then if M would halt, M' accepts. M' will accept anything on which M would halt, and if M would halt, then M' accepts, so we can determine the answer to the Halting problem if we could answer P Accept. So P Accept must also be undecidable. b. P 2Nonblank : Given a 2-tape TM M and input x, does M ever write a non-blank symbol on tape 2 when run on x? P Halt P 2Nonblank : Given any P Halt instance, with a TM M (assumed to have 1 tape) and input x, construct another TM M' that simulates M on any input, then if M would halt, M' writes a non-blank symbol on tape 2. M' will write a nonblank symbol on tape 2 if M would halt, and if M would halt, then M' writes

5 a nonblank symbol on tape 2, so we can determine the answer to the Halting problem if we could answer P 2Nonblank. So P 2Nonblank must also be undecidable. 9. Ex on p. 28. a. This modification says that each vertex must have at least one color instead of exactly one color. So, this transformation to SAT differs in semantics from the 3-Color problem. However, to be a transformation means that the Boolean formula is satisfiable if and only if the graph can be 3-colored, and semantic details are irrelevant. Furthermore, it is not necessary to find a satisfying 3-coloring of the graph from the satisfiable Boolean formula, one merely needs to be able to state correctly whether the graph is 3-colorable or not. In this case, since there are clauses requiring that no color can be true for both vertices connected by edge, this is a valid transformation. If there is not a satisfying truth assignment to this relaxed (more permissive) mapping to SAT, then there is no way to 3-color the graph. If there is a satisfying truth assignment, see part b. b. If there is a satisfying truth assignment, and if a vertex is assigned all 3 colors, then (by the edge clauses) that vertex must not have any neighbors (if it had a neighbor, it could not be any of the 3 colors by the edge clauses, but it must have at least one color by the vertex clause, a contradiction), so this node can be given any color. If a vertex is assigned 2 colors, then all neighbors must be assigned only the 3 rd color, so either of the 2 colors can be chosen to give a valid 3-coloring of the graph. 10. Ex. 4.4 on p i. If A and B are two problems in NP, A is NP-complete, and there is a polynomial-time transformation from A to B then B is NP-complete as well. TRUE ii. iii. iv. If A and B are two problems in NP, A is NP-complete, and there is a polynomial-time transformation from B to A then B is NP-complete as well. FALSE: Any problem in P (which is contained in NP) can be transformed to any NP-complete problem. If A and B are two NP-complete problems then there is a polynomial-time transformation from A to B and also a polynomial-time transformation from B to A. TRUE: By the definition of an NP-complete problem, any problem in NP (including all NP-complete problems) can be polynomial-time reduced to the given NP-complete problem. If A is a problem that cannot be solved in polynomial time and there is a polynomial-time transformation from A to B then B cannot be solved in polynomial time either. TRUE: If B could be solved in polynomial time, so could A.

6 v. Any problem A that can be transformed into Circuit Satisfiability by a polynomial-time transformation is NP-complete. FALSE: See part Ex. 4.6 on p Show that the following problems are NP-complete: a. Longest Common Subsequence: Given an alphabet, a finite set of strings on the alphabet R *, and a natural number k, does there exist a string w *, of length at least k, that is a subsequence of each string in R? Note that a valid subsequence does not need to contain consecutive characters as in the original string, but it does need to retain order. (Hint: transform from Independent Set or Vertex Cover.) This problem has applications to genome sequencing and gene function prediction using sequence similarity. 1) The problem LCS is in NP, as we can use a NTM to guess a substring and check (in polynomial time) to see whether it is a common subsequence. Using the validation definition of NP, we can verify an input solution to LCS in polynomial time. 2). LCS is NP-hard: We can show that LCS can be reduced in polynomial time from VC, which is proven to be NP-complete. The proof is actually a reduction from Independent- Set (find a set of vertices with no edges amongst them), another NP-complete problem, but since we didn t discuss this problem, we ll sketch a reduction from Vertex-Cover (VC) to Independent-Set (IS) first. In both VC and IS we are given a graph G and positive integer k, but in VC we are concerned with finding a small vertex cover (with at most k vertices), while IS seeks to find a large independent set (with at least k vertices). If we have a vertex cover for graph G, meaning a set of vertices that cover all edges (include at least one vertex of each edge), then the remaining vertices form an independent set, meaning there are no edges between any two vertices in the independent set. If there were an edge between any pair of the remaining vertices, then this edge would not be covered by the vertex cover. Conversely, if we have an independent set, any edges have at least one vertex in the remaining vertices, so the remaining vertices form a vertex cover. So, the vertex-cover determines an independent set, and vice versa. So, if we have a vertex cover of (at most) k, we have an independent set of (at least) k = V - k, and vice versa. IS is clearly also in NP (given an alleged independent set, we can check there are no edges between any pair of vertices in the set in polynomial time), so it is NP-complete.

7 We can show that the problem of finding the k = V - k independent set of instance <G, k > can be solved by finding the solution to a corresponding LCS instance <B, k >. Given an instance <G, k > of IS with G=(V, E), we construct an instance <R, k > of LCS as follows: The finite set of strings R contains E +1 strings over the alphabet set =V. For each edge, v, v (assuming i< j), the corresponding string is given by listing i j all vertices in order twice, with v i missing from the first list of vertices, and v j missing from the second: vv 1 2Lvi 1vi+ 1LvjLvvv n 1 2LviLvj 1vj+ 1L vn. Besides these E strings, we also have a string t given by. vv Lv 1 2 n Assume that we find a common subsequence s of length at least k (a yes instance). The common subsequence cannot contain both vertices of an edge in G, and all of them are distinctive. This is because the string t in B implies that the common sequence is a vertex sequence with increasing order subscripts. In the string corresponding to any edge v, v (we always let i j), always appears after v j i j < i, and therefore they cannot both appear in the common sequence s. So, if s is of length at least k, it must be composed of distinct vertices, no pair of which are connected by an edge of G. So, the vertices indicated by s compose an independent set of G, and thus we also find the vertex-cover set accordingly. Conversely, if there is an independent set of G of size at least k, then these vertices (in order) are a subsequence of every string in B. So, an instance of the IS problem is a yes instance if and only if it maps to a yes instance of LCS. b. Set-Cover: Given a collection of n sets, are there k of these sets whose union is the same as the union of all n sets? (Hint: transform from Vertex Cover.) 13. The following are flawed proofs purporting to settle the issue of P vs NP. Point out the flaw in each proof. a. We prove P=NP nonconstructively by showing that, for each polynomial-time NTM, there must exist an equivalent polynomial-time (deterministic) TM. By definition, the NTM applies a choice function at each step in order to determine which of several possible next moves it will make. If there is a suitable move that will lead to accepting the string, it will choose; otherwise the choice is irrelevant. In the latter case, the TM can simulate the NTM by using any arbitrary move from the NTM s choice of moves. In the former case, although we do not know which is the correct next move, this move does exist; thus there exists a deterministic machine that correctly simulates the NTM at this step. By merging these steps, we get a deterministic machine that correctly v

8 simulates the NTM (although we don t know don t know what it is). Therefore, P=NP. The flaw is that the argument only applies for a specific yes instance: the NDTM, arriving at some decision point, will presumably take different branches depending on the instance, so that we would have, not one, but many DTMs corresponding to that one NDTM. So, the logic is correct for a single instance but we knew that a single instance is easy to solve anyway; and the logic completely fails for an infinite collection of instances. b. We prove P NP by contradiction. Assume P=NP. Then SAT is in P, and thus, for some k, SAT is in TIME(n k ). But every problem in NP reduces to SAT in polynomial time, so that every problem in NP is also in TIME(n k ). Therefore, NP is a subset of TIME(n k ) and hence so is P, since P NP. But the hierarchy theorem for time (which we didn t cover in class, but you should assume is true) tells us that there exists a problem in TIME(n k+1 ) (and thus also in P) that is not in TIME(n k ), a contradiction. Therefore, P NP. The flaw here is in the assertion that, if Satisfiability can be solved in O(n k ) time, so can any problem in NP, simply because any problem in NP reduces to Satisfiability in polynomial time. The time spent in the polynomial-time reduction could prove a problem (if it is bigger than n k ), but a more fundamental flaw is present: the polynomial-time reduction need not preserve the size of the input! An instance of size n of some problem in NP will be transformed in O(n m ) time (for some value of m) into an instance of Satisfiability of size f(n) where the best we can say is that f(n) is O(n m ). Then the assumed solution to Satisfiability solves the transformed instance in time O(f(n) k ), but that may be as large as n m+k and thus not O(n k ).

The Halting Problem is Undecidable

The Halting Problem is Undecidable 185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine

More information

3515ICT Theory of Computation Turing Machines

3515ICT Theory of Computation Turing Machines Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

The Classes P and NP

The Classes P and NP The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

More information

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. 3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

More information

Turing Machines, Part I

Turing Machines, Part I Turing Machines, Part I Languages The $64,000 Question What is a language? What is a class of languages? Computer Science Theory 2 1 Now our picture looks like Context Free Languages Deterministic Context

More information

Turing Machines: An Introduction

Turing Machines: An Introduction CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along

More information

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CSE 135: Introduction to Theory of Computation Decidability and Recognizability CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing

More information

Theory of Computation Chapter 2: Turing Machines

Theory of Computation Chapter 2: Turing Machines Theory of Computation Chapter 2: Turing Machines Guan-Shieng Huang Feb. 24, 2003 Feb. 19, 2006 0-0 Turing Machine δ K 0111000a 01bb 1 Definition of TMs A Turing Machine is a quadruple M = (K, Σ, δ, s),

More information

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

More information

Reading 13 : Finite State Automata and Regular Expressions

Reading 13 : Finite State Automata and Regular Expressions CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

More information

Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU

Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office hour: Tuesday 10:30 11:30 slides: http://www.ist.tugraz.at/pact.html

More information

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification) Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:

More information

C H A P T E R Regular Expressions regular expression

C H A P T E R Regular Expressions regular expression 7 CHAPTER Regular Expressions Most programmers and other power-users of computer systems have used tools that match text patterns. You may have used a Web search engine with a pattern like travel cancun

More information

6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.080/6.089 GITCS Feb 12, 2008. Lecture 3 6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

More information

Automata and Formal Languages

Automata and Formal Languages Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

More information

Complexity Classes P and NP

Complexity Classes P and NP Complexity Classes P and NP MATH 3220 Supplemental Presentation by John Aleshunas The cure for boredom is curiosity. There is no cure for curiosity Dorothy Parker Computational Complexity Theory In computer

More information

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

Introduction to Automata Theory. Reading: Chapter 1

Introduction to Automata Theory. Reading: Chapter 1 Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a

More information

CAs and Turing Machines. The Basis for Universal Computation

CAs and Turing Machines. The Basis for Universal Computation CAs and Turing Machines The Basis for Universal Computation What We Mean By Universal When we claim universal computation we mean that the CA is capable of calculating anything that could possibly be calculated*.

More information

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012

OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012 276 The P vs. NP problem is a major unsolved problem in computer science It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute to carry a $ 1,000,000 prize for the

More information

Lecture 7: NP-Complete Problems

Lecture 7: NP-Complete Problems IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

More information

Computability Theory

Computability Theory CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

More information

Notes on NP Completeness

Notes on NP Completeness Notes on NP Completeness Rich Schwartz November 10, 2013 1 Overview Here are some notes which I wrote to try to understand what NP completeness means. Most of these notes are taken from Appendix B in Douglas

More information

INCIDENCE-BETWEENNESS GEOMETRY

INCIDENCE-BETWEENNESS GEOMETRY INCIDENCE-BETWEENNESS GEOMETRY MATH 410, CSUSM. SPRING 2008. PROFESSOR AITKEN This document covers the geometry that can be developed with just the axioms related to incidence and betweenness. The full

More information

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity

More information

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move. CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write

More information

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

More information

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

More information

Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

More information

Chapter 7 Uncomputability

Chapter 7 Uncomputability Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction

More information

Introduction to Turing Machines

Introduction to Turing Machines Automata Theory, Languages and Computation - Mírian Halfeld-Ferrari p. 1/2 Introduction to Turing Machines SITE : http://www.sir.blois.univ-tours.fr/ mirian/ Automata Theory, Languages and Computation

More information

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac.

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac. Pushdown automata Informatics 2A: Lecture 9 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 3 October, 2014 1 / 17 Recap of lecture 8 Context-free languages are defined by context-free

More information

1 Definition of a Turing machine

1 Definition of a Turing machine Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2012 April 2-16, 2012 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,

More information

Course Manual Automata & Complexity 2015

Course Manual Automata & Complexity 2015 Course Manual Automata & Complexity 2015 Course code: Course homepage: Coordinator: Teachers lectures: Teacher exercise classes: Credits: X_401049 http://www.cs.vu.nl/~tcs/ac prof. dr. W.J. Fokkink home:

More information

The Classes P and NP. mohamed@elwakil.net

The Classes P and NP. mohamed@elwakil.net Intractable Problems The Classes P and NP Mohamed M. El Wakil mohamed@elwakil.net 1 Agenda 1. What is a problem? 2. Decidable or not? 3. The P class 4. The NP Class 5. TheNP Complete class 2 What is a

More information

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information

More information

NP-Completeness I. Lecture 19. 19.1 Overview. 19.2 Introduction: Reduction and Expressiveness

NP-Completeness I. Lecture 19. 19.1 Overview. 19.2 Introduction: Reduction and Expressiveness Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

More information

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS. Christopher Heil Georgia Institute of Technology WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

More information

Properties of Stabilizing Computations

Properties of Stabilizing Computations Theory and Applications of Mathematics & Computer Science 5 (1) (2015) 71 93 Properties of Stabilizing Computations Mark Burgin a a University of California, Los Angeles 405 Hilgard Ave. Los Angeles, CA

More information

Theoretical Computer Science (Bridging Course) Complexity

Theoretical Computer Science (Bridging Course) Complexity Theoretical Computer Science (Bridging Course) Complexity Gian Diego Tipaldi A scenario You are a programmer working for a logistics company Your boss asks you to implement a program that optimizes the

More information

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

More information

Quantum and Non-deterministic computers facing NP-completeness

Quantum and Non-deterministic computers facing NP-completeness Quantum and Non-deterministic computers facing NP-completeness Thibaut University of Vienna Dept. of Business Administration Austria Vienna January 29th, 2013 Some pictures come from Wikipedia Introduction

More information

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch Today Two more models of computation: Nondeterministic Finite Automata (NFAs)

More information

Guessing Game: NP-Complete?

Guessing Game: NP-Complete? Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES 2. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

Finite Automata. Reading: Chapter 2

Finite Automata. Reading: Chapter 2 Finite Automata Reading: Chapter 2 1 Finite Automaton (FA) Informally, a state diagram that comprehensively captures all possible states and transitions that a machine can take while responding to a stream

More information

How To Compare A Markov Algorithm To A Turing Machine

How To Compare A Markov Algorithm To A Turing Machine Markov Algorithm CHEN Yuanmi December 18, 2007 1 Abstract Markov Algorithm can be understood as a priority string rewriting system. In this short paper we give the definition of Markov algorithm and also

More information

Computational Models Lecture 8, Spring 2009

Computational Models Lecture 8, Spring 2009 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown Univ. p. 1 Computational Models Lecture 8, Spring 2009 Encoding of TMs Universal Turing Machines The Halting/Acceptance

More information

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics NP-complete? NP-hard? Some Foundations of Complexity Prof. Sven Hartmann Clausthal University of Technology Department of Informatics Tractability of Problems Some problems are undecidable: no computer

More information

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Why? A central concept in Computer Science. Algorithms are ubiquitous. Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

More information

How To Understand The Theory Of Computer Science

How To Understand The Theory Of Computer Science Theory of Computation Lecture Notes Abhijat Vichare August 2005 Contents 1 Introduction 2 What is Computation? 3 The λ Calculus 3.1 Conversions: 3.2 The calculus in use 3.3 Few Important Theorems 3.4 Worked

More information

Lecture 2: Universality

Lecture 2: Universality CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

More information

Homework until Test #2

Homework until Test #2 MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

More information

Basics of Counting. The product rule. Product rule example. 22C:19, Chapter 6 Hantao Zhang. Sample question. Total is 18 * 325 = 5850

Basics of Counting. The product rule. Product rule example. 22C:19, Chapter 6 Hantao Zhang. Sample question. Total is 18 * 325 = 5850 Basics of Counting 22C:19, Chapter 6 Hantao Zhang 1 The product rule Also called the multiplication rule If there are n 1 ways to do task 1, and n 2 ways to do task 2 Then there are n 1 n 2 ways to do

More information

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis LOGIC AND COMPUTER SCIENCE Phokion G. Kolaitis Computer Science Department, University of California, Santa Cruz, CA 95064, USA Keywords: algorithm, Armstrong s axioms, complete problem, complexity class,

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER JASPER DEANTONIO Abstract. This paper is a study of the Turing Degrees, which are levels of incomputability naturally arising from sets of natural numbers.

More information

Discrete Mathematics Problems

Discrete Mathematics Problems Discrete Mathematics Problems William F. Klostermeyer School of Computing University of North Florida Jacksonville, FL 32224 E-mail: wkloster@unf.edu Contents 0 Preface 3 1 Logic 5 1.1 Basics...............................

More information

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints

More information

Graph Theory Problems and Solutions

Graph Theory Problems and Solutions raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

More information

Compiler Construction

Compiler Construction Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F02-1 Compiler overview source code lexical analysis tokens intermediate code generation

More information

Chapter 9. Systems of Linear Equations

Chapter 9. Systems of Linear Equations Chapter 9. Systems of Linear Equations 9.1. Solve Systems of Linear Equations by Graphing KYOTE Standards: CR 21; CA 13 In this section we discuss how to solve systems of two linear equations in two variables

More information

Mathematical Induction. Lecture 10-11

Mathematical Induction. Lecture 10-11 Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach

More information

Pigeonhole Principle Solutions

Pigeonhole Principle Solutions Pigeonhole Principle Solutions 1. Show that if we take n + 1 numbers from the set {1, 2,..., 2n}, then some pair of numbers will have no factors in common. Solution: Note that consecutive numbers (such

More information

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 4, Number 1 (2014), pp. 79-84 International Research Publications House http://www. irphouse.com /ijict.htm Implementation

More information

Basic Proof Techniques

Basic Proof Techniques Basic Proof Techniques David Ferry dsf43@truman.edu September 13, 010 1 Four Fundamental Proof Techniques When one wishes to prove the statement P Q there are four fundamental approaches. This document

More information

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

More information

8 Divisibility and prime numbers

8 Divisibility and prime numbers 8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

More information

On the Relationship between Classes P and NP

On the Relationship between Classes P and NP Journal of Computer Science 8 (7): 1036-1040, 2012 ISSN 1549-3636 2012 Science Publications On the Relationship between Classes P and NP Anatoly D. Plotnikov Department of Computer Systems and Networks,

More information

SECTION 10-2 Mathematical Induction

SECTION 10-2 Mathematical Induction 73 0 Sequences and Series 6. Approximate e 0. using the first five terms of the series. Compare this approximation with your calculator evaluation of e 0.. 6. Approximate e 0.5 using the first five terms

More information

Answer Key for California State Standards: Algebra I

Answer Key for California State Standards: Algebra I Algebra I: Symbolic reasoning and calculations with symbols are central in algebra. Through the study of algebra, a student develops an understanding of the symbolic language of mathematics and the sciences.

More information

MATH10040 Chapter 2: Prime and relatively prime numbers

MATH10040 Chapter 2: Prime and relatively prime numbers MATH10040 Chapter 2: Prime and relatively prime numbers Recall the basic definition: 1. Prime numbers Definition 1.1. Recall that a positive integer is said to be prime if it has precisely two positive

More information

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the

More information

On the Unique Games Conjecture

On the Unique Games Conjecture On the Unique Games Conjecture Antonios Angelakis National Technical University of Athens June 16, 2015 Antonios Angelakis (NTUA) Theory of Computation June 16, 2015 1 / 20 Overview 1 Introduction 2 Preliminary

More information

Chapter 1. Computation theory

Chapter 1. Computation theory Chapter 1. Computation theory In this chapter we will describe computation logic for the machines. This topic is a wide interdisciplinary field, so that the students can work in an interdisciplinary context.

More information

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

More information

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8] Code No: R05220502 Set No. 1 1. (a) Describe the performance analysis in detail. (b) Show that f 1 (n)+f 2 (n) = 0(max(g 1 (n), g 2 (n)) where f 1 (n) = 0(g 1 (n)) and f 2 (n) = 0(g 2 (n)). [8+8] 2. (a)

More information

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

Introduction to NP-Completeness Written and copyright c by Jie Wang 1 91.502 Foundations of Comuter Science 1 Introduction to Written and coyright c by Jie Wang 1 We use time-bounded (deterministic and nondeterministic) Turing machines to study comutational comlexity of

More information

CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

More information

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard goddard@cse.unl.edu CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes

More information

6.3 Conditional Probability and Independence

6.3 Conditional Probability and Independence 222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted

More information

Universality in the theory of algorithms and computer science

Universality in the theory of algorithms and computer science Universality in the theory of algorithms and computer science Alexander Shen Computational models The notion of computable function was introduced in 1930ies. Simplifying (a rather interesting and puzzling)

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages CHAPTER 3 Finite Automata and Regular Languages 3. Introduction 3.. States and Automata A finite-state machine or finite automaton (the noun comes from the Greek; the singular is automaton, the Greek-derived

More information

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

More information

Boolean Algebra Part 1

Boolean Algebra Part 1 Boolean Algebra Part 1 Page 1 Boolean Algebra Objectives Understand Basic Boolean Algebra Relate Boolean Algebra to Logic Networks Prove Laws using Truth Tables Understand and Use First Basic Theorems

More information

24 Uses of Turing Machines

24 Uses of Turing Machines Formal Language and Automata Theory: CS2004 24 Uses of Turing Machines 24 Introduction We have previously covered the application of Turing Machine as a recognizer and decider In this lecture we will discuss

More information

The last three chapters introduced three major proof techniques: direct,

The last three chapters introduced three major proof techniques: direct, CHAPTER 7 Proving Non-Conditional Statements The last three chapters introduced three major proof techniques: direct, contrapositive and contradiction. These three techniques are used to prove statements

More information

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

More information

Geometry 1. Unit 3: Perpendicular and Parallel Lines

Geometry 1. Unit 3: Perpendicular and Parallel Lines Geometry 1 Unit 3: Perpendicular and Parallel Lines Geometry 1 Unit 3 3.1 Lines and Angles Lines and Angles Parallel Lines Parallel lines are lines that are coplanar and do not intersect. Some examples

More information

GRAPH THEORY LECTURE 4: TREES

GRAPH THEORY LECTURE 4: TREES GRAPH THEORY LECTURE 4: TREES Abstract. 3.1 presents some standard characterizations and properties of trees. 3.2 presents several different types of trees. 3.7 develops a counting method based on a bijection

More information

Near Optimal Solutions

Near Optimal Solutions Near Optimal Solutions Many important optimization problems are lacking efficient solutions. NP-Complete problems unlikely to have polynomial time solutions. Good heuristics important for such problems.

More information

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given

More information

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

More information

Problem Set 7 Solutions

Problem Set 7 Solutions 8 8 Introduction to Algorithms May 7, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Handout 25 Problem Set 7 Solutions This problem set is due in

More information

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees University of Ostrava Institute for Research and Applications of Fuzzy Modeling Reasoning in Description Logic with Semantic Tableau Binary Trees Alena Lukasová Research report No. 63 2005 Submitted/to

More information