CSCI 1590 Intro to Computational Complexity

Similar documents
CSCI 1590 Intro to Computational Complexity

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

CS21 Decidability and Tractability

CSCI 1590 Intro to Computational Complexity

CSCI 1590 Intro to Computational Complexity

CS151 Complexity Theory. Lecture 1 April 3, 2017

Complexity: Some examples

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

CSCI 1590 Intro to Computational Complexity

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

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

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

CSCI 1590 Intro to Computational Complexity

Exam Computability and Complexity

INAPPROX APPROX PTAS. FPTAS Knapsack P

Definition: Alternating time and space Game Semantics: State of machine determines who

Definition: Alternating time and space Game Semantics: State of machine determines who

CS256 Applied Theory of Computation

6-1 Computational Complexity

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

CS154, Lecture 17: conp, Oracles again, Space Complexity

Parallelism and Machine Models

Introduction to Complexity Theory

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

The Role of Theory in Computer Science

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Turing Machines and Time Complexity

Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

Final exam study sheet for CS3719 Turing machines and decidability.

CS154, Lecture 13: P vs NP

6.045 Final Exam Solutions

The Polynomial Hierarchy

1 Showing Recognizability

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

Theory of Computation Lecture 1. Dr. Nahla Belal

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Lecture 24: Randomized Complexity, Course Summary

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

COMPARATIVE ANALYSIS ON TURING MACHINE AND QUANTUM TURING MACHINE

Space Complexity. The space complexity of a program is how much memory it uses.

CS154, Lecture 13: P vs NP

Complexity Theory 112. Space Complexity

Advanced topic: Space complexity

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Models of Computation

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK

Computability Theory. CS215, Lecture 6,

Functions on languages:

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

Could we potentially place A in a smaller complexity class if we consider other computational models?

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

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

Introduction to Turing Machines. Reading: Chapters 8 & 9

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

Part I: Definitions and Properties

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

Principles of Knowledge Representation and Reasoning

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

MTAT Complexity Theory October 13th-14th, Lecture 6

Chapter 3: The Church-Turing Thesis

Computability and Complexity Theory

Computability and Complexity CISC462, Fall 2018, Space complexity 1

MACHINE COMPUTING. the limitations

Problems, and How Computer Scientists Solve Them Manas Thakur

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

ECE 695 Numerical Simulations Lecture 2: Computability and NPhardness. Prof. Peter Bermel January 11, 2017

CSCE 551 Final Exam, Spring 2004 Answer Key

Computer Science. Questions for discussion Part II. Computer Science COMPUTER SCIENCE. Section 4.2.

NP-Completeness. NP-Completeness 1

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

NP-Complete problems

conp, Oracles, Space Complexity

The decision problem (entscheidungsproblem), halting problem, & Turing machines. CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/

Comparison of several polynomial and exponential time complexity functions. Size n

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

Theory of Computation Time Complexity

Lecture 5: The Landscape of Complexity Classes

DM17. Beregnelighed. Jacob Aae Mikkelsen

Further discussion of Turing machines

Lecture 16: Time Complexity and P vs NP

Approximation Algorithms

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

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

Decidability (What, stuff is unsolvable?)

The Cook-Levin Theorem

Universal Turing Machine. Lecture 20

MA/CSSE 474 Theory of Computation

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

Computability and Complexity Theory: An Introduction

Theory of Computation Turing Machine and Pushdown Automata

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Circuits. Lecture 11 Uniform Circuit Complexity

BBM402-Lecture 11: The Class NP

Lecture 21: Space Complexity (The Final Exam Frontier?)

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

Lecture 1: Course Overview and Turing machine complexity

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

Transcription:

CSCI 59 Intro to Computational Complexity Overview of the Course John E. Savage Brown University January 2, 29 John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 / 26

Overview of Theoretical CS 2 Characterization of Computational Problems 3 Serial and Parallel Models of Computation 4 Complexity Classifications 5 Course Outline John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 2 / 26

Goals of the Course Introduce important models Problem statements: functions, languages Serial computational models Parallel computational models Develop methods to classify problems by time and space. E.g. L, NL, P, NP, PSPACE, NPSPACE, etc. Study approximation algorithms for NP-hard problems. Explore resource tradeoff results, such as trading space and time, for problems on real-world computational models. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 3 / 26

Problem Representation Encodings - representing objects as strings Sets as bit vectors, tables as strings Languages - set of strings over an alphabet Regular {, } ; Context-Free { n n } Functions - mappings from domains to range f : {, } n {, }, f : {, } {, } Hard computational problems Traveling Salesperson Problem, Graph Coloring John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 4 / 26

Serial Models I Circuits Deterministic Finite State Machines (DFM) Nondeterministic FSM (NDFM) Random Access Machine (RAM) Model for the stored program computer John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 5 / 26

Logic Circuits Definition A circuit is a directed acyclic graph in which input vertices are associated with Boolean variables and non-input vertices carry the labels of Boolean functions such as and( ), or ( ), not ( ), and exor ( ). c j+ s j s j g j p j c j+ FA j c j v j u j c j v j u j John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 6 / 26

The DFSM Definition A deterministic finite-state machine (DFSM) is a seven-tuple M = (Σ, Ψ, Q, δ, λ, s, F ) where Σ and Ψ are the input and output alphabets, Q is the set of states of the machine, δ : Σ Q Q is its next-state function, λ : Q Ψ is its output function, s is its initial state, and F Q is a set of final states. A DFSM makes transitions. Before each transition it is in a state q. On input x Σ it makes a transition to a state q = δ(q, x) Q, and produces an output y = λ(q ) Ψ. q/ q/ Start John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 7 / 26

Computation by a DFSM Definition If a sequence of inputs x, x 2,..., x T causes a DFSM M to move from its initial state s to a state q F, the string x x 2 x T is accepted by the M. The language L(M) recognized by M is the set of accepted strings. A DFSM M computes a function f M defined by the mapping from inputs x, x 2,..., x T to outputs y, y 2,..., y T. q/ q/ Start John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 8 / 26

Computation by a DFSM Examples The language L recognized by the DFSM shown below contains all strings over {, } with an odd number of s. q / q / Start John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 9 / 26

Nondeterministic FSMs Definition A nondeterministic finite-state machine (NFSM) is a five-tuple M = (Σ, Q, δ, s, F ) where Σ is the input alphabet, Q is the set of states of the machine, δ : Σ Q 2 Q is its next-state function, s is its initial state, and F Q is a set of final states. The next-state function maps a state and an input to a set of states, thereby providing a set of choices for the next state. q / q / q 3/ Start q 2/ John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 / 26

NFSM Language Recognition Definition A string x, x 2,..., x T is accepted by an NFSM M if when started in state s, there are successor states that result in M arriving at a final state in F. A certificate to acceptance is the set of choices that lead to an accept state. The language recognized by an NFSM is the set of strings that it accepts. q / q / q 3/ Start q 2/ John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 / 26

Equivalence between FSMs and NFSMs Theorem The languages accepted by FSMs and NFSMs are equivalent. Proof. Given NFSM M = (Σ, Ψ, Q, δ, s, F ), create DFSM M whose states are subsets of Q (2 Q ) and start state contains s. If q = {q, q 2,..., q k } is state of M, q i Q, its successor under input a is set of states that reachable from some q i. q accepts if q F φ. Is this NFSM is equivalent to previous FSM? Q = {q }, Q = {q, q 2 }, Q 3 = {q, q 3 }. q/ q/ q3/ Start q2/ John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 2 / 26

Random Access Machine Implements fetch-execute cycle Uses direct and indirect addressing Arithmetic logic unit (ALU) performs addition, single-bit shifts. No multiplication because it introduces parallelism. Words increase at most one bit in length/per cycle CPU Decode ALU reg a reg b prog ctr Random-Access Memory b cmd out wrd in wrd addr m m 2 John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 3 / 26

Serial Models II Deterministic (Nondeterministic) Turing Machines (TMs) One or more tapes whose head(s) are controlled by a DFM (NDFM) The Church-Turing thesis asserts that any function that can be physically realized (i.e. computed ) can be computed by a Turing Machine. Universal TM (UTM) a TM that simulates other TMs Each TM T can be described by a table (string). Used to show that some problems cannot be solved by any TM. 2 m b Control Unit Tape Unit John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 4 / 26

Parallel Models I k-d mesh-based machines Cell (i, i 2,..., i k ) adjacent to (i, i 2,..., i k ) if i r i r = for only one r [... k]. Network-based machines Interconnection of individual FSMs. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 5 / 26

Parallel Models II Parallel RAM (PRAM) Identical RAMs with individual IDs connected to common memory. In synch they read, compute, and store to memory. Hypercube-based machines Network of 2 k synchronous machines each identified with a binary k-tuple. Neighboring processor IDs differ in one bit. Processors swap data between neighbors, compute and repeat. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 6 / 26

Languages, Grammars, Machines Languages and Grammars Regular: A u or A vc where A, B are non-terminals (NTs), u, v are terminals. Context-free: A BC or A u Recursively enumerable (r.e.): a b where a has at least one NT. Recursive: r.e. languages whose complements are r.e. Languages and Machines Regular FSMs Context-free Pushdown Automata Recursively enumerable Turing machines Recursive Halting Turing machines John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 7 / 26

Resource Limitations Circuit size and depth Size = number of gates; depth = length of longest path. Time number of computation steps Space no. cells in RAM, log 2 Q in FSM, tapes cells on TM I/O operations number of data movements Chip area for very large integrated circuits (VLSI) Wires have width and occupy area! John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 8 / 26

Relationships Between Models and Tradeoffs Relationships Between Models DFSMs equivalent to NDFSMs, DFMS subset of TMs T -step DFSM (NDFSM) can be simulated by a circuit (with free inputs). T (n)-step DTM (NDTM) on inputs of length n can be simulated by a circuit (all inputs are specified). Tradeoffs Between Resources Space vs time on RAM ST = Ω(n 2 ) for convolution. Area vs time for VLSI AT 2 = Ω(m 4 ) for m m matrix multiplication. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 9 / 26

Problem Classification by Difficulty Computationally feasible Functions computable (languages recognizable) by some TM. Computationally infeasible Functions not computable (languages not recognizable) by any TM. Functions and languages classified by time and space Focus in theoretical CS primarily on language recognition P, NP, EXPTIME, PSPACE, NPSPACE, L, NL, NC John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 2 / 26

The Role of Reductions What is a reduction? Solve new problem by reducing (transforming) it to the solution of a previously solved problem. Definition Let L Σ and L 2 Σ 2. L is reducible to L 2 (L f L 2 ) if there exists f : Σ Σ 2 such that x L if and only if f (x) L 2. Definition L is recursively enumerable (r.e.) if it is TM-recognizable. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 2 / 26

The Application of Reductions Assume that L f L 2 If L 2 is r.e. and f is TM-computable, then L is r.e. If L is not r.e. and f is TM-computable, then L 2 is not r.e. If L 2 is in P and f is poly-time, then L is in P. If L is not in P and f is poly-time, then L 2 is not in P. That is, L requires more than polynomial time for recognition. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 22 / 26

Languages Complete for a Class Definition A language L 2 is complete for a class C if it is the hardest language to recognize in C. Definition A language L 2 is NP-complete if L 2 is in NP and for every other language L in NP there is a poly-time f : Σ Σ 2 such that x is in L if and only if f (x) is in L 2. TSP and SAT are NP-complete. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 23 / 26

Approximation Algorithms Finding optimal solutions to NP-complete problems appears to be computationally infeasible. Seek poly-time approximation algorithms that find solutions whose performance (e.g. length of a tour for NP) is within a constant factor of optimal. Some problems do not have poly-time approximation algorithms unless P = NP. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 24 / 26

Tentative Schedule Week Models of Computation Week 2 Turing Machines, P, NP Week 3 NP-completeness, reductions Week 4 EXPTIME, P-Space, NP-Space, L, NL Week 5 Diagonalization Week 6 Circuits Week 7 Formula Size Week 8 Space-Time Tradeoffs Week 9 VLSI Model of Computation Week Parallel Computation, P vs NC Week Probability, Randomized Computation Week 2 IP, PSPACE Week 3 PCP, Hardness of Approximation, PCP-Theorem Week 4 More PCP and Hardness Results. John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 25 / 26

Course Management Six assignments Perhaps a midsemester exam A final exam John E. Savage (Brown University) CSCI 59 Intro to Computational Complexity January 2, 29 26 / 26