Computability and Complexity Lecture 1 Introduction Turing - - PowerPoint PPT Presentation

computability and complexity
SMART_READER_LITE
LIVE PREVIEW

Computability and Complexity Lecture 1 Introduction Turing - - PowerPoint PPT Presentation

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:


slide-1
SLIDE 1

Computability and Complexity

Lecture 1

Introduction Turing machines Decidable and recognizable languages

given by Jiri Srba

Lecture 1 Computability and Complexity 1/17

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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 w1 and w2 is a string w1w2. 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

slide-8
SLIDE 8

Operations on Languages — Repetition

Let L1 and L2 be two languages (L1, L2 ⊆ Σ∗). L1 ∪ L2 = {w ∈ Σ∗ | w ∈ L1 or w ∈ L2} L1 ∩ L2 = {w ∈ Σ∗ | w ∈ L1 and w ∈ L2} L1 = {w ∈ Σ∗ | w ∈ L1} L1.L2 = {w ∈ Σ∗ | w = w1w2 where w1 ∈ L1 and w2 ∈ L2} L∗

1 = {w ∈ Σ∗ | w = w1w2 . . . wk where k ≥ 0

and each wi ∈ L1 for all 1 ≤ i ≤ k}

Lecture 1 Computability and Complexity 8/17

slide-9
SLIDE 9

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

slide-10
SLIDE 10

Turing Machine Formally

Definition A Turing machine is a 7-tuple M = (Q, Σ, Γ, δ, q0, qaccept, qreject): 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, q0 ∈ Q is the start state, qaccept ∈ Q is the accept state, and qreject ∈ Q is the reject state, where qaccept = qreject. Notation: δ(q, a) = (q′, b, R)

  • q

a→b,R

  • q’

δ(q, a) = (q′, a, R)

  • q

a→R

  • q’

Lecture 1 Computability and Complexity 10/17

slide-11
SLIDE 11

Configuration of a Turing Machine (TM)

Let M = (Q, Σ, Γ, δ, q0, qaccept, qreject) 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

slide-12
SLIDE 12

Computation of a Turing Machine

Let M = (Q, Σ, Γ, δ, q0, qaccept, qreject) be a TM. Informally, a configuration C1 yields a configuration C2 if in configuration C1 the machine M performs one computational step and moves to C2. Definition (C1 yields C2) Let u, v ∈ Γ∗, a, b ∈ Γ, and q, q′ ∈ Q. We say that C1 = uaqbv yields uq′acv = C2 if δ(q, b) = (q′, c, L), and C1 = uqbv yields ucq′v = C2 if δ(q, b) = (q′, c, R), and C1 = qbv yields q′cv = C2 if δ(q, b) = (q′, c, L).

Lecture 1 Computability and Complexity 12/17

slide-13
SLIDE 13

Acceptance of a String by a TM

Let M = (Q, Σ, Γ, δ, q0, qaccept, qreject) be a TM. Informally, a TM M accepts a string w ∈ Σ∗ if from the initial configuration q0w there is a computation which ends in a configuration of the form uqacceptv. Definition (M accepts a string w) A TM M accepts an input string w if there is a sequence of configurations C1, C2, . . . , Ck such that C1 = q0w is the initial (start) configuration, Ci yields Ci+1 for all i, 1 ≤ i < k, and Ck is an accept configuration (contains qaccept). Similarly, M rejects w if there is such a sequence ending in Ck which is a reject configuration (contains qreject).

Lecture 1 Computability and Complexity 13/17

slide-14
SLIDE 14

Three Possible Outcomes of a TM Computation, Decider

Assume that a TM M computes from the initial configuration C1 = q0w (note that this computation is deterministic). There are three possible outcomes of running M on w:

1 C1, C2, . . . , Ck

ends in accept configuration Ck, or

2 C1, C2, . . . , Ck

ends in reject configuration Ck, or

3 C1, C2, . . .

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

slide-15
SLIDE 15

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

slide-16
SLIDE 16

Example

Consider the language L def = {anbncn | 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

slide-17
SLIDE 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