CSE 105 THEORY OF COMPUTATION

Similar documents
CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 Theory of Computation

Time Complexity. CS60001: Foundations of Computing Science

Chapter 7: Time Complexity

CISC 4090 Theory of Computation

Computability and Complexity

Lecture 16: Time Complexity and P vs NP

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

Computational Models Lecture 11, Spring 2009

CS154, Lecture 13: P vs NP

Theory of Computation Time Complexity

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) Spring l. Blum TIME COMPLEXITY AND POLYNOMIAL TIME;

CS154, Lecture 13: P vs NP

Finish K-Complexity, Start Time Complexity

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Computability Theory

CSE 135: Introduction to Theory of Computation NP-completeness

TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20

P and NP. Or, how to make $1,000,000.

CS5371 Theory of Computation. Lecture 18: Complexity III (Two Classes: P and NP)

Computational complexity

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

Intractable Problems [HMU06,Chp.10a]

Lecture 19: Finish NP-Completeness, conp and Friends

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Complexity (Pre Lecture)

BBM402-Lecture 11: The Class NP

Computational Complexity

Lecture 3: Nondeterminism, NP, and NP-completeness

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

1 Computational Problems

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

CSE 105 THEORY OF COMPUTATION

Notes for Lecture Notes 2

Friday Four Square! Today at 4:15PM, Outside Gates

NP, polynomial-time mapping reductions, and NP-completeness

CP405 Theory of Computation

22c:135 Theory of Computation. Analyzing an Algorithm. Simplifying Conventions. Example computation. How much time does M1 take to decide A?

Intro to Theory of Computation

Design and Analysis of Algorithms

Turing Machines and Time Complexity

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Computer Sciences Department

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CSE 105 THEORY OF COMPUTATION

NP-Completeness and Boolean Satisfiability

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Complexity Theory Part I

1 Non-deterministic Turing Machine

Chapter 2 : Time complexity

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

Intractable Problems. Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions

Time Complexity. Definition. Let t : n n be a function. NTIME(t(n)) = {L L is a language decidable by a O(t(n)) deterministic TM}

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

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

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

Harvard CS 121 and CSCI E-121 Lecture 20: Polynomial Time

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Advanced Topics in Theoretical Computer Science

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

Intro to Theory of Computation

Complexity: moving from qualitative to quantitative considerations

Algorithms & Complexity II Avarikioti Zeta

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

CSE 105 THEORY OF COMPUTATION

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

NP Complete Problems. COMP 215 Lecture 20

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

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

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

NP-Completeness. Until now we have been designing algorithms for specific problems

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

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

Complexity Theory Part II

10.3: Intractability. Overview. Exponential Growth. Properties of Algorithms. What is an algorithm? Turing machine.

q FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) Spring L. Blum. REVIEW for Midterm 2 TURING MACHINE

NP Completeness and Approximation Algorithms

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

Definition: conp = { L L NP } What does a conp computation look like?

In complexity theory, algorithms and problems are classified by the growth order of computation time as a function of instance size.

Complexity Theory Part I

Theory of Computation

Decidability and Undecidability

The Polynomial Hierarchy

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

Lecture 20: conp and Friends, Oracles in Complexity Theory

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Computability and Complexity

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

Introduction to Complexity Theory

Review of unsolvability

CSE 105 THEORY OF COMPUTATION

Transcription:

CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/

Today's learning goals Sipser Ch 7 Distinguish between computability and complexity Articulate motivation questions of complexity Section 7.1: time complexity, asymptotic upper bounds. Section 7.2: polynomial time, P Section 7.3: NP, polynomial verifiers, nondeterministic machines.

Complexity theory Chapter 7 In the "real world", computers (and Turing machines) don't have infinite tape, and we can't afford to wait unboundedly long for an answer. "Decidable" isn't good enough we want "Efficiently decidable"

Not just decidable For a given algorithm working on a given input, how long do we need to wait for an answer? How does the running time depend on the input in the worst-case? averagecase? Expect to have to spend more time on larger inputs.

Measuring time For a given algorithm working on a given input, how long do we need to wait for an answer? Count steps! How does the running time depend on the input in the worstcase? average-case? Big-O Can we detect problems that are efficiently solvable?

Time complexity For M a deterministic decider, its running time or time complexity is the function f: N R + given by f(n) = maximum number of steps M takes before halting, over all inputs of length n. worst-case analysis Plus, instead of calculating precisely, estimate f(n) by using big-o notation.

Time complexity classes TIME(t(n)) = { L L is decidable by a TM running in O(t(n)) } Exponential Brute-force search Polynomial Logarithmic Invariant under many models of TMs May not need to read all of input

The class P Why is it okay to group all polynomial running times? Contains all the "feasibly solvable" problems. Invariant for all the "usual" deterministic TM models multitape machines (Theorem 7.8) multi-write

Which Turing machine model? q0 q0 deterministic computation nondeterministic computation q rej q acc q acc q rej q rej

Time complexity For M a deterministic decider, its running time or time complexity is the function f: N R + given by f(n) = maximum number of steps M takes before halting, over all inputs of length n. For M a nondeterministic decider, its running time or time complexity is the function f: N R + given by f(n) = maximum number of steps M takes before halting on any branch of its computation, over all inputs of length n.

Time complexity classes DTIME ( t(n) ) = { L L is decidable by O( t(n) ) deterministic, single-tape TM } NTIME ( t(n) ) = { L L is decidable by O( t(n) ) nondeterministic, single-tape TM } Is DTIME(n 2 ) is a subset of DTIME(n 3 )? A. Yes B. No C. Not enough information to decide D. I don't know

Time complexity classes DTIME ( t(n) ) = { L L is decidable by O( t(n) ) deterministic, single-tape TM } NTIME ( t(n) ) = { L L is decidable by O( t(n) ) nondeterministic, single-tape TM } Is DTIME(n 2 ) is a subset of NTIME(n 2 )? A. Yes B. No C. Not enough information to decide D. I don't know

Time complexity classes DTIME ( t(n) ) = { L L is decidable by O( t(n) ) deterministic, single-tape TM } NTIME ( t(n) ) = { L L is decidable by O( t(n) ) nondeterministic, single-tape TM } Is NTIME(n 2 ) is a subset of DTIME(n 2 )? A. Yes B. No C. Not enough information to decide D. I don't know

P vs. NP

"Feasible" i.e. P Can't use nondeterminism Can use multiple tapes Often need to be "more clever" than naïve / brute force approach Examples PATH = {<G,s,t> G is digraph with n nodes there is path from s to t} Use breadth first search to show in P RELPRIME = { <x,y> x and y are relatively prime integers} Use Euclidean Algorithm to show in P L(G) = {w w is generated by G} where G is any CFG Use Dynamic Programming to show in P

"Verifiable" i.e. NP Can be decided by a nondeterministic TM in polynomial time Best known deterministic solution is brute-force Solution can be verified by a deterministic TM in polynomial time P = NP?

Examples in NP Solution can be verified by a deterministic TM in polynomial time HAMPATH = {<G,s,t> G is digraph with n nodes there is path from s to t that goes through every node exactly once} VERTEX-COVER = { <G,k> G is an undirected graph with n nodes that has a k-node vertex cover} CLIQUE = { <G,k> G is an undirected graph with n nodes that has a k-clique} SAT = { < X > X is a satisfiable Boolean formula with n variables}

Examples in NP Claim: HAMPATH is in NP

Decidable Decidable P = NP NP or P Finite Finite

P vs. NP Problems in P (Membership in any) CFL PATH E DFA EQ DFA Addition, multiplication of integers Problems in NP Any problem in P HAMPATH CLIQUE VERTEX-COVER TSP SAT

Next time Pre-class reading skim Chapter 7