Introduction to the Theory of Computation, Sipser, PWS, ISBN X, 1996

Similar documents
1. [5 points each] True or False. If the question is currently open, write O or Open.

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

Welcome to MTH401A!! Theory of Computation

Reductions of the general virus detection problem

The Big Picture. Chapter 3

Problems, Languages, Machines, Computability, Complexity

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

We can create PDAs with multiple stacks. At each step we look at the current state, the current input symbol, and the top of each stack.

SECTION A (40 marks)

A Characterization of the Chomsky Hierarchy by String Turing Machines

Theory of Computations Spring 2016 Practice Final Exam Solutions

Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D.

Computer Sciences Department

CSE 120. Computer Science Principles

Theory Bridge Exam Example Questions Version of June 6, 2008

Syllabi of the Comprehensive Examination in Computer Science

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

Time Complexity of an Algorithm

Lambda Calculus and Computation

VISUALIZING NP-COMPLETENESS THROUGH CIRCUIT-BASED WIDGETS

Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee. Joint work with: Prof. Padam Kumar

CA Compiler Construction

Theory and Frontiers of Computer Science. Fall 2013 Carola Wenk

Recursion. Tjark Weber. Functional Programming 1. Based on notes by Sven-Olof Nyström. Tjark Weber (UU) Recursion 1 / 37

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Automata and Formal Languages - CM0081 Introduction

Final Exam 1, CS154. April 21, 2010

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems

Specifying Syntax COMP360

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

Draw a diagram of an empty circular queue and describe it to the reader.

The Turing Machine. Unsolvable Problems. Undecidability. The Church-Turing Thesis (1936) Decision Problem. Decision Problems

Regular Languages (14 points) Solution: Problem 1 (6 points) Minimize the following automaton M. Show that the resulting DFA is minimal.

05. Turing Machines and Spacetime. I. Turing Machines and Classical Computability.

Theory of Computations Spring 2016 Practice Final

The p-sized partitioning algorithm for fast computation of factorials of numbers

ALGORITHMIC DECIDABILITY OF COMPUTER PROGRAM-FUNCTIONS LANGUAGE PROPERTIES. Nikolay Kosovskiy

Theory: 4 Hrs/Week Max. University Theory Examination: 60 Marks Max. Time for Theory Exam.: 3 Hrs. Continuous Internal Assessment: 40 Marks

Talen en Compilers. Jurriaan Hage , period 2. November 13, Department of Information and Computing Sciences Utrecht University

COMP 382: Reasoning about algorithms

Languages and Automata

THEORY OF COMPUTATION

Recursively Enumerable Languages, Turing Machines, and Decidability

Lambda Calculus. Variables and Functions. cs3723 1

On the Recursion-Theoretic Complexity of Relative Succinctness of Representations of Languages

Midterm Exam II CIS 341: Foundations of Computer Science II Spring 2006, day section Prof. Marvin K. Nakayama

Lecture T4: Computability

Algorithm Analysis. Applied Algorithmics COMP526. Algorithm Analysis. Algorithm Analysis via experiments

Theory of Programming Languages COMP360

CS583 Lecture 01. Jana Kosecka. some materials here are based on Profs. E. Demaine, D. Luebke A.Shehu, J-M. Lien and Prof. Wang s past lecture notes

CMSC 330, Fall 2018 Midterm 2

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

Theory of Languages and Automata

LECTURE 16. Functional Programming

14.1 Encoding for different models of computation

CSE373 Fall 2013, Midterm Examination October 18, 2013

Recursion. Lars-Henrik Eriksson. Functional Programming 1. Based on a presentation by Tjark Weber and notes by Sven-Olof Nyström

Bulldozers/Sites A B C D

CSE 105 THEORY OF COMPUTATION

(a) R=01[((10)*+111)*+0]*1 (b) ((01+10)*00)*. [8+8] 4. (a) Find the left most and right most derivations for the word abba in the grammar

20 Models Of Computation

CSCI312 Principles of Programming Languages!

CSE 105 THEORY OF COMPUTATION

AP Computer Science AB

NP-Completeness. Algorithms

THE DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS

Lecture 5: The Halting Problem. Michael Beeson

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

Log-Space. A log-space Turing Machine is comprised of two tapes: the input tape of size n which is cannot be written on, and the work tape of size.

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Outline. Language Hierarchy

Ph.D. Comprehensive Examination Design and Analysis of Algorithms

Static Analysis: Overview, Syntactic Analysis and Abstract Interpretation TDDC90: Software Security

Logic and Computation

Introductory logic and sets for Computer scientists

Australian researchers develop typeface they say can boost memory, that could help students cramming for exams.

CSE 417 Branch & Bound (pt 4) Branch & Bound

Denotational Semantics. Domain Theory

Lecture 9: More Lambda Calculus / Types

- M ::= v (M M) λv. M - Impure versions add constants, but not necessary! - Turing-complete. - true = λ u. λ v. u. - false = λ u. λ v.

Chapter 2: Complexity Analysis

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

LOGIC AND DISCRETE MATHEMATICS

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia

Artificial Intelligence Lecture 1

n λxy.x n y, [inc] [add] [mul] [exp] λn.λxy.x(nxy) λmn.m[inc]0 λmn.m([add]n)0 λmn.n([mul]m)1

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207

Introduction to Computer Science

Nondeterministic Query Algorithms

CpSc 421 Final Solutions

Programming Language Pragmatics

Finding People and Information (1) G53CMP: Lecture 1. Aims and Motivation (1) Finding People and Information (2)

CS 242. Fundamentals. Reading: See last slide

Introduction to Graph Theory

Books : 4 th SEMESTER MCA F.M -70. Programming With Java(3-1-0)Cr.-4. Module-1

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

This session. Recursion. Planning the development. Software development. COM1022 Functional Programming and Reasoning

Midterm CSE 21 Spring 2012

Section A Arithmetic ( 5) Exercise A

Transcription:

CA320: COMPUTABILITY AND COMPLEXITY 1 1 Introduction CA320 Computability and Complexity Lecturer: Office: L2.55 Phone: 5017 Email: hamilton@computing.dcu.ie WWW: http://www.computing.dcu.ie/ hamilton Course Page: "/teaching/ca320 Books Recommended: Introduction to the Theory of Computation, Sipser, PWS, ISBN 053494728X, 1996 Haskell: The Craft of Functional Programming, Thompson, Addison-Wesley, ISBN 0-201-34275-8, 1999 Supplementary: Elements of the Theory of Computation, Lewis and Papadimitriou, Prentice Hall, ISBM 0-13-272741-2, 1998 Introduction to Languages and the Theory of Computation, Martin, McGraw- Hill, ISBN 0-07-115468-X, 1997 Programming in Haskell, Hutton, Cambridge University Press, ISBN 9780521692694, 2007 Assessment Continuous Assessment: 25% Programming lab exam 10% Programming assignment 15% Exam: 75% Ten short questions Answer all questions You must get a combined mark 40% to pass

CA320: COMPUTABILITY AND COMPLEXITY 2 Assessment If you fail this module then you will need to repeat some elements of the assessment. If you just failed the exam you can resit the exam in the Autumn. If you just failed the continuous assessment then you must complete a resit assignment. Contact me after the results are published for the resit assignment. If you failed both the exam and the continuous assessment, you must repeat both. If you fail the module after the resit examination and continuous assessment you must repeat all aspects of the module in the following year. What is the Point of This Course? Within this course, we will be attempting to answer the following questions: 1. What problems can be theoretically solved by a computer? 2. What problems can be efficiently solved by a computer? Computability theory is concerned with exploring the limitations of computing devices and the problems which can be computed by them. Complexity theory is concerned with classifying computable problems by their inherent difficulty. Languages and Automata In this course, we will see that computation can be regarded as a process of language recognition. The recognition of a word in a language corresponds to the acceptance of an input by a program. We will study a number of languages of increasing descriptive power. We will also study a number of automata (abstract machines) of increasing power, which can be used to recognise each of these languages. Some of the automata which we will study are as powerful as any real computer, while others are less powerful. We will see that these less powerful automata are nevertheless quite useful. General Models of Computation We will also study the following equivalent general models of computational devices: Turing machines Lambda calculus Unrestricted grammars Partial recursive functions

CA320: COMPUTABILITY AND COMPLEXITY 3 Computability Deals with the following questions: 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? For example, will function f terminate for all positive values of n? int f(int n) { while (n!=1) if (n%2==0) n:=n/2; else n:=3*n+1; return n; } Complexity Deals with the following questions: 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? For example, can we efficiently determine the factors p and q of a product p q? Problems Types of problems: Decision problems: Return either YES or NO (or, equivalently, true or false, or 0 or 1) Search Problems: Find an x that satisfies property P Enumeration Problems: Find all x that satisfy property P Counting Problems: Count the number of x s that satisfy property P Optimisation Problems: Find the x that best satisfies property P Structuring Problems: Transform x to satisfy property P

CA320: COMPUTABILITY AND COMPLEXITY 4 Problems A problem specification comprises: a characterisation of all legal inputs to the problem a characterisation of the desired outputs as a function of the legal inputs. Some example problems: Problem 1 Inputs: Two non-negative integers, x and y Outputs: The greatest common divisor of x and y Problem 2 Inputs: A positive integer n Outputs: YES if n is prime and NO if it isn t Algorithms Algorithms can be used to solve problems. An algorithm is: a finite sequence of operations for solving a problem each operation is chosen from a set of well-defined operations If the algorithm is executed by a suitable processor on any instance of the problem, it will give rise to a process that: halts in a finite time returns the answer for that problem instance Algorithms Problem 3 Inputs: A positive integer n Outputs: The sum of the integers from 1 to n Algorithm 1 sum:= 0; for i:= 1 to n sum:=sum+i; return sum; Algorithm 2 return (n*(n+1))/2;

CA320: COMPUTABILITY AND COMPLEXITY 5 Correctness How can we be sure that an algorithm or program solves a problem? How can we be sure that it terminates and produces the correct output for all of its legal inputs? For example, consider the following program: if (f(n)==1) printf("hello World!"); where f is defined as given previously. Is this equivalent to the following: printf("hello World!"); Course Outline Introduction Sets, relations and functions, graphs, strings and languages, logic, proofs, recursion and induction Introduction to Haskell Regular languages and finite automata Regular expressions, finite state automata, regular grammars Context-free languages and pushdown automata Context-free grammars, derivations, ambiguity, pushdown automata Context-sensitive languages and linear bounded automata Context-sensitive grammars, linear bounded automata General Models of Computation Turing machines, unrestricted grammars, partial recursive functions, lambda calculus, Church-Turing thesis Computability Countability, computability, halting problem, reducibility Complexity Asymptotic notation, polynomial and exponential time complexity and space complexity, P, NP, NP-completeness