INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Resource-Bounded Computation Previously: can it be done? Now: how efficiently can it be done? Goal: conserve computational resources: Time, space, other.
1 Space Complexity. 2 Def: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n)
Giorgi Japaridze Theory of Computability Savitch’s Theorem Section 8.1.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Umans Complexity Theory Lectures Lecture 4b: Nondeterministic Space: I-S Theorem: NL = coNL.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Alternation Alternation: generalizes non-determinism, where each state is either “existential” or “universal”: Old: existential states New: universal states.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Computability and Complexity 22-1 Computability and Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 13-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
Computability and Complexity 19-1 Computability and Complexity Andrei Bulatov Non-Deterministic Space.
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
Complexity ©D.Moshkovits 1 Space Complexity Complexity ©D.Moshkovits 2 Motivation Complexity classes correspond to bounds on resources One such resource.
Complexity 1 The Padding Argument. Complexity 2 Motivation: Scaling-Up Complexity Claims space + non-determinism We have: space + determinism can be simulated.
Alternating Turing Machine (ATM) –  node is marked accept iff any of its children is marked accept. –  node is marked accept iff all of its children.
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Robbie Hott Department of Computer Science University of Virginia Theory of Computation CS3102.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Space Complexity. Reminder: P, NP classes P NP is the class of problems for which: –Guessing phase: A polynomial time algorithm generates a plausible.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Theory of Computing Lecture 21 MAS 714 Hartmut Klauck.
Measuring complexity Section 7.1 Giorgi Japaridze Theory of Computability.
Hierarchy theorems Section 9.1 Giorgi Japaridze Theory of Computability.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Umans Complexity Theory Lectures Lecture 1c: Robust Time & Space Classes.
Alternation Section 10.3 Giorgi Japaridze Theory of Computability.
Fall 2013 CMU CS Computational Complexity Lecture 2 Diagonalization, 9/12/2013.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C.
Theory of Computational Complexity Yuji Ishikawa Avis lab. M1.
Chapter 7 Introduction to Computational Complexity.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
Summary.
Theory of Computability
Space Complexity Costas Busch - LSU.
CSC 4170 Theory of Computation Space complexity Chapter 8.
Theory of Computability
Turing Machines Complexity ©D.Moshkovitz.
Time Complexity Classes
CSCI 2670 Introduction to Theory of Computing
Space Complexity and Interactive Proof Systems
Intro to Theory of Computation
Presentation transcript:

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011

TIME COMPLEXITY Definition: Let M be a TM that halts on all inputs. The running time or time-complexity of M is the function f : N  N, where f(n) is the maximum number of steps that M uses on any input of length n. Definition: TIME(t(n)) = { L | L is a language decided by a O(t(n)) time Turing Machine }

P = TIME(n c )  c  N IMPORTANT COMPLEXITY CLASSES NP = NTIME(n c )  c  N Problems where it is easy to find the answer. Problems where it’s easy to check the answer. If P = NP then generation is as easy as recognition.

Definition: A language B is NP-complete if: 1. B  NP 2. Every A in NP is poly-time reducible to B (i.e. B is NP-hard) HARDEST PROBLEMS IN NP 2. A is NP-complete and A ≤ P B If B is NP-Complete and P  NP, then There is no fast algorithm for B. Theorem: A language B is NP-complete if:

SPACE COMPLEXITY

WHEN A COMPUTER IS USEFUL…

ENCODING CHESS A 8£8 chess board has 64 squares and 32 pieces: Each square can have one of 13 values: 4 bits CHESS = { 〈 B 〉 | B is a chess board and white can force a win. } +1 bit encodes turn information.

HOW MUCH DISK DOES HARRY NEED ? How many moves at any level? ≤ 376 W ≤ 9Q + 1K + 2B + 2R + 2N = 376 How many levels? D ≤ (64) 32 2 = ≈ ≤10 51 So, at most, W D ≤ 10 positions By remembering whether each board B ∈ CHESS, we can explore “only” D ≈ positions. HOW MUCH SPACE?

Definition: Let M be a deterministic TM that halts on all inputs. The space complexity of M is the function ƒ: N  N, where ƒ(n) is the rightmost tape position that M reaches on any input of length n. Definition: Let M be a non-deterministic TM that halts on all inputs. The space complexity of M is the function ƒ : N  N, where ƒ(n) is the rightmost tape position that M reaches on any branch of its computation on any input of length n.

{ L | L is a language decided by a O(t(n)) space non-deterministic Turing Machine } Definition: SPACE(t(n)) = Definition: NSPACE(t(n)) = { L | L is a language decided by a O(t(n)) space deterministic Turing Machine }

3SAT  SPACE(n) (x  y  x) xy (x  y  x) # 00 xy (x  y  x) # 01

SAVITCH’S THEOREM Theorem: For any function f where f(n)  n, NSPACE(f(n))  SPACE(f(n) 2 ) Proof: Let N be a non-deterministic TM with space complexity f(n) Construct a deterministic machine M that simply tries each branch of N Since each branch of N uses space at most f(n), then M uses space at most f(n)

Assume a branch of a non-looping non- deterministic computation uses space k How many time steps can this branch have? k|Q||Γ| k = 2 O(k)

We need to simulate a non- deterministic computation while saving as much space as possible

Idea: Given two configurations c 1 and c 2 together with a number t, test whether N can get from c 1 to c 2 in t steps and space f(n) def can_yield(N,c 1, c 2, t, f): if t = 1: else: for c m ∈ { f-cell configurations }: if can_yield(c 1,c m,t/2,f) and can_yield(c m,c 2,t/2,f): return True else: return False if (c 1 = c 2 ) or (c 2 ∈ next_conf(N,c 1 )): return True else: return False

SAVITCH’S THEOREM Theorem: For any function f where f(n)  n NSPACE(f(n))  SPACE(f(n) 2 ) Proof: Let N be a non-deterministic TM with space complexity f(n) We modify N so that when it accepts, it clears its tape and moves the head to the leftmost cell Construct a deterministic machine M that on input w, simply returns can_yield(N,q 0 w,c accept, 2 df(n), f(n))

PSPACE = SPACE(n k )  k  N NPSPACE = NSPACE(n k )  k  N PSPACE = NPSPACE

EXAMPLE Prove that OTHELLO ∈ PSPACE. Let OTHELLO = { 〈 B 〉 | B is an othello position with a winning move for the current player. }

PSPACE is frequently called the class of games because many popular games belong to PSPACE.

P  PSPACE? YES

NP  PSPACE? YES

PNPPSPACE

Assume a deterministic Turing machine that halts on all inputs runs in space f(n) Question: At most how many time steps can this machine run for? f(n)|Q||Γ| f(n) = 2 O(f(n)) EXPTIME = TIME(2 )  k  ℕ nknk PSPACE  EXPTIME

P  NP  PSPACE  EXPTIME P ≠ EXPTIME