The decision problem (entscheidungsproblem), halting problem, & Turing machines. CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/
|
|
- Cecilia Pierce
- 5 years ago
- Views:
Transcription
1 The decision problem (entscheidungsproblem), halting problem, & Turing machines CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/ 1
2 We must not believe those, who today, with philosophical bearing and deliberative tone, prophesy the fall of culture and accept the ignorabimus [i.e., that fundamental ignorance and limitation underly reason, science, logic]. For us there is no ignorabimus, and in my opinion none whatever in natural science. In opposition to the foolish ignorabimus our slogan shall be: Wir müssen wissen; wir werden wissen! We must know; we will know! David Hilbert 2
3 Hilbert s entscheidungsproblem (decision problem): What general process (i.e., algorithm) will decide if a given proposition (in standard firstorder logic, or a similar system) is provable/deducible, or not? (Surely such a process exists!) David Hilbert (generalizes Hilbert s 10th problem from his famous 23 problems for the turn of the century in 1900)
4 But, there are undecidable problems Alan Turing Alonzo Church 4
5 Decision procedures A decision procedure is some algorithm resulting in a Yes or No decision True or False. A decision procedure corresponds to determining if a string is a member of a formal language, or, equivalently, if a proposition holds: is some statement true. The entscheidungsproblem asks specifically for a decision procedure for all statements written in first-order logic. Other examples of decision procedures: Is the string w accepted by the given NFA? Is the string w accepted by the given PDA? Is the string w generated by the given CFG? Is the string w in the language L? 5
6 Undecidable problems Some problems are decidable, there exists a decision procedure that always correctly yields True or False (e.g., a string s membership in a regular language), but some are not. E.g. Is the string w in the language L? is undecidable when L is the language of all C programs without buff. overflow. L is the language of all valid and true english statements. L is the language of all (textually encoded) Conway s game of life states following a particular setup. 6
7 Conway s game of life At each iteration: cells with three living neighbors are alive; cells with two remain as they were; all other cells die. 7
8 Undecidable problems Some problems are decidable, there exists a decision procedure that always correctly yields True or False (e.g., a string s membership in a regular language), but some are not. E.g. Is the string w in the language L? is undecidable when L is the language of all C programs without buff. overflow. L is the language of all valid and true english statements. L is the language of all (textually encoded) Conway s game of life states following a particular setup. L is the language of Python programs that halt. 8
9 The Collatz ( 3n+1 ) conjecture Start with any positive integer, n. If even, the number is modified by dividing it in half to obtain n/2; or, if odd, the number is modified by multiplying it by three and adding one to obtain 3n+1. Repeat. Eventually, n will become 1. E.g., 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, E.g., 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 9
10 Collatz and the halting problem def collatz(n): while n!= 1: if n%2 == 0: n = n/2 else: n = 3*n+1 Would this definition for collatz(n) be in the language of Python programs that must halt? Intuitively: the halting problem must be at least as hard as Collatz! 10
11 Collatz and the halting problem: Another kind of reduction If we can solve the halting problem for all programs, then we can prove the Collatz conjecture. Contrapositive: If the Collatz conjecture is unproven, then the halting problem must also be unsolved. Contrapositive: If the Collatz conjecture is too hard to solve, then the halting problem must also be too hard to solve. 11
12 The halting problem def halt(prog, input):... # Assume: logic to detect halting... return True else: return False 12
13 The halting problem: an informal proof First assume we have a program which will determine if a program P halts on input I, or not. We assume this exists and treat it as a black box. Program P halt() predicate True / False P s input I 13
14 The halting problem: an informal proof First assume we have a program which will determine if a program P halts on input I, or not. E.g., collatz(n) halt() predicate True 9 14
15 The halting problem: an informal proof def P(prog): if halt(prog,prog): while True: pass P(P) # What happens here? 15
16 The halting problem: an informal proof Paradox! P halts if it doesn t halt and doesn t halt if it does! def P(prog): if halt(prog,prog): while True: pass P(P) # What happens here? Thus P cannot exist, and neither can halt. 16
17 The printing problem Now assume we have a program which will determine if a program P prints any output to STDOUT on a given input I, or not. def f(n): if n == 3: print hello E.g., prints() predicate True 3 17
18 Try an example. Design a paradoxical program P which shows that decision procedure prints cannot exist. 18
19 Try an example. Design a paradoxical program P which shows that decision procedure prints cannot exist. def P(prog): if not prints(prog,prog): print Oh, but it does though P(P) # Paradox! 19
20 Reductions for decision procedures If we can reduce solving decision procedure d1 to one of solving d0, then d1 s undecidability implies d0 s. d1() predicate Do some preprocessing to turn an input to d1 to an input for d0 such that the decision for d0 is guaranteed to also be correct for d1. d0() predicate 20
21 Turing machines A model of universal computation. 21
22 Informally, a Turing machine (TM) pairs a deterministic finite automaton (a set of states, alphabet, transition edges, a start state, final states) with an unbounded bi-directional tape of memory. There is no distinguished input source; the input starts out loaded into memory. deterministic finite control Edges of the TM s finite control can read from the tape at the current position, write to the tape at the current position, and move the tape head (current position on the tape) left or right. q0 q1???? E A C A A 22
23 A set of final states Formally, each TM is a 7-tuple: (Q, Σ, Γ, δ, q 0, B, F) A finite set of states {q } A finite input alphabet A finite set of tape symbols A deterministic transition function A designated blank symbol. A designated starting state!23
24 Formally, each TM is a 7-tuple: (Q, Σ, Γ, δ, q 0, B, F) δ (Q Γ Q Γ {L, R}) q 0 Q F Q Σ Γ B Γ B Σ!24
25 An example of an edge: At state q0, if the symbol read at the current position on the tape is X: transition to q1, clear the tape at current location, and move left. (q 0, X, (q 1, B, L)) δ Recall delta s signature: δ (Q Γ Q Γ {L, R})!25
26 Try an example. Give tuple(s) for the edge(s) matching the description: At state q0, stay at q0 and either read an X and move right on the memory tape, or read a Y and move left, changing Y to X. 26
27 Try an example. Give tuple(s) for the edge(s) matching the description: At state q0, stay at q0 and either read an X and move right on the memory tape, or read a Y and move left, changing Y to X. (q 0, X, (q 0, X, R)) δ (q 0, Y, (q 0, X, L)) δ 27
28 Diagramming TMs, notational conventions E.g., If X is read, transition from q0 to q1, clearing the current memory location and moving left. (q 1, B, L) = δ(q 0, X) Y/Y X/B q0 q1 q2 B/X 28
29 Transition table for TMs Y/Y X/B q0 q1 q2 B/X δ X Y B q0 (q1, B, L) q1 (q1, Y, R) (q2, X, L) q2 29
30 Evaluating TMs Q, Σ, Γ, δ, q 0, B, F Given a TM called M,, we can define a step- wise evaluation relation ( ) and its transitive/reflexive closure ( * ). x * x x y * z x * z Evaluation can be described in terms of sequences (inst. descriptions) in Γ*QΓ* starting with: q 0 w 0 w k (w i Σ) The input is not read separately but is loaded onto the memory tape up front, the read/write head positioned on the first input token.!30
31 Evaluating TMs Iff P contains an edge (p, Y, L) = δ(q, X), then: def X 0 X i 1 qxx i+1 X k X 0 X i 2 px i 1 Y X k and moving left (or right) off the end of previously-utilized memory uncovers more implicit B symbols which can then be overwritten: def qxx 1 X i 1 X k pbyx 1 X i 1 X k!31
32 Try an example. Let s design a TM for the language: L = {xy, xx} 32
33 Try an example. Let s design a TM for the language: L = {xy, xx} x/b x/b y/b q0 q1 q2 33
34 Try an example. Show the evaluation of this TM on string xy. x/b x/b y/b q0 q1 q2 34
35 Try an example. Show the evaluation of this TM on string xy. x/b x/b y/b q0 q1 q2 q 0 xy Bq 1 y q 2 BB Accepts upon reaching state q2 35
36 Try an example. Let s design a TM for the language: L = {x n y n N} 36
37 Try an example. Let s design a TM for the language: L = {x n y n N} y/y B/B q0 q1 q2 x/x Note that if we replace edges a in a DFA with a/a, and add a check for a blank at the end, we get a TM! 37
38 Try an example. Let s design a TM for the language: L = L(10 * 01 * ) 38
39 Try an example. Let s design a TM for the language: L = L(10 * 01 * ) 1/1 0/0 q1, 0 B/B q0, B q1, B 1/1 q1, 1 B/B 0/0 39
40 Tricks for programming TMs Just as we saw with DFAs, the finite state component can also encode arbitrary information (that is perhaps inconvenient to store on the tape) so long as this information is drawn from a finite domain; e.g., Q = {q 0, q 1 } {0, 1, B} A finite domain of additional info. A TM with multiple tracks can be encoded by using a tape alphabet that is the product of multiple tape alphabets (although often the same). E.g., a tape with three synchronized tracks on the left; or two, on the right. Γ = Γ 1 Γ 2 Γ 3 Γ 2 The alphabet for track 1, track 2, track 3. Alphabet for a machine with two tracks over the same tape tokens.!40
41 Try an example. Let s design a TM for the language: L = {x0 n x n N x {0, 1}} 41
42 Try an example. Let s design a TM for the language: L = {x0 n x n N x {0, 1}} 0/0 B/B 0/1 q2, 0 q1, 0 0/0 q0 q3, 1 1/1 q1, 1 q2, 1 B/B 1/1 0/0 42
43 Try an example. Let s design a TM for the language: L = {x n y n n N} 43
44 Try an example. Let s design a TM for the language: L = {x n y n n N} x/x q0 B/B 44
45 Try an example. Let s design a TM for the language: L = {x n y n n N} x/x y/y q0 q1 B/B x/x 45
46 Try an example. Let s design a TM for the language: L = {x n y n n N} x/x Y/Y x/x y/y q0 q1 q2 B/B x/x 46
47 Try an example. Let s design a TM for the language: L = {x n y n n N} x/x Y/Y x/x y/y q0 q1 q2 B/B x/x X/X 47
48 Try an example. Let s design a TM for the language: L = {x n y n n N} x/x Y/Y x/x y/y q0 q1 q2 B/B x/x Y/Y X/X 48
49 Try an example. Let s design a TM for the language: L = {x n y n n N} x/x Y/Y x/x y/y q0 q1 q2 B/B Y/Y x/x Y/Y X/X q3 Y/Y B/B q4 49
50 Try an example. Show the evaluation of this TM on input xxyy. B/B Y/Y x/x y/y q0 q1 q2 x/x Y/Y x/x Y/Y q3 X/X Y/Y B/B q4 50
51 Try an example. Show the evaluation of this TM on input xxyy. q 0 xxyy Xq 1 xyy Xxq 1 yy Xq 2 xyy q 2 XxYy Xq 0 xyy XXq 1 Yy XXYq 1 y XXq 2 YY Xq 2 XYY XXq 0 YY XXYq 3 Y XXYYq 3 B XXYYBq 4 B B/B Y/Y x/x y/y q0 q1 q2 x/x Y/Y x/x Y/Y q3 X/X Y/Y B/B q4 51
52 Tricks for programming TMs A TM with multiple (synchronized) tracks can be encoded by using a tape alphabet that is the product of multiple tape alphabets (perhaps the same).? Finite control Γ = {A, B, C, D, E}? q0 q1 {T, F}?? E A C A A F F F T F!52
53 Tricks for programming TMs A TM with multiple (non-synchronized) tapes can be encoded by using multiple tracks where each tape is simulated by two tracks: one for its data, and one to store a mark saving the read/write head location on that tape.? Finite control Γ = {A, B, C, D, E}? q0 q1 {*, B}?? A D E!53 A C A * A *
54 Decidable, recognizable languages with TMs A language L (or decision problem) is decidable (also, recursive) iff there exists a TM that will always eventually halt, on any input, yielding true or false to correctly indicate the input string s existence in language L. A language L (or decision problem) is recognizable (also, recursively enumerable or RE) iff there exists a TM that, on any input, will always eventually accept when the input is in the language L, but will either eventually reject or will non-terminate (loop forever) when the input is not in L. If L s complement is RE, L is called co-recognizable. If a language is both recognizable and co-recognizable, then it is also decidable i.e., both positive and negative examples can be recognized finitely.!54
55 Decidable, recognizable languages with TMs Any decision problem may be encoded formally as a language; but non-decision problems can as-well if encoded as a decision problem over pairs of (Input, Output). A problem/language is decidable if there exists a TM decider; recognizable if there is a TM recognizer; etc. Decidable : TM correctly decides and always halts. Recognizable (recursively enumerable, RE) : TM correctly decides but is only guaranteed to halt on true-yielding inputs. Co-recognizable : TM correctly decides acceptance, but is only guaranteed to halt on false-yielding inputs.!55
56 Decidable, recognizable languages with TMs P-TIME Decidable problems Recognizable / RE problems Undecidable problems / languages!56
57 A textual-encoding for TMs First, observe that TMs are amenable to a binary encoding: States can be encoded as positive ints: q1, q2, q3, Likewise, the tape alphabet: X1, X2, X3, Left and right directions as: D1, D2 Each edge δ(q i, X j ) = (q k, X l, D m ) is encoded: 0 i 10 j 10 k 10 l 10 m Note that there are no sequential 1s within an edge. A TM is encoded as a sequence of its edges (in any order) separated by substring 11. A given TM can have many valid encodings.!57
58 An undecidable, unrecognizable language L D Enumerate all binary strings. M0 M1 M2 The characteristic vector for Mi M3 M Mi !58
59 An undecidable, unrecognizable language L D Enumerate all binary strings. Note: Not all these machines need be valid; invalid TM encodings denote the empty lang. M0 M1 M2 The characteristic vector for Mi M3 M4 M1 is accepted by Mi Mi !59
60 An undecidable, unrecognizable language L D Language LD has a characteristic vector that is the complement of this diagonal. This means LD is the language of all binary strings encoding TMs that do not accept when given their own binary-string encodings. By diagonalization, LD is not RE. M0 M1 M2 M3 M Mi !60
61 A recognizable but undecidable language L U Language LU, called the universal language, is the language of all strings M111w such that M is an encoding of a TM that accepts on input string w. First, we observe it is recognizable because we can construct a TM M that simulates a binary-encoded TM on an input step-by-step if the encoded TM accepts, M accepts. M could use one tape for input, one for tracking finite state, one for the simulated TM s tape, etc. Second, we observe LU cannot be decidable because LD can be reduced its complement. If LD is not decidable, LU is not.!61
62 Reductions for decision procedures If we can reduce solving decision procedure d1 to one of solving d0, then d1 s undecidability implies d0 s. d1() predicate Do some preprocessing to turn an input to d1 into an input for d0 such that the decision for d0 is guaranteed to also be correct for d1. d0() predicate 62
63 A recognizable but undecidable language L U LD predicate Copy the input w to produce M111M. M M111M LU predicate!63
64 The language of halting TMs: L H Assume an LH that accepts on input M111w iff machine M halts on input w. LU predicate Construct a new TM M that goes into an infinite loop whenever M would become stuck. We just add missing edges to an explicit stuck state! M, w M, w LH predicate!64
65 Try the reverse reduction: can LH be reduced to LU? LH predicate? M, w? LU predicate!65
66 Try the reverse reduction: can LH be reduced to LU? LH predicate Construct a new TM M that accepts whenever M would get stuck (and also accepts if M accepts)! M, w M, M LU predicate!66
67 Intractable problems (more in 650/750!) Infeasible or impracticable problems with no solution that we can realistically compute. 67
68 Intractable problems The main class of tractable problems is P (P-TIME): the set of problems we can solve in polynomial-time w.r.t. input size. A time-bounded TM is a TM that can solve a problem in a given complexity class (e.g., P) but not others. EXPTIME problems (problems that are time-bounded by an exponential function in the input size) are considered to be intractable for any sufficiently large input. Problems in the class NP are verifiable in polynomial time, and therefore solvable in Nondeterministic-Polynomial-time. Whether class NP is distinct from P is a major open problem.!68
69 Complexity classes for intractable problems P NP-complete NP EXPTIME, etc!69
70 Intractable problems (NP-Hard, NP-complete) NP-Hard problems are those at least as hard as problems in NP. We can prove this using a reduction from a known NP-Hard problem. If an NP-Hard problem is also in P, then all NP must be! NP-Complete problems are those that are NP and NP-Hard. Classic NP-complete problems include SAT and TSP. SAT is the problem of finding an assignment to variables which shows that a given boolean formula (using and, or, not) is satisfiable. Traveling salesman problem (TSP) asks for a hamiltonian circuit (a circuit through each node of a weighted graph once) that minimizes distance (or is below a given threshold).!70
71 Polynomial-time reductions If we can reduce solving decision procedure d1 to one of solving d0 in P-TIME, then if d0 is polynomial time, so is d1. Put another way: if d1 is unsolvable in P-TIME, then d0 also cannot be! d1() predicate Some reduction that must be polynomial-time. d0() predicate 71
72 Chains of reductions are used to prove NP-Hardness CSAT Circuit-SAT SAT 3-SAT P0 P1 means that P0 reduces to P1.!72
73 Final announcements Final Exam: Thursday Dec 13, 10:45am 1:15pm There will be a modest curve for final letter grades. However, if your current grade is below the mid-60s %, then you will probably need to improve your grade to pass. However, the final is worth a full 20% of your grade and there will be opportunities to earn over 100% as usual. A set of new practice questions will be posted, but the final is comprehensive (roughly 2/3rds will be midterm review) so you should use all old problem sets and midterms to study! Jordan s final office hours on Tuesday will be a practice session.!73
74 Final announcements 401: λ-calculus, interpreters/mini-compilers, formal semantics, new paradigms (functional programming, logic programming)! IDEA survey: please fill out This is primarily how the department gets feedback on courses and instructors. Let them know how it went. I ll be teaching 350 regularly each fall. Do you have ideas for improving future classes? Please let me know! Go ahead and fill out your survey now, in class. TM Videos: Paul Rendell s TM coded in Conway s game of life.!74
Introduction to Turing Machines. Reading: Chapters 8 & 9
Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages
More informationTuring Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)
Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) 1 Deterministic Turing Machine (DTM).. B B 0 1 1 0 0 B B.. Finite Control Two-way, infinite tape, broken into
More informationCSCE 551: Chin-Tser Huang. University of South Carolina
CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan
More information1 Showing Recognizability
CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove
More informationCSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY
CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY RYAN DOUGHERTY If we want to talk about a program running on a real computer, consider the following: when a program reads an instruction,
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.
More informationComputability Theory. CS215, Lecture 6,
Computability Theory CS215, Lecture 6, 2000 1 The Birth of Turing Machines At the end of the 19th century, Gottlob Frege conjectured that mathematics could be built from fundamental logic In 1900 David
More informationDecidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:
Decidability 2017/10/31 Chapter 4.1 in Sipser Ø Announcement: q q q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/decidability.pdf Happy Hollaween! Delayed
More informationTURING MAHINES
15-453 TURING MAHINES TURING MACHINE FINITE STATE q 10 CONTROL AI N P U T INFINITE TAPE read write move 0 0, R, R q accept, R q reject 0 0, R 0 0, R, L read write move 0 0, R, R q accept, R 0 0, R 0 0,
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTATION
FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with
More informationMidterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama
Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand
More informationCSE 105 THEORY OF COMPUTATION. Spring 2018 review class
CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus
More informationDecidability (What, stuff is unsolvable?)
University of Georgia Fall 2014 Outline Decidability Decidable Problems for Regular Languages Decidable Problems for Context Free Languages The Halting Problem Countable and Uncountable Sets Diagonalization
More informationTuring Machine Recap
Turing Machine Recap DFA with (infinite) tape. One move: read, write, move, change state. High-level Points Church-Turing thesis: TMs are the most general computing devices. So far no counter example Every
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2018 http://cseweb.ucsd.edu/classes/sp18/cse105-ab/ Today's learning goals Sipser Ch 5.1, 5.3 Define and explain core examples of computational problems, including
More informationCOMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages
COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed
More informationTheory of Computation (IX) Yijia Chen Fudan University
Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and
More informationCPSC 421: Tutorial #1
CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 15 Ana Bove May 17th 2018 Recap: Context-free Languages Chomsky hierarchy: Regular languages are also context-free; Pumping lemma
More informationCS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018
CS 301 Lecture 17 Church Turing thesis Stephen Checkoway March 19, 2018 1 / 17 An abridged modern history of formalizing algorithms An algorithm is a finite, unambiguous sequence of steps for solving a
More informationMost General computer?
Turing Machines Most General computer? DFAs are simple model of computation. Accept only the regular languages. Is there a kind of computer that can accept any language, or compute any function? Recall
More informationCS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018
CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts
More informationMidterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama
Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand
More informationTuring Machines Part III
Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's
More informationComputability and Complexity Theory
Discrete Math for Bioinformatics WS 09/10:, by A Bockmayr/K Reinert, January 27, 2010, 18:39 9001 Computability and Complexity Theory Computability and complexity Computability theory What problems can
More informationAutomata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,
Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) October, 19 2017 Part 5 out of 5 Last week was all about Context-Free Languages Context-Free
More informationCS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)
CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger
More informationCP405 Theory of Computation
CP405 Theory of Computation BB(3) q 0 q 1 q 2 0 q 1 1R q 2 0R q 2 1L 1 H1R q 1 1R q 0 1L Growing Fast BB(3) = 6 BB(4) = 13 BB(5) = 4098 BB(6) = 3.515 x 10 18267 (known) (known) (possible) (possible) Language:
More informationCS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) Objectives Recall that decidable languages are languages that can be decided by TM (that means,
More informationUndecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK
COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines
More informationUndecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65
Undecidable Problems Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, 2018 1/ 65 Algorithmically Solvable Problems Let us assume we have a problem P. If there is an algorithm solving
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THURSDAY APRIL 3 REVIEW for Midterm TUESDAY April 8 Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, δ, q, q accept, q reject ), where: Q is a
More informationTuring Machines (TM) The Turing machine is the ultimate model of computation.
TURING MACHINES Turing Machines (TM) The Turing machine is the ultimate model of computation. Alan Turing (92 954), British mathematician/engineer and one of the most influential scientists of the last
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationDecidable Languages - relationship with other classes.
CSE2001, Fall 2006 1 Last time we saw some examples of decidable languages (or, solvable problems). Today we will start by looking at the relationship between the decidable languages, and the regular and
More informationDecision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012
Decision Problems with TM s Look at following sets: Lecture 31: Halting Problem CSCI 81 Spring, 2012 Kim Bruce A TM = { M,w M is a TM and w L(M)} H TM = { M,w M is a TM which halts on input w} TOTAL TM
More informationCS4026 Formal Models of Computation
CS4026 Formal Models of Computation Turing Machines Turing Machines Abstract but accurate model of computers Proposed by Alan Turing in 1936 There weren t computers back then! Turing s motivation: find
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:
More informationCSCE 551 Final Exam, Spring 2004 Answer Key
CSCE 551 Final Exam, Spring 2004 Answer Key 1. (10 points) Using any method you like (including intuition), give the unique minimal DFA equivalent to the following NFA: 0 1 2 0 5 1 3 4 If your answer is
More informationCS154, Lecture 10: Rice s Theorem, Oracle Machines
CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable
More informationUNIT-VIII COMPUTABILITY THEORY
CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the
More informationCS20a: Turing Machines (Oct 29, 2002)
CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser Ch 3 Trace the computation of a Turing machine using its transition function and configurations.
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationTuring Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite
The Church-Turing Thesis CS60001: Foundations of Computing Science Professor, Dept. of Computer Sc. & Engg., Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q 0, q accept, q reject ), where
More informationTheory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death
Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory
More informationChomsky Normal Form and TURING MACHINES. TUESDAY Feb 4
Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is
More informationCSE 2001: Introduction to Theory of Computation Fall Suprakash Datta
CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cse.yorku.ca/course/2001 11/7/2013 CSE
More informationTuring Machines. Lecture 8
Turing Machines Lecture 8 1 Course Trajectory We will see algorithms, what can be done. But what cannot be done? 2 Computation Problem: To compute a function F that maps each input (a string) to an output
More informationCS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)
CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A
More informationTuring Machines Decidability
Turing Machines Decidability Master Informatique 2016 Some General Knowledge Alan Mathison Turing UK, 1912 1954 Mathematician, computer scientist, cryptanalyst Most famous works: Computation model («Turing
More informationV Honors Theory of Computation
V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant
More informationCpSc 421 Final Exam December 15, 2006
CpSc 421 Final Exam December 15, 2006 Do problem zero and six of problems 1 through 9. If you write down solutions for more that six problems, clearly indicate those that you want graded. Note that problems
More informationTheory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable
Decidable Languages We use languages to represent various computational problems because we have a terminology for dealing with languages Definition: A language is decidable if there is an algorithm (i.e.
More informationTuring Machines Part II
Turing Machines Part II Problem Set Set Five Five due due in in the the box box up up front front using using a late late day. day. Hello Hello Condensed Slide Slide Readers! Readers! This This lecture
More informationThe Church-Turing Thesis
The Church-Turing Thesis Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/
More informationThe Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines
The Turing Machine Turing Machines Professor Department of Computer Science and Engineering Bangladesh University of Engineering and Technology Dhaka-1000, Bangladesh The Turing machine is essentially
More informationDecidability: Church-Turing Thesis
Decidability: Church-Turing Thesis While there are a countably infinite number of languages that are described by TMs over some alphabet Σ, there are an uncountably infinite number that are not Are there
More informationCSci 311, Models of Computation Chapter 9 Turing Machines
CSci 311, Models of Computation Chapter 9 Turing Machines H. Conrad Cunningham 29 December 2015 Contents Introduction................................. 1 9.1 The Standard Turing Machine...................
More informationProblems, and How Computer Scientists Solve Them Manas Thakur
Problems, and How Computer Scientists Solve Them PACE Lab, IIT Madras Content Credits Introduction to Automata Theory, Languages, and Computation, 3rd edition. Hopcroft et al. Introduction to the Theory
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationDecidability and Undecidability
Decidability and Undecidability Major Ideas from Last Time Every TM can be converted into a string representation of itself. The encoding of M is denoted M. The universal Turing machine U TM accepts an
More informationIntroduction to Turing Machines
Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability
More informationFinal exam study sheet for CS3719 Turing machines and decidability.
Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,
More informationComplexity Theory Part I
Complexity Theory Part I Outline for Today Recap from Last Time Reviewing Verifiers Nondeterministic Turing Machines What does nondeterminism mean in the context of TMs? And just how powerful are NTMs?
More informationTuring s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine
Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines Definition of Algorithm:
More informationLimits of Computability
Limits of Computability Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner
More informationCSE 105 Theory of Computation
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Undecidability Today s Agenda Review: The TM Acceptance problem, A TM The Halting Problem for TM s Other problems
More informationExam Computability and Complexity
Total number of points:... Number of extra sheets of paper:... Exam Computability and Complexity by Jiri Srba, January 2009 Student s full name CPR number Study number Before you start, fill in the three
More informationComputability Crib Sheet
Computer Science and Engineering, UCSD Winter 10 CSE 200: Computability and Complexity Instructor: Mihir Bellare Computability Crib Sheet January 3, 2010 Computability Crib Sheet This is a quick reference
More informationAn example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM
Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators
More informationAdvanced topic: Space complexity
Advanced topic: Space complexity CSCI 3130 Formal Languages and Automata Theory Siu On CHAN Chinese University of Hong Kong Fall 2016 1/28 Review: time complexity We have looked at how long it takes to
More informationIntroduction to Languages and Computation
Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014
More informationDecidability (intro.)
CHAPTER 4 Decidability Contents Decidable Languages decidable problems concerning regular languages decidable problems concerning context-free languages The Halting Problem The diagonalization method The
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be
More informationUNRESTRICTED GRAMMARS
136 UNRESTRICTED GRAMMARS Context-free grammar allows to substitute only variables with strings In an unrestricted grammar (or a rewriting system) one may substitute any non-empty string (containing variables
More informationHarvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis
Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harry Lewis October 22, 2013 Reading: Sipser, 3.2, 3.3. The Basic Turing Machine The Basic Turing Machine a a b a
More informationCpSc 421 Homework 9 Solution
CpSc 421 Homework 9 Solution Attempt any three of the six problems below. The homework is graded on a scale of 100 points, even though you can attempt fewer or more points than that. Your recorded grade
More informationCS6901: review of Theory of Computation and Algorithms
CS6901: review of Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational
More informationCSE 105 Theory of Computation
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s Agenda Quick Review of CFG s and PDA s Introduction to Turing Machines and their Languages Reminders and
More informationRecap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.
Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite
More informationTuring Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA
Turing Machines A Turing machine is similar to a finite automaton with supply of unlimited memory. A Turing machine can do everything that any computing device can do. There exist problems that even a
More informationReducability. Sipser, pages
Reducability Sipser, pages 187-214 Reduction Reduction encodes (transforms) one problem as a second problem. A solution to the second, can be transformed into a solution to the first. We expect both transformations
More informationUndecidable Problems and Reducibility
University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.
More informationFinish K-Complexity, Start Time Complexity
6.045 Finish K-Complexity, Start Time Complexity 1 Kolmogorov Complexity Definition: The shortest description of x, denoted as d(x), is the lexicographically shortest string such that M(w) halts
More informationCS151 Complexity Theory. Lecture 1 April 3, 2017
CS151 Complexity Theory Lecture 1 April 3, 2017 Complexity Theory Classify problems according to the computational resources required running time storage space parallelism randomness rounds of interaction,
More informationCSCE 551: Chin-Tser Huang. University of South Carolina
CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Computation History A computation history of a TM M is a sequence of its configurations C 1, C 2,, C l such
More informationCS3719 Theory of Computation and Algorithms
CS3719 Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational tool - analysis
More informationThe Unsolvability of the Halting Problem. Chapter 19
The Unsolvability of the Halting Problem Chapter 19 Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing Machines D and SD A TM M with
More informationTuring Machines Part II
Turing Machines Part II Hello Hello Condensed Slide Slide Readers! Readers! This This lecture lecture is is almost almost entirely entirely animations that that show show how how each each Turing Turing
More informationON COMPUTAMBLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHENIDUGSPROBLEM. Turing 1936
ON COMPUTAMBLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHENIDUGSPROBLEM Turing 1936 Where are We? Ignoramus et ignorabimus Wir mussen wissen Wir werden wissen We do not know We shall not know We must know
More informationCSE 105 Theory of Computation
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Undecidability Today s Agenda Review and More Problems A Non-TR Language Reminders and announcements: HW 7 (Last!!)
More information1 Unrestricted Computation
1 Unrestricted Computation General Computing Machines Machines so far: DFAs, NFAs, PDAs Limitations on how much memory they can use: fixed amount of memory plus (for PDAs) a stack Limitations on what they
More informationWhat languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?
} We ll now take a look at Turing Machines at a high level and consider what types of problems can be solved algorithmically and what types can t: What languages are Turing-decidable? What languages are
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 4.2 Trace high-level descriptions of algorithms for computational problems. Use
More informationPart I: Definitions and Properties
Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States
More informationOpleiding Informatica
Opleiding Informatica Tape-quantifying Turing machines in the arithmetical hierarchy Simon Heijungs Supervisors: H.J. Hoogeboom & R. van Vliet BACHELOR THESIS Leiden Institute of Advanced Computer Science
More informationQ = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar
IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar Turing Machine A Turing machine is an abstract representation of a computing device. It consists of a read/write
More information} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.
and their languages } Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops. } Some languages are Turing-recognizable, but not
More information