Computability and Complexity Lecture 1 Introduction Turing machines Decidable and recognizable languages given by Jiri Srba Lecture 1 Computability and Complexity 1/17
Introduction Lecturer: Jiri Srba (srba@cs.aau.dk, 1.2.32). Assistant: Claus Thrane (crt@cs.aau.dk, 1.2.57). Book: Introduction to the Theory of Computation , Second International Edition by Michael Sipser. Homepage: intranet.cs.aau.dk/education/courses/2010/cc/ Many thanks: to Hans H¨ uttel for sharing his experience and for allowing me to use many of his exercises. Lecture 1 Computability and Complexity 2/17
Tutorials and Exam Tutorials Tutorials will be in the lecture-room and before lectures. Read the corresponding text in the book before the tutorial. Print out the set of exercises and bring it with you! Work in groups of 2 or 3 on the exercises and request a help from the teaching assistant and the lecturer. Compulsary and optional exercises. The regular exercises or their slightly modified versions will be a part of the exam! Exam Written, standard danish scale, no reading material allowed. Based on the exercises done during the tutorial and on the material covered during the lectures. Lecture 1 Computability and Complexity 3/17
Hints Work hard during the semester and participate in the tutorials. Take notes during the lectures! Read the recommended pages as soon as possible after the lecture. Prepare for the tutorials and bring the print out of exercises! Print the slides and use them for your preparation for the exam. Anonymous feedback form on the home-page. Lecture 1 Computability and Complexity 4/17
Theory of Computation The theory of computation studies whether (computability theory), and how efficiently (complexity theory) certain problems can be solved on a computer, or rather on a model of a computer. Several equivalent models of computational devices can be used: Register machines. Lambda calculus. Simple while programming language (pseudo-code). Turing machines. ... We focus on Turing machines. Lecture 1 Computability and Complexity 5/17
Course Content Computability Do algorithmic solutions to problems always exist? What are the limitations of computational devices? Is there any insight to which problems are algorithmically solvable and which are not? Are the unsolvable problems somehow related? Complexity How do we compare the efficiency of different algorithms? How do we measure time/memory requirements? What problems are efficiently solvable? Are there solvable problems which do not have efficient algorithms? Lecture 1 Computability and Complexity 6/17
Formal Languages — Repetition Let Σ be a finite, nonempty set called alphabet. A string or word w over Σ is a finite sequence of symbols from Σ. An empty string is denoted by ǫ . A concatenation of strings w 1 and w 2 is a string w 1 w 2 . A length of a string w is the number of symbols in w and it is denoted by | w | . The set of all strings over Σ is denoted by Σ ∗ . A language L over Σ is any subset of Σ ∗ , i.e., L ⊆ Σ ∗ . Lecture 1 Computability and Complexity 7/17
Operations on Languages — Repetition Let L 1 and L 2 be two languages ( L 1 , L 2 ⊆ Σ ∗ ). L 1 ∪ L 2 = { w ∈ Σ ∗ | w ∈ L 1 or w ∈ L 2 } L 1 ∩ L 2 = { w ∈ Σ ∗ | w ∈ L 1 and w ∈ L 2 } L 1 = { w ∈ Σ ∗ | w �∈ L 1 } L 1 . L 2 = { w ∈ Σ ∗ | w = w 1 w 2 where w 1 ∈ L 1 and w 2 ∈ L 2 } 1 = { w ∈ Σ ∗ | w = w 1 w 2 . . . w k where k ≥ 0 L ∗ and each w i ∈ L 1 for all 1 ≤ i ≤ k } Lecture 1 Computability and Complexity 8/17
Turing Machine Devised in 1936 by English mathematician Alan Turing. computations can be done by writing symbols on sheets of paper we have a pen, an eraser, finitely many symbols we can write, and as many sheets of paper as we want no thinking is required to execute a computation essentially a finite-state automaton with unbounded memory Lecture 1 Computability and Complexity 9/17
Turing Machine Formally Definition A Turing machine is a 7-tuple M = ( Q , Σ , Γ , δ, q 0 , q accept , q reject ): Q is a finite set of states, Σ is a finite input alphabet, s.t. ⊔ �∈ Σ Γ is a finite tape alphabet, s.t. ⊔ ∈ Γ and Σ ⊆ Γ, δ : Q × Γ → Q × Γ × { L , R } is the transition function, q 0 ∈ Q is the start state, q accept ∈ Q is the accept state, and q reject ∈ Q is the reject state, where q accept � = q reject . δ ( q , a ) = ( q ′ , b , R ) δ ( q , a ) = ( q ′ , a , R ) ���� ���� � ���� ���� ���� ���� ���� � ���� Notation: a → b , R a → R q q q’ q’ Lecture 1 Computability and Complexity 10/17
Configuration of a Turing Machine (TM) Let M = ( Q , Σ , Γ , δ, q 0 , q accept , q reject ) be a TM. Informally, a configuration consists of the current control-state, the current tape content, and the current head position. Definition (Configuration) A configuration of a TM is a string uqv where u ∈ Γ ∗ is the initial part of the tape, q ∈ Q is the current state, v ∈ Γ ∗ is the final part of the tape and the head points at the first symbol of v . Remark: if v = ǫ then the head points at the first blank symbol ⊔ after u , i.e., uq ≡ uq ⊔ . Lecture 1 Computability and Complexity 11/17
Computation of a Turing Machine Let M = ( Q , Σ , Γ , δ, q 0 , q accept , q reject ) be a TM. Informally, a configuration C 1 yields a configuration C 2 if in configuration C 1 the machine M performs one computational step and moves to C 2 . Definition ( C 1 yields C 2 ) Let u , v ∈ Γ ∗ , a , b ∈ Γ, and q , q ′ ∈ Q . We say that C 1 = uaqbv yields uq ′ acv = C 2 if δ ( q , b ) = ( q ′ , c , L ), and C 1 = uqbv yields ucq ′ v = C 2 if δ ( q , b ) = ( q ′ , c , R ), and C 1 = qbv yields q ′ cv = C 2 if δ ( q , b ) = ( q ′ , c , L ). Lecture 1 Computability and Complexity 12/17
Acceptance of a String by a TM Let M = ( Q , Σ , Γ , δ, q 0 , q accept , q reject ) be a TM. Informally, a TM M accepts a string w ∈ Σ ∗ if from the initial configuration q 0 w there is a computation which ends in a configuration of the form uq accept v . Definition ( M accepts a string w ) A TM M accepts an input string w if there is a sequence of configurations C 1 , C 2 , . . . , C k such that C 1 = q 0 w is the initial (start) configuration, C i yields C i +1 for all i , 1 ≤ i < k , and C k is an accept configuration (contains q accept ). Similarly, M rejects w if there is such a sequence ending in C k which is a reject configuration (contains q reject ). Lecture 1 Computability and Complexity 13/17
Three Possible Outcomes of a TM Computation, Decider Assume that a TM M computes from the initial configuration C 1 = q 0 w (note that this computation is deterministic). There are three possible outcomes of running M on w : 1 C 1 , C 2 , . . . , C k ends in accept configuration C k , or 2 C 1 , C 2 , . . . , C k ends in reject configuration C k , or 3 C 1 , C 2 , . . . does not terminate (loops). Definition (Decider) A TM M which for any input string w always halts (either in accept or reject configuration) is called a decider. Lecture 1 Computability and Complexity 14/17
Recognizable and Decidable Languages Definition (Language of M ) The language recognized by a TM M , or simply the language of M is L ( M ) = { w ∈ Σ ∗ | M accepts w } . Definition (Recognizable Language) A language L ⊆ Σ ∗ is recognizable if there exists a TM M such that M recognizes L , i.e., L = L ( M ). Definition (Decidable Language) A language L ⊆ Σ ∗ is decidable if there exists a TM M such that M is a decider and M recognizes L , i.e., L = L ( M ). Lecture 1 Computability and Complexity 15/17
Example Consider the language L def = { a n b n c n | n ≥ 0 } . Facts: L is not regular, L is not context-free, but L is recognizable and even decidable language. Lecture 1 Computability and Complexity 16/17
Exam Questions Definition of a Turing machine, configuration, computation, acceptance of a string by a TM. Definition of a decider. Definition of recognizable and decidable languages. Lecture 1 Computability and Complexity 17/17
Recommend
More recommend