THEORY OF COMPUTATION

Similar documents
Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Computability and Complexity

jflap demo Regular expressions Pumping lemma Turing Machines Sections 12.4 and 12.5 in the text

Part I: Definitions and Properties

CSCE 551: Chin-Tser Huang. University of South Carolina

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Homework Assignment 6 Answers

CSE 105 THEORY OF COMPUTATION

Chapter 7 Turing Machines

Turing Machines Part III

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Theory of Computation Lecture 1. Dr. Nahla Belal

Midterm II : Formal Languages, Automata, and Computability

CS 154 Introduction to Automata and Complexity Theory

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

Theory of Computation

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Computation Histories

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Variants of Turing Machine (intro)

Notes for Comp 497 (Comp 454) Week 12 4/19/05. Today we look at some variations on machines we have already seen. Chapter 21

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Lecture 1: Course Overview and Turing machine complexity

Lecture 14: Recursive Languages

ECS 120 Lesson 15 Turing Machines, Pt. 1

CS20a: Turing Machines (Oct 29, 2002)

Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture.

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Languages, regular languages, finite automata

SE 3310b Theoretical Foundations of Software Engineering. Turing Machines. Aleksander Essex

Fundamentals of Computer Science

Announcements. Using a 72-hour extension, due Monday at 11:30AM.

CS20a: Turing Machines (Oct 29, 2002)

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Two Way Deterministic Finite Automata

Turing machines COMS Ashley Montanaro 21 March Department of Computer Science, University of Bristol Bristol, UK

CISC4090: Theory of Computation

Chapter 3: The Church-Turing Thesis

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

Automata and Computability. Solutions to Exercises

CSE 105 THEORY OF COMPUTATION

A Note on Turing Machine Design

Foundations of

CSCI3390-Assignment 2 Solutions

Homework. Staff. Happy and fruitful New Year. Welcome to CSE105. (Happy New Year) שנה טובה. and. Meeting Times

CSE 105 THEORY OF COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

Automata Theory CS S-12 Turing Machine Modifications

Variations of the Turing Machine

CSCC63 Worksheet Turing Machines

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Automata and Computability. Solutions to Exercises

Lecture 12: Mapping Reductions

CSE 105 THEORY OF COMPUTATION

CS21 Decidability and Tractability

The Church-Turing Thesis

Most General computer?

ACS2: Decidability Decidability

The Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines

CpSc 421 Homework 9 Solution

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

CS154 Final Examination

Please give details of your answer. A direct answer without explanation is not counted.

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

Lecture 13: Turing Machine

CpSc 421 Final Exam December 15, 2006

Turing Machines Part II

On the Computational Hardness of Graph Coloring

Turing Machines Part II

CS 525 Proof of Theorems 3.13 and 3.15

Turing Machines. Nicholas Geis. February 5, 2015

Homework. Staff. Happy and fruitful New Year. Welcome to CS105. (Happy New Year) שנה טובה. Meeting Times.

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

Announcements. Problem Set Four due Thursday at 7:00PM (right before the midterm).

Automata Theory (2A) Young Won Lim 5/31/18

CSE 460: Computabilty and Formal Languages Turing Machine (TM) S. Pramanik

where Q is a finite set of states

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Reducability. Sipser, pages

CSCI 2670 Introduction to Theory of Computing

Computability Theory. CS215, Lecture 6,

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Automata Theory - Quiz II (Solutions)

Non-emptiness Testing for TMs


Introduction to Turing Machines

Introduction to Languages and Computation

TURING MAHINES

Turing Machines Part II

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

Introduction to Turing Machines. Reading: Chapters 8 & 9

Transcription:

SHARIF UNIVERSITY OF TECHNOLOGY THEORY OF COMPUTATION FIRST WEEK February 13, 2016

1 COURSE DESCRIPTION Session 1 1 Course Description Welcome to "Theory of Computation" course. In this course we will introduce a variety of models of computation and discuss their "expressive power" which is their power to solve problems. We will then turn our attention to Turing machines, the problems they can solve and those that cannot be solved by any Turing machine. Finally, we will delve into the mathematical concepts behind computer science and computation. So if you desire to know where computer science came from (both historically and theoretically) or if you have ever wondered how far computers can go, then get ready to be happy! Instructors Instructor: Hadi Foroughmand: foroughmand@sharif.edu Teaching Assistants: Simin Oraee: simin1785@gmail.com Erfan Khaniki: e.khaniki@gmail.com Farzad Jafarrahmani: farzadhtg@gmail.com Aria Adibi: aria.a1995@gmail.com Amin Heydarshahi: amin.heydarshahi@yahoo.com Books John C. Martin, Introduction to Languages and the Theory of Computation 4th Edition Douglas S. Bridges, Computability: A Mathematical Sketchbook Grades Final Exam 8 Midterm Exam 5 Homework 4 Quiz 3 TA Classes 2 2

2 WHAT WE WILL LEARN 2 What we will learn We already know about some models of computations (such as DFAs, PDAs, etc) and the class of languages they accept (such as the class of regular languages, context-free languages, etc). This week we will introduce Turing machines and at the end of the week, we will be able to design Turing machines for different problems. 3

1 TURING MACHINE: BASICS Session 2 Reviewing Turing machines 1 Turing Machine: Basics Definition: A Turing machine is a 5-tuple T = (Q,Σ,Γ, q 0,δ) with the following observations: Q: A finite set of states (e.g. {q 0, q 1,..., q n }). Note that T has a halting state h which is NOT an element of Q. Σ: A finite set of characters. Σ is often referred as the input alphabet because any input that T takes must only contain the characters from Σ. Γ: A finite set of characters that T can use throughout the computation referred as tape alphabet. Note that Σ Γ. Also note that T contains an extra character, the blank symbol, which is NOT an element of Γ. q 0 : An element of Q. When T starts to do computation on an input, q 0 is the initial state. δ: Q (Γ { }) (Q {h}) (Γ { }) {R, L, S}: A function called the transition function of T that tells T : "Hey T! If you are in the state q and you see γ below your head, then go to state q, delete γ and write γ below your head, and then move your head to right, left, or stay still (R, L, S)." Definition: If T is in state q, the tape contains the string x = zbw and the head is on b, then the following notation: (q, zbw) is called a configuration of T. On input w, the initial configuration of T is (q 0, w) Notation: If C 1 and C 2 are two configurations of T, then C 1 T C 2 means that T can enter C 2 from C 1 according to its transition function. The notation C 1 C 2 means that C 2 can be derived from C 1 in a finite sequence of transitions. 4

2 CREATING A TURING MACHINE Accepting a Language Definition: We say the language L Σ is accepted by a Turing machine if and only if: x L (q 0, x) (h, zbw) For a Turing machine T, the language that T accepts is shown by the notation L(T ). 2 Creating a Turing Machine Why creating a Turing machine in the first place? The computation in today s computers is implemented based on variations of Turing machines. So in order to gain a deep understanding of how computers work, it is necessary to be familiar with how Turing machines work. One question we are curious about is "how limited are computers?", and to answer it, we should deal a lot with Turing machines so that we can have a general idea about what we are studying. How to make a TM Given a language L, to create an (abstract) Turing machine T with L(T ) = L, all we should do is to specify states of T (Q), its input alphabet (Σ), tape alphabet (Γ), initial state (q 0 ), and most importantly its transition function (δ). Note that in a TM, we do not have a memory that is, we do not have the direct option of "storing a character"; the only access we are given is the tape slot below our TM s head and the state our TM is in. So we should use the tape of TM, and the states to store a character. Frequently, the algorithm we present is a combination of some simpler "sub-algorithms". In order to combine the two Turing machines T 1 and T 2 so that on input w, T 2 starts computing the result of T 1 s computation on w, we create a Turing machine T with its states, input alphabet, tape alphabet, defined to be the union of those of T 1 and T 2, its initial state being the initial state of T 1 and changing the transition function of T 1 so that all the transitions to h 1 (halting state of T 1 ) become a transition to q 0 (initial state of T 2 ). How to show a TM We show a Turing machine with a diagram called "state diagram". You are probably familiar with this diagram from "Theory of Languages and Automata" course. 5

3 TRAINING 3 Training Please build Turing machines to solve the following problems: 1. A Turing machine to accept the language L: L = { ss s {0,1} } 2. DELETE: A Turing machine to transform the tape from configuration (q 0, yσz) to configuration (h, y z) 3. COPY: A Turing machine to transform the tape from configuration (q 0, x) to configuration (h, x x) 6