Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all
|
|
- Elvin Barton
- 6 years ago
- Views:
Transcription
1 Definition 8.1 Let M be a deterministic Turing machine, DTM, that halts on all inputs. The space complexity of M is the function f : N N, where f(n) is the maximum number of tape cells that M scans on any input of length n. If M is a nondeterministic Turing machine, NTM, wherein all branches of its computation halt on all inputs, we define the space complexity of M, f(n), to be the maximum number of tape cells that M scans on any branch of its computation for any input of length n. Example 1 (8.3) SAT can be solved with the linear space algorithm M1: M1 = On input Φ, where Φ is a Boolean formula: 1. For each truth assignment to the variables x1,...,xn of Φ: (a) Evaluate Φ on that truth assignment; (b) If Φ evaluates to 1, accept. 2. If Φ never evaluates to 1, reject". 22c:135 Theory of Computation Hantao Zhang hzhang/c135 The University of Iowa Department of Computer Science Ch.8 Space Complexity Estimation of space complexity Let f : N N be a function. The space complexity classes, SPACE(f(n)) and NSPACE(f(n)) are defined by: SPACE(f(n)) = {L L is a language decided by an O(f(n)) space DTM} NSPACE(f(n)) = {L L is a language decided by an O(f(n)) space NTM}
2 Example 3 (8.4) Testing whether an NFA accepts all strings, ALLNFA = { A A is an NFA L(A) = Σ } ALLNFA = { A A is an NFA L(A) Σ } We show that ALLNFA NSPACE(n). Proof idea: construct N, a nondeterministic linear space algorithm that decide ALLNFA by guessing a string that is rejected by NFA A and uses a linear space to keep track of which states the NFA could be in at a particular time. Note, this language is not known to be NP or co NP. SPACE vs NSPACE Recall NTIME(f(n)) TIME(2 O(f(n)) ). Savitch s Theorem For any function f : N N, where f(n) n, NSPACE(f(n)) SPACE(f 2 (n)). Proof idea: If NTM N uses f(n) space, we need to construct a DTM M which simulates N and uses f 2 (n) space. Example 2 Testing whether a DFA accepts all strings, ALLDFA = { A A is a DFA L(A) = Σ } ALLDFA = { A A is an DFA L(A) Σ } We show that ALLDF A SPACE(n). Proof idea: construct D, a deterministic linear space algorithm that decide ALLDFA by enumerating all strings of length n. If A rejects one of them, D stops with accept. If A accepts all, D will reject. Construction N = On input A where A is an NFA: 1. Place a marker on the start state of A. 2. Repeat 2 q times, where q is the number of states of A: (a) Nondeterministically select an input symbol and change the positions of all the markers on A s states to simulate reading of that symbol. (b) If all the marked states are non-final, accept; 3. reject".
3 CANYIELD(c1, c2, t) CANYIELD(c1,c2,t) is a TM that tests whether a NTM N can go from the configuration c1 of N to the configuration c2 of N in at most t steps. CANYIELD = "On input c1,c2,t: 1. If t = 1 test whether c1 = c2 or whether c1 yields c2 in one step according to the transition rules of N; accept if either test succeeds, reject is both fail. 2. If t > 1 then for each configuration x of N using space f(n): (a) Run CANYIELD(c1, x, t/2 ). (b) Run CANYIELD(x, c2, t/2 ). (c) If both 2(a) and 2(b) accept then accept. 3. If haven t yet accepted at 2(c), reject". AnalyzingM Whenever CANYIELD invokes itself recursively it stores the current stage number and the values c1, c2, t on the stack. Each level of recursion uses O(f(n)) additional space. Each level of recursion divides the size t in half. Since initially t = 2 df(n) the depth of the recursion is O(log(2 df(n) ) = O(f(n)). Hence, the total space used is O(f 2 (n)). SPACE vs NSPACE Recall NTIME(f(n)) TIME(2 O(f(n)) ). Savitch s Theorem For any function f N N, where f(n) n, NSPACE(f(n)) SPACE(f 2 (n)). Proof idea: If NTM N uses f(n) space, we need to construct a DTM M which simulates N and uses f 2 (n) space. M calls the function CANYIELD(c1,c2,t), which can be computed by a TM, that tests whether a NTM N can go from the configuration c1 of N to the configuration c2 of N in at most t steps. DTMM simulating NTMN Suppose N is modified that once it enters an accepting state, it erases everything on the tape and moves the tape head to the leftmost position. Let such a final configuration be ca. Let d be a constant such that N has no more that 2 df(n) configuration. Then the DTM M is: M = "On input w 1. Let cs be q0w, where q0 is the start state of N. 2. Output the result of CANYIELD(cs,ca,2 df(n) )."
4 The classpspace PSPACE is the class of languages that are decidable in polynomial space on a DTM, i.e.: PSPACE = kspace(n k ) NPSPACE = knspace(n k ) Let us all define EXPTIME = ktime(2 nk ) Lemma: SPACE(f(n)) TIME(2 O(f(n)) ). SUMMARY P NP PSPACE = NPSPACE EXPTIME APSPACE-complete language TQBF = { Φ Φ is a true fully quantified Boolean formula} Φ is a fully quantified Boolean formula if Φ = Q1x1Q2 QnxnΨ, where Ψ is a Boolean formula in CNF, x1,x2,...,xn are the boolean variables in Ψ (Φ is said to be in prenex normal form), and Qi {, } for 1 i n. T QBF is PSPACE-complete. The classpspace PSPACE is the class of languages that are decidable in polynomial space on a DTM, i.e.: PSPACE = kspace(n k ) NPSPACE = knspace(n k ) Let us define EXPTIME = ktime(2 nk ) Lemma: SPACE(f(n)) TIME(2 O(f(n)) ). PSPACE-Completeness A language B is PSPACE-complete if it satisfies two conditions: 1. B PSPACE 2. Every A PSPACE is polynomially time reducible to B. If B satisfies only 2, B is said to be PSPACE-hard.
5 T QBF is PSPACE-Hard Idea: Use T and the construction of CANYIELD to prove that any PSPCE problem reduces to TQBF in polynomial time. Assignment-tableau correspondence The assignment turns on exactly one variable for each cell, using the following constructs: 1. at least one variable that is associated with a cell is on, by: s C x i,j,s 2. no more than one variable is on for each each cell, by: s,t C,s t (x i,j,s xi,j,t) Thus, any satisfying assignment specifies one symbol in each cell by: Φcell = 1 i,j j [( s C x i,j,s) ( s t C (x i,j,s xi,j,t))] TQBF PSPACE The following polynomial space algorithm decides TQBF: T = "On input Φ, a fully quantified Boolean formula: 1. If Φ contains no quantifiers, then it is an expression with only constants. So, evaluate Φ and accept if it is true; otherwise reject. 2. If Φ = xψ, recursively call T on Ψ, first with 0 substituted for x and then with 1 substituted for x. If either result is accept, accept; otherwise reject. 3. If Φ = xψ, recursively call T on Ψ, first with 0 substituted for x and then with 1 substituted for x. If both results are accept, accept; otherwise reject." Proof Review: SAT is NP-Hard On input A,w, let n = w and A can be recognized by a NTM using n k time for constant k, f will produce Φw in O(n k ). Variables ofφw: Let N = (Q,Σ,Γ,δ,q0,qa,qr), L(N) = A, and C = Q Γ {#}. For each 1 i,j n k s C we have a boolean variable xi,j,s in Φw. Cells: each of the (n k ) 2 entries of a tableau is called a cell. s C xi,j,s = 1 if cell[i,j] = s. Formula Φw: Φw = Φcell Φstart Φmove Φaccept.
6 Legal windows A 2 3 window of cells is legal if that window does not violate the actions specified by N s transition function. To explain, consider the transitions: δ(q1,b) = {(q2,c,l),(q2,a,r)}. Examples of legal windows for this machine are: (a) x q1 b q2 x c (d) # y x # y x (b) x q1 b x a q2 (e) b z x q2 z x (c) y x q1 y x a (f) q1 b z a q2 z Note Φc1,c2,t encodes the contents of tape cells as in the Cook-Levin theorem. Each configuration has n k cells and so it is encoded by O(n k ) variables. For t = 1 the formula Φc1,c2,t says that either c1 = c2 or c2 follows from c1 in a single step of M. If t > 1, construct Φc1,c2,t recursively: Φc1,c2,t = m1[φ c1,m1,t/2 Φ m1,c2,t/2 ] where m1 is a configuration of M. m1 is shorthand for x1,x2,...,xl, l = O(n k ) and x1,...,xl are variables encoding m1. To reduce the size of the formula we use both quantifiers, and : Φc1,c2,t = m1 (c3,c4) {(c1,m1),(m1,c2)}[φ c3,c4,t/2 ] where x {y,z...}φ(x) denotes (Φ(y) P(z)...). An accepting tableau is specified by Φstart, Φmove, Φaccept Φstart ensures that the first row of the tableau is the starting configuration of N on w by the equality: Φstart = x1,1,# x1,2,q0 x1,3,w1... x1,n+3,wn... x 1,n k 1, x 1,n k,#. Φaccept guarantees that an accepting configuration occurs in the tableau by placing qa in one of the cells by: Φaccept = 1 i,j n k x i,j,qa Φmove guarantees that each row of the tableau correspond to a configuration that legally follows the preceding row s configuration according the N s transition rules. T QBF is PSPACE-hard Let A be a language decided by TM M in space n k for some constant k. We give a polynomial time reduction from A to TQBF: The reduction maps machine M and string w to a quantified Boolean formula Φ that is true iff M accepts w: The formula is Φc1,c2,t where c1 and c2 are variables representing two configurations, and t > 0. If we assign to c1 and c2 actual configurations, Φc1,c2,t is true iff M can go from c1 to c2 in at most t steps. Consider Φcstart,caccept,h, where h = 2 df(n) for a constant d chosen so that M has no more than 2 df(n) configurations. Assume that t is a power of 2.
7 Example of Formula Game Suppose E moves first. If Φ = (x1 x2) (x2 x3) ( x2 x3) then E always wins if it selects x1 = 1, thus E has the winning strategy. If Ψ = (x1 x2) (x2 x3) (x2 x3) then A always wins: If E selects x2 = 1, then A selects x1 = 0; otherwise A selects x2 = 0. Thus A has a winning strategy for this game. Theorem 8.11 The problem of determining which player has a winning strategy in a formula-game associated with a particular formula is PSPACE-complete. Formally: FORMULA-GAME = { X,Φ Player E has a winning strategy in the formula game (X,Φ)} is PSPACE-complete. A Formula Game A formual game is a pair (X,Ψ), where X is a list of boolean variables, X = [x1,x2,...,xm], and Ψ is a quantifier-free boolean formula built on X. The game consists of m moves: In move i, a player assigns a boolean value to variable xi. Two players, E and A, take turn to make a move. If Ψ becomes true after m moves, E wins; otherwise, A wins. A player is said to have a winning strategy if the player can always win the game by making right moves, no matter how the other player moves. TQBF vs Formula Game Theorem: Given a game (X,Ψ), suppose E moves first and m is even. Let Φ = x1 x2 x3... xm[ψ]. Then Φ is true iff E has a winning strategy for the game (X,Ψ). Lemma: For any fully quantified boolean formula Φ, there exists an equivalent fully quantified boolean formula Φ in prenex normal form whose quantifiers alternate between and. Theorem: For any fully quantified boolean formula Φ, there exists a formula game (X,Ψ) such that player E has a winning strategy iff Φ is true.
8 The GG problem GG = { G,b Player I has a winnintg strategy for the generalized geography game played on graph G starting at node b}. Theorem 8.14 GG is PSPACE-complete GG is PSPACE-hard Theorem: Formula-Game P GG. Let (X,Φ) be a formula game, where Φ is in CNF containing m clauses. We construct a graph G = (V,E) and a special node b such that player E has a winning strategy in (X,Φ) for formual game iff player E has a winning strategy in (G,b) in GG. V = V1 V2, where V1 = {bi,xi, xi,ei 1 i k,k = X } (assume X is odd), and V2 = {c,cj,cj,i 1 j m,1 i k,cj = (cj,1 cj,k)}. E = E1 E2 E3, where E1 constructs a chain of dimonds among V1, E2 constructs a tree among V2, E3 connects V1 and V2. b = b1 Generalized Geography This is a child game where players take turns naming cities from anywhere in the world. Each city chosen must begin with the same letter that ended the previous city name and no duplication is allowed. Graph model: A directed graph G = (V,E) whose nodes are cities of the world and an arrow goes from node n1 to node n2 if the city labeling n2 starts with the letter that ends the name labeling node n1. GG is in PSPACE The following algorithm M decides whether player E has a winning strategy for GG game: M="On input G,b where G is a directed graph and b is a node of G: 1. If b has outdegree 0, reject, player E loses immediately 2. Remove node b and all connected arrows to get G. 3. For each node b1,b2,...,bk that b originally pointed, recursively call M on G,bi. 4. If one of (bi,g ) returns reject, player E would choose bi, and M accepts. 5. If all of these (bi,g ) return accept, player A has a winning strategy in the original game, so M returns reject.
9 Example A = {0 k 1 k k > 0} is a member of L. Zig-zag decision algorithm can be modified to use two tapes: a read-only input tape and a read-write working tape. The algorithm counts 0-s and 1 in the input and write their binary expressions on the work tape. Since only space for two binary numbers is required and since number of binary digits in n is log n it results that A L. Log space transducers A log space transducer M is a TM with a read-only input tape, a write-only output tape, and a read/write work tape. The work tape may contain O(log n) symbols. M computes a function f : Σ Σ, where f(w) is the string remaining on the output tape after M halts when it starts with w on the input tape. f is called a log space computable function Definition 8.17 L is the class of languages that are decidable in logarithmic space on a DTM with a read-only input tape, i.e., L = SPACE(logn) NL is the class of languages that are decidable in logarithmic space on a NTM with a read-only input tape, i.e., L = NSPACE(logn) Note: Since logn < n these languages are also called of sublinear space complexity. Example P AT H = { G, s, t G is a directed graph that has a directed path from s to t } is a member of NL. Let T be the NTM recognizing PATH. T needs only to remember one node on its work tape. Let that node be x. T = On input G,s,t 1. Initially, x = s. 2. If x has no successors, T rejects. 3. T then nondeterministically chooses a successor y of x. 4. If y is t, T accepts. 5. Replace x by y, go to 2.
10 Configuration If M is a TM that has a read-only input tape and a work tape, and w is an input, a configuration of M on w is a setting of the state, the work tape, and the positions of the two tape heads. Note: w is, but w itself is not part of the configuration of M on w. If w = n, Γ = g, Q = h, and M uses f(n) space, then the different configurations will be n f(n) h g f(n) or n2 O(f(n)). Theorem: If A L B, then A P B. NL-Completeness A Language B is NL-complete if: 1. B NL 2. For every A NL, A L B. Log space reducibility Language A is log space reducible to language B, written A L B, if there exists a log space computable function f, such that for any w Σ, w A iff f(w) B. Proof of the Theorem Theorem: If A L B, then A P B. Using Savitch s Theorem: For any function fn N, where f(n) n, NSPACE(f(n)) SPACE(f 2 (n)). Savitch s theorem works for f(n) = O(logn).
11 Proof of the Theorem If A L B and B L then A L. Proof: Let MA be the TM recognizing A and MB be the TM recognizing B. MA computes individual symbols of f(w) as required by MB. In simulation MA keeps track of where MB s input head would be on f(b). Every time MB moves, MA restarts computation of f on w from the beginning and ignores all the output except for the desired location of f(w). This may be time-inefficient because parts of f(w) could be repeated. However, only a single symbol of f(w) need be stored at any time, in effect treading time for space Theorem 8.25 P AT H is N L-complete, where PATH = { G,s,t G is a directed graph that has a directed path from s to t } Theorem 8.23 If A L B and B L then A L. Proof: for w A, f(w) B but f(w) could require a too large space to fit within log space bound. Hence we need another approach. Corollary If any NL-complete language is in L then L = NL.
12 Summary L NL P NP PSPACE = NPSPACE EXPTIME Corollary 8.26 NL P Proof: PATH P and any language in NL is polynomially time reducible to PATH.
Introduction to Computational Complexity
Introduction to Computational Complexity George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Computational Complexity September
More informationSpace Complexity. Huan Long. Shanghai Jiao Tong University
Space Complexity Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/ chen/
More informationTheory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1
Theory of Computation Space Complexity (NTU EE) Space Complexity Fall 2016 1 / 1 Space Complexity Definition 1 Let M be a TM that halts on all inputs. The space complexity of M is f : N N where f (n) is
More informationComputability and Complexity CISC462, Fall 2018, Space complexity 1
Computability and Complexity CISC462, Fall 2018, Space complexity 1 SPACE COMPLEXITY This material is covered in Chapter 8 of the textbook. For simplicity, we define the space used by a Turing machine
More informationCS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)
CS5371 Theory of Computation Lecture 23: Complexity VIII (Space Complexity) Objectives Introduce Space Complexity Savitch s Theorem The class PSPACE Space Complexity Definition [for DTM]: Let M be a DTM
More informationCOMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness
15-455 COMPLEXITY THEORY Space Complexity: Savitch's Theorem and PSPACE- Completeness October 30,2012 MEASURING SPACE COMPLEXITY FINITE STATE CONTROL I N P U T 1 2 3 4 5 6 7 8 9 10 We measure space complexity
More informationLecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation
Lecture 20: PSPACE November 15, 2016 CS 1010 Theory of Computation Recall that PSPACE = k=1 SPACE(nk ). We will see that a relationship between time and space complexity is given by: P NP PSPACE = NPSPACE
More informationThe space complexity of a standard Turing machine. The space complexity of a nondeterministic Turing machine
298 8. Space Complexity The space complexity of a standard Turing machine M = (Q,,,, q 0, accept, reject) on input w is space M (w) = max{ uav : q 0 w M u q av, q Q, u, a, v * } The space complexity of
More informationCS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)
CS5371 Theory of Computation Lecture 23: Complexity VIII (Space Complexity) Objectives Introduce Space Complexity Savitch s Theorem The class PSPACE Space Complexity Definition [for DTM]: Let M be a DTM
More informationChapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE
Chapter 1 - Time and Space Complexity deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE 1 / 41 Deterministic Turing machines Definition 1.1 A (deterministic
More informationUNIT-IV SPACE COMPLEXITY
UNIT-IV SPACE COMPLEXITY Time and space are two of the most important considerations when we seek practical solutions to many computational problems. Space complexity shares many of the features of time
More informationNP-Completeness. A language B is NP-complete iff B NP. This property means B is NP hard
NP-Completeness A language B is NP-complete iff B NP A NP A P B This property means B is NP hard 1 3SAT is NP-complete 2 Result Idea: B is known to be NP complete Use it to prove NP-Completeness of C IF
More informationPSPACE COMPLETENESS TBQF. THURSDAY April 17
PSPACE COMPLETENESS TBQF THURSDAY April 17 Definition: Language B is PSPACE-complete if: 1. B PSPACE 2. Every A in PSPACE is poly-time reducible to B (i.e. B is PSPACE-hard) QUANTIFIED BOOLEAN FORMULAS
More informationLecture 22: PSPACE
6.045 Lecture 22: PSPACE 1 VOTE VOTE VOTE For your favorite course on automata and complexity Please complete the online subject evaluation for 6.045 2 Final Exam Information Who: You On What: Everything
More informationCSE 555 HW 5 SAMPLE SOLUTION. Question 1.
CSE 555 HW 5 SAMPLE SOLUTION Question 1. Show that if L is PSPACE-complete, then L is NP-hard. Show that the converse is not true. If L is PSPACE-complete, then for all A PSPACE, A P L. We know SAT PSPACE
More information22c:135 Theory of Computation. Analyzing an Algorithm. Simplifying Conventions. Example computation. How much time does M1 take to decide A?
Example computation Consider the decidable language A = {0 n 1 n n 0} and the following TM M1 deciding A: M1 = "On input string w: 1. Scan across the tape and reject if a 0 appears after a 1 2. Repeat
More informationSOLUTION: SOLUTION: SOLUTION:
Convert R and S into nondeterministic finite automata N1 and N2. Given a string s, if we know the states N1 and N2 may reach when s[1...i] has been read, we are able to derive the states N1 and N2 may
More informationLecture 23: More PSPACE-Complete, Randomized Complexity
6.045 Lecture 23: More PSPACE-Complete, Randomized Complexity 1 Final Exam Information Who: You On What: Everything through PSPACE (today) With What: One sheet (double-sided) of notes are allowed When:
More informationSpace Complexity. Master Informatique. Université Paris 5 René Descartes. Master Info. Complexity Space 1/26
Space Complexity Master Informatique Université Paris 5 René Descartes 2016 Master Info. Complexity Space 1/26 Outline Basics on Space Complexity Main Space Complexity Classes Deterministic and Non-Deterministic
More informationComplexity Theory 112. Space Complexity
Complexity Theory 112 Space Complexity We ve already seen the definition SPACE(f(n)): the languages accepted by a machine which uses O(f(n)) tape cells on inputs of length n. Counting only work space NSPACE(f(n))
More informationSpace is a computation resource. Unlike time it can be reused. Computational Complexity, by Fu Yuxi Space Complexity 1 / 44
Space Complexity Space is a computation resource. Unlike time it can be reused. Computational Complexity, by Fu Yuxi Space Complexity 1 / 44 Synopsis 1. Space Bounded Computation 2. Logspace Reduction
More informationUndirected ST-Connectivity in Log-Space. Omer Reingold. Presented by: Thang N. Dinh CISE, University of Florida, Fall, 2010
Undirected ST-Connectivity in Log-Space Omer Reingold Presented by: Thang N. Dinh CISE, University of Florida, Fall, 2010 Undirected s-t connectivity(ustcon) Is t reachable from s in a undirected graph
More informationSpace Complexity. The space complexity of a program is how much memory it uses.
Space Complexity The space complexity of a program is how much memory it uses. Measuring Space When we compute the space used by a TM, we do not count the input (think of input as readonly). We say that
More informationLogarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18
Logarithmic space Evgenij Thorstensen V18 Evgenij Thorstensen Logarithmic space V18 1 / 18 Journey below Unlike for time, it makes sense to talk about sublinear space. This models computations on input
More informationNotes on Complexity Theory Last updated: October, Lecture 6
Notes on Complexity Theory Last updated: October, 2015 Lecture 6 Notes by Jonathan Katz, lightly edited by Dov Gordon 1 PSPACE and PSPACE-Completeness As in our previous study of N P, it is useful to identify
More informationLecture 17: Cook-Levin Theorem, NP-Complete Problems
6.045 Lecture 17: Cook-Levin Theorem, NP-Complete Problems 1 Is SAT solvable in O(n) time on a multitape TM? Logic circuits of 6n gates for SAT? If yes, then not only is P=NP, but there would be a dream
More informationCS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT
CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT Definition: A language B is NP-complete if: 1. B NP 2. Every A in NP is poly-time reducible to B That is, A P B When this is true, we say B is NP-hard On
More informationOutline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018
Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 3. Logarithmic Space Reinhard Pichler Institute of Logic and Computation DBAI Group TU Wien 3. Logarithmic Space 3.1 Computational
More informationComputational Complexity IV: PSPACE
Seminar on Theoretical Computer Science and Discrete Mathematics Aristotle University of Thessaloniki Context 1 Section 1: PSPACE 2 3 4 Time Complexity Time complexity of DTM M: - Increasing function t:
More informationComplexity (Pre Lecture)
Complexity (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2018 Dantam (Mines CSCI-561) Complexity (Pre Lecture) Fall 2018 1 / 70 Why? What can we always compute efficiently? What
More informationDe Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.
De Morgan s a Laws De Morgan s laws say that (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2. Here is a proof for the first law: φ 1 φ 2 (φ 1 φ 2 ) φ 1 φ 2 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 0 a Augustus DeMorgan
More informationCould we potentially place A in a smaller complexity class if we consider other computational models?
Introduction to Complexity Theory Big O Notation Review Linear function: r(n) =O(n). Polynomial function: r(n) =2 O(1) Exponential function: r(n) =2 no(1) Logarithmic function: r(n) = O(log n) Poly-log
More informationTIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20
TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP THURSDAY Mar 20 COMPLEXITY THEORY Studies what can and can t be computed under limited resources such as time, space, etc Today:
More informationsatisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs
Any Expression φ Can Be Converted into CNFs and DNFs φ = x j : This is trivially true. φ = φ 1 and a CNF is sought: Turn φ 1 into a DNF and apply de Morgan s laws to make a CNF for φ. φ = φ 1 and a DNF
More informationCS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010
CS311 Computational Structures NP-completeness Lecture 18 Andrew P. Black Andrew Tolmach 1 Some complexity classes P = Decidable in polynomial time on deterministic TM ( tractable ) NP = Decidable in polynomial
More information6.840 Language Membership
6.840 Language Membership Michael Bernstein 1 Undecidable INP Practice final Use for A T M. Build a machine that asks EQ REX and then runs M on w. Query INP. If it s in P, accept. Note that the language
More informationComputability Theory
CS:4330 Theory of Computation Spring 2018 Computability Theory P versus NP and NP-Completeness Haniel Barbosa Readings for this lecture Chapter 7 of [Sipser 1996], 3rd edition. Section 7.4. The P versus
More information1 PSPACE-Completeness
CS 6743 Lecture 14 1 Fall 2007 1 PSPACE-Completeness Recall the NP-complete problem SAT: Is a given Boolean formula φ(x 1,..., x n ) satisfiable? The same question can be stated equivalently as: Is the
More informationChapter 7: Time Complexity
Chapter 7: Time Complexity 1 Time complexity Let M be a deterministic Turing machine 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
More information6.045 Final Exam Solutions
6.045J/18.400J: Automata, Computability and Complexity Prof. Nancy Lynch, Nati Srebro 6.045 Final Exam Solutions May 18, 2004 Susan Hohenberger Name: Please write your name on each page. This exam is open
More informationP vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.
P vs. NP Classes Prof. (Dr.) K.R. Chowdhary Email: kr.chowdhary@iitj.ac.in Formerly at department of Computer Science and Engineering MBM Engineering College, Jodhpur Monday 10 th April, 2017 kr chowdhary
More informationCS5371 Theory of Computation. Lecture 24: Complexity IX (PSPACE-complete, L, NL, NL-complete)
CS5371 Theory of Computation Lecture 24: Complexity IX (PSPACE-complete, L, NL, NL-complete) Objectives PSPACE-complete languages + Examples The classes L and NL NL-complete languages + Examples PSPACE-complete
More informationLecture 8: Complete Problems for Other Complexity Classes
IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 8: Complete Problems for Other Complexity Classes David Mix Barrington and Alexis Maciel
More informationCMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems
CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems Valentine Kabanets September 13, 2007 1 Complexity Classes Unless explicitly stated,
More information6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3
6.841/18.405J: Advanced Complexity Wednesday, February 12, 2003 Lecture Lecture 3 Instructor: Madhu Sudan Scribe: Bobby Kleinberg 1 The language MinDNF At the end of the last lecture, we introduced the
More informationP = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:
CS 6505: Computability & Algorithms Lecture Notes for Week 5, Feb 8-12 P, NP, PSPACE, and PH A deterministic TM is said to be in SP ACE (s (n)) if it uses space O (s (n)) on inputs of length n. Additionally,
More informationINAPPROX APPROX PTAS. FPTAS Knapsack P
CMPSCI 61: Recall From Last Time Lecture 22 Clique TSP INAPPROX exists P approx alg for no ε < 1 VertexCover MAX SAT APPROX TSP some but not all ε< 1 PTAS all ε < 1 ETSP FPTAS Knapsack P poly in n, 1/ε
More informationTuring Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA
Turing Machines A Turing machine is similar to a finite automaton with supply of unlimited memory. A Turing machine can do everything that any computing device can do. There exist problems that even a
More informationCS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)
CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger
More informationLecture 21: Space Complexity (The Final Exam Frontier?)
6.045 Lecture 21: Space Complexity (The Final Exam Frontier?) 1 conp NP MIN-FORMULA conp P NP FIRST-SAT TAUT P FACTORING SAT NP NP NP 2 VOTE VOTE VOTE For your favorite course on automata and complexity
More informationAnswers to the CSCE 551 Final Exam, April 30, 2008
Answers to the CSCE 55 Final Exam, April 3, 28. (5 points) Use the Pumping Lemma to show that the language L = {x {, } the number of s and s in x differ (in either direction) by at most 28} is not regular.
More informationAdvanced topic: Space complexity
Advanced topic: Space complexity CSCI 3130 Formal Languages and Automata Theory Siu On CHAN Chinese University of Hong Kong Fall 2016 1/28 Review: time complexity We have looked at how long it takes to
More informationCS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)
CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A
More informationTheory of Computation Time Complexity
Theory of Computation Time Complexity Bow-Yaw Wang Academia Sinica Spring 2012 Bow-Yaw Wang (Academia Sinica) Time Complexity Spring 2012 1 / 59 Time for Deciding a Language Let us consider A = {0 n 1
More informationComplexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler
Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard
More informationCS154, Lecture 13: P vs NP
CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of
More informationOutline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.
Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität
More informationAdvanced Topics in Theoretical Computer Science
Advanced Topics in Theoretical Computer Science Part 5: Complexity (Part II) 30.01.2014 Viorica Sofronie-Stokkermans Universität Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1 Contents Recall: Turing
More informationAnnouncements. 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?
N P NP Completeness Announcements Friday Four Square! Today at 4:15PM, outside Gates. Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Explore P, NP, and their connection. Did
More information15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete
CS125 Lecture 15 Fall 2016 15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete Already know SAT NP, so only need to show SAT is NP-hard. Let L be any language in NP. Let M be a NTM that decides L
More informationCS4026 Formal Models of Computation
CS4026 Formal Models of Computation Turing Machines Turing Machines Abstract but accurate model of computers Proposed by Alan Turing in 1936 There weren t computers back then! Turing s motivation: find
More informationCISC 4090 Theory of Computation
CISC 4090 Theory of Computation Complexity Professor Daniel Leeds dleeds@fordham.edu JMH 332 Computability Are we guaranteed to get an answer? Complexity How long do we have to wait for an answer? (Ch7)
More informationMTAT Complexity Theory October 20th-21st, Lecture 7
MTAT.07.004 Complexity Theory October 20th-21st, 2011 Lecturer: Peeter Laud Lecture 7 Scribe(s): Riivo Talviste Polynomial hierarchy 1 Turing reducibility From the algorithmics course, we know the notion
More informationMore Complexity. Klaus Sutner Carnegie Mellon University. Fall 2017
More Complexity Klaus Sutner Carnegie Mellon University Fall 2017 1 Below NP Parallelism Above NP Where Are We? 3 We have a somewhat elaborate zoo of low complexity classes. For the flagship P and NP,
More informationLecture 8. MINDNF = {(φ, k) φ is a CNF expression and DNF expression ψ s.t. ψ k and ψ is equivalent to φ}
6.841 Advanced Complexity Theory February 28, 2005 Lecture 8 Lecturer: Madhu Sudan Scribe: Arnab Bhattacharyya 1 A New Theme In the past few lectures, we have concentrated on non-uniform types of computation
More informationLecture 3: Nondeterminism, NP, and NP-completeness
CSE 531: Computational Complexity I Winter 2016 Lecture 3: Nondeterminism, NP, and NP-completeness January 13, 2016 Lecturer: Paul Beame Scribe: Paul Beame 1 Nondeterminism and NP Recall the definition
More informationTheory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death
Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death Robbie Hott www.cs.virginia.edu/~jh2jf Department of Computer Science University of Virginia
More informationHierarchy theorems. Evgenij Thorstensen V18. Evgenij Thorstensen Hierarchy theorems V18 1 / 18
Hierarchy theorems Evgenij Thorstensen V18 Evgenij Thorstensen Hierarchy theorems V18 1 / 18 Comparing functions To prove results like TIME(f(n)) TIME(g(n)), we need a stronger notion of one function growing
More informationCS154, Lecture 13: P vs NP
CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of
More informationCSE 105 Theory of Computation
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s Agenda P and NP (7.2, 7.3) Next class: Review Reminders and announcements: CAPE & TA evals are open: Please
More informationPolynomial Space. The classes PS and NPS Relationship to Other Classes Equivalence PS = NPS A PS-Complete Problem
Polynomial Space The classes PS and NPS Relationship to Other Classes Equivalence PS = NPS A PS-Complete Problem 1 Polynomial-Space-Bounded TM s A TM M is said to be polyspacebounded if there is a polynomial
More informationPOLYNOMIAL SPACE QSAT. Games. Polynomial space cont d
T-79.5103 / Autumn 2008 Polynomial Space 1 T-79.5103 / Autumn 2008 Polynomial Space 3 POLYNOMIAL SPACE Polynomial space cont d Polynomial space-bounded computation has a variety of alternative characterizations
More informationan efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.
1 More on NP In this set of lecture notes, we examine the class NP in more detail. We give a characterization of NP which justifies the guess and verify paradigm, and study the complexity of solving search
More informationAnnouncements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!
N P NP Announcements Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! Now in cabinets in the Gates open area near the drop-off box. The Complexity Class
More informationIntroduction to Complexity Classes. Marcin Sydow
Denition TIME(f(n)) TIME(f(n)) denotes the set of languages decided by deterministic TM of TIME complexity f(n) Denition SPACE(f(n)) denotes the set of languages decided by deterministic TM of SPACE complexity
More informationCSE200: Computability and complexity Space Complexity
CSE200: Computability and complexity Space Complexity Shachar Lovett January 29, 2018 1 Space complexity We would like to discuss languages that may be determined in sub-linear space. Lets first recall
More informationCSE 135: Introduction to Theory of Computation NP-completeness
CSE 135: Introduction to Theory of Computation NP-completeness Sungjin Im University of California, Merced 04-15-2014 Significance of the question if P? NP Perhaps you have heard of (some of) the following
More informationMTAT Complexity Theory October 13th-14th, Lecture 6
MTAT.07.004 Complexity Theory October 13th-14th, 2011 Lecturer: Peeter Laud Lecture 6 Scribe(s): Riivo Talviste 1 Logarithmic memory Turing machines working in logarithmic space become interesting when
More informationAlgorithms & Complexity II Avarikioti Zeta
Algorithms & Complexity II Avarikioti Zeta March 17, 2014 Alternating Computation Alternation: generalizes non-determinism, where each state is either existential or universal : Old: existential states
More informationFriday Four Square! Today at 4:15PM, Outside Gates
P and NP Friday Four Square! Today at 4:15PM, Outside Gates Recap from Last Time Regular Languages DCFLs CFLs Efficiently Decidable Languages R Undecidable Languages Time Complexity A step of a Turing
More informationWelcome to... Problem Analysis and Complexity Theory , 3 VU
Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office: Inffeldgasse 16B/II, room IC02044 slides: http://www.ist.tugraz.at/pact17.html
More informationComputational Complexity
CS311 Computational Structures Computational Complexity Lecture 16 Andrew P. Black Andrew Tolmach 1 So, itʼs computable! But at what cost? Some things that are computable in principle are in practice intractable
More informationCS154, Lecture 17: conp, Oracles again, Space Complexity
CS154, Lecture 17: conp, Oracles again, Space Complexity Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string
More informationUmans Complexity Theory Lectures
Umans Complexity Theory Lectures Lecture 12: The Polynomial-Time Hierarchy Oracle Turing Machines Oracle Turing Machine (OTM): Deterministic multitape TM M with special query tape special states q?, q
More informationCOL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group
COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II 2015-16, Max 80, Time 2 hr Name Entry No. Group Note (i) Write your answers neatly and precisely in the space provided with
More informationPart I: Definitions and Properties
Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States
More informationComplexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes
Complexity Theory 1 Complexity Theory 2 Complexity Theory Lecture 3 Complexity For any function f : IN IN, we say that a language L is in TIME(f(n)) if there is a machine M = (Q, Σ, s, δ), such that: L
More informationSpace and Nondeterminism
CS 221 Computational Complexity, Lecture 5 Feb 6, 2018 Space and Nondeterminism Instructor: Madhu Sudan 1 Scribe: Yong Wook Kwon Topic Overview Today we ll talk about space and non-determinism. For some
More informationCSCI 1590 Intro to Computational Complexity
CSCI 1590 Intro to Computational Complexity Space Complexity John E. Savage Brown University February 11, 2008 John E. Savage (Brown University) CSCI 1590 Intro to Computational Complexity February 11,
More informationAn example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM
Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators
More informationTheory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable
Decidable Languages We use languages to represent various computational problems because we have a terminology for dealing with languages Definition: A language is decidable if there is an algorithm (i.e.
More informationCSCE 551 Final Exam, April 28, 2016 Answer Key
CSCE 551 Final Exam, April 28, 2016 Answer Key 1. (15 points) Fix any alphabet Σ containing the symbol a. For any language L Σ, define the language a\l := {w Σ wa L}. Show that if L is regular, then a\l
More informationReview of Basic Computational Complexity
Lecture 1 Review of Basic Computational Complexity March 30, 2004 Lecturer: Paul Beame Notes: Daniel Lowd 1.1 Preliminaries 1.1.1 Texts There is no one textbook that covers everything in this course. Some
More informationCOMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems
COMPLEXITY THEORY Lecture 17: The Polynomial Hierarchy Markus Krötzsch Knowledge-Based Systems TU Dresden, 19th Dec 2017 Review: ATM vs. DTM Markus Krötzsch, 19th Dec 2017 Complexity Theory slide 2 of
More informationDRAFT. Diagonalization. Chapter 4
Chapter 4 Diagonalization..the relativized P =?NP question has a positive answer for some oracles and a negative answer for other oracles. We feel that this is further evidence of the difficulty of the
More informationCSCI 1590 Intro to Computational Complexity
CSCI 1590 Intro to Computational Complexity Complement Classes and the Polynomial Time Hierarchy John E. Savage Brown University February 9, 2009 John E. Savage (Brown University) CSCI 1590 Intro to Computational
More information9. PSPACE 9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete
Geography game Geography. Alice names capital city c of country she is in. Bob names a capital city c' that starts with the letter on which c ends. Alice and Bob repeat this game until one player is unable
More information9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete
9. PSPACE PSPACE complexity class quantified satisfiability planning problem PSPACE-complete Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley Copyright 2013 Kevin Wayne http://www.cs.princeton.edu/~wayne/kleinberg-tardos
More information