
Computational Complexity; slides 4, HT 2019 Deterministic complexity classes Prof. Paul W. Goldberg (Dept. of Computer Science, University of Oxford) HT 2019 Paul Goldberg Deterministic complexity classes 1 / 27 Measuring Complexity Complexity Theory: Look at the fine structure of decidable languages. Goal: Classify languages according to the amount of resources needed to solve them. Resources: In this lecture we will primarily consider time { the running time of algorithms (steps on a Turingmachine) space { the amount of additional memory needed (cells on the Turing tapes) Paul Goldberg Deterministic complexity classes 2 / 27 Measuring Complexity Definition. Let M be a Turing acceptor and let S; T : N ! N be functions. 1 M is T -time bounded if it halts on every input w 2 Σ∗ after ≤ T (jwj) steps. 2 M is S-space bounded if it halts on every input w 2 Σ∗ using ≤ S(jwj) cells on its tapes. (Here we assume that the Turing machines have a separate input tape that we do not count in measuring space complexity.) Paul Goldberg Deterministic complexity classes 3 / 27 Important Complexity Classes: Time classes: S d PTIME := d2 DTIME(n ) polynomial time N d EXPTIME := S DTIME(2n ) exponential time d2N nd 2-EXPTIME := S DTIME(22 ) double exp time d2N Space classes: LOGSPACE := S DSPACE(d log n) d2N S d PSPACE := d2 DSPACE(n ) N d EXPSPACE := S DSPACE(2n ) d2N Deterministic Complexity Classes Definition. Let T ; S : N ! N be monotone growing functions. Define 1 DTIME(T ) as the class of languages L for which there is a T -time bounded k-tape Turing acceptor deciding L, for some k ≥ 1. 2 DSPACE(S) as the class of languages L for which there is a S-space bounded k-tape Turing acceptor deciding L, k ≥ 1. Paul Goldberg Deterministic complexity classes 4 / 27 Deterministic Complexity Classes Definition. Let T ; S : N ! N be monotone growing functions. Define 1 DTIME(T ) as the class of languages L for which there is a T -time bounded k-tape Turing acceptor deciding L, for some k ≥ 1. 2 DSPACE(S) as the class of languages L for which there is a S-space bounded k-tape Turing acceptor deciding L, k ≥ 1. Important Complexity Classes: Time classes: S d PTIME := d2 DTIME(n ) polynomial time N d EXPTIME := S DTIME(2n ) exponential time d2N nd 2-EXPTIME := S DTIME(22 ) double exp time d2N Space classes: LOGSPACE := S DSPACE(d log n) d2N S d PSPACE := d2 DSPACE(n ) N d EXPSPACE := S DSPACE(2n ) d2N Paul Goldberg Deterministic complexity classes 4 / 27 Do these classes depend on exact def of \Turing machine"? Yes, for DTIME(T ), DPSPACE(S); No for the others Indeed, usually don't need to be refer explicitly to \Turing machine". But watch out for nondeterminism (details later) But wait... Paul Goldberg Deterministic complexity classes 5 / 27 Yes, for DTIME(T ), DPSPACE(S); No for the others Indeed, usually don't need to be refer explicitly to \Turing machine". But watch out for nondeterminism (details later) But wait... Do these classes depend on exact def of \Turing machine"? Paul Goldberg Deterministic complexity classes 5 / 27 But wait... Do these classes depend on exact def of \Turing machine"? Yes, for DTIME(T ), DPSPACE(S); No for the others Indeed, usually don't need to be refer explicitly to \Turing machine". But watch out for nondeterminism (details later) Paul Goldberg Deterministic complexity classes 5 / 27 Alternative Definition: Sometimes PTIME is defined as [ PTIME := DTIME(O(nd )) d2N Time Complexity Classes Important Time Complexity Classes: PTIME := S DTIME(nd ) polynomial time d2N EXPTIME := S DTIME(2nd ) exponential time d2N Not quite so important: d 2-EXPTIME := S DTIME(22n ) double exp time d2N Note: Complexity classes are classes of languages. Time Complexity: PTIME ⊆ EXPTIME ⊆ 2-EXPTIME ⊆ · · · ⊆ i-EXPTIME ⊆ ::: Paul Goldberg Deterministic complexity classes 6 / 27 Time Complexity Classes Important Time Complexity Classes: PTIME := S DTIME(nd ) polynomial time d2N EXPTIME := S DTIME(2nd ) exponential time d2N Not quite so important: d 2-EXPTIME := S DTIME(22n ) double exp time d2N Note: Complexity classes are classes of languages. Time Complexity: PTIME ⊆ EXPTIME ⊆ 2-EXPTIME ⊆ · · · ⊆ i-EXPTIME ⊆ ::: Alternative Definition: Sometimes PTIME is defined as [ PTIME := DTIME(O(nd )) d2N Paul Goldberg Deterministic complexity classes 6 / 27 Linear Speed-Up Theorem. (Linear Speed-Up Theorem) ∗ Let k > 1 and c > 0 T : N ! N L ⊆ Σ be a language. If L can be decided by a T (n) time-bounded k-tape TM M := (Q; Σ; Γ; q0; δ; F ) 1 then L can be decided by a( c · T (n) + n + 2) time-bounded k-tape TM ∗ 0 0 0 0 0 M := (Q ; Σ; Γ ; q0; δ ; F ). Paul Goldberg Deterministic complexity classes 7 / 27 Linear Speed-Up Proof idea. LetΓ 0 := Σ [ Γm where m := d6ce. We construct M∗: Step 1: Compress M's input. Copy (in n + 2 steps) the input onto tape 2, compressing m symbols into one (i.e., each symbol correspondes to an m-tuple from Γm) Step 2: Simulate M's computation, m steps at once. 1 Read (in 4 steps) symbols to the left, right and the current position and \store" in Γ0 (using jQ × f1;:::; mgk × Γ3mk j extra states). 2 Simulate (in 2 steps) the next m steps of M (as M can only modify the current position and one of its neighbours) 3 M∗ accepts (rejects) if M accepts (rejects) (see Papadimitriou Thm 2.2, page 32) Paul Goldberg Deterministic complexity classes 8 / 27 Are there any tools by which we can show that a problem is in any of these classes but not in another? Are there any other interesting models of computation? Non-deterministic computation next part of course Randomised algorithms last part of course (time permitting) A Hierarchy of Complexity Classes? Questions: Can we always solve more problems if we have more resources? If not, how much more resources do we need to be able to solve strictly more problems? How do the complexity classes relate to each other? see later in the course. How do we classify “efficient” in terms of complexity classes? see next section Paul Goldberg Deterministic complexity classes 9 / 27 Are there any other interesting models of computation? Non-deterministic computation next part of course Randomised algorithms last part of course (time permitting) A Hierarchy of Complexity Classes? Questions: Can we always solve more problems if we have more resources? If not, how much more resources do we need to be able to solve strictly more problems? How do the complexity classes relate to each other? see later in the course. How do we classify “efficient” in terms of complexity classes? see next section Are there any tools by which we can show that a problem is in any of these classes but not in another? Paul Goldberg Deterministic complexity classes 9 / 27 A Hierarchy of Complexity Classes? Questions: Can we always solve more problems if we have more resources? If not, how much more resources do we need to be able to solve strictly more problems? How do the complexity classes relate to each other? see later in the course. How do we classify “efficient” in terms of complexity classes? see next section Are there any tools by which we can show that a problem is in any of these classes but not in another? Are there any other interesting models of computation? Non-deterministic computation next part of course Randomised algorithms last part of course (time permitting) Paul Goldberg Deterministic complexity classes 9 / 27 PTIME, usually called P Paul Goldberg Deterministic complexity classes 10 / 27 This turns out to be equivalent to PTIME. [ PTIME := DTIME(nd ) d2N PTIME serves as a mathematical model of “efficient” computation. Polynomial Time \Intuitive" definition of “efficient”: Any linear time computation is “efficient” Any program that performs “efficient” operations (e.g. linear number of iterations) and only uses “efficient” subprograms is “efficient”. Paul Goldberg Deterministic complexity classes 11 / 27 Polynomial Time \Intuitive" definition of “efficient”: Any linear time computation is “efficient” Any program that performs “efficient” operations (e.g. linear number of iterations) and only uses “efficient” subprograms is “efficient”. This turns out to be equivalent to PTIME. [ PTIME := DTIME(nd ) d2N PTIME serves as a mathematical model of “efficient” computation. Paul Goldberg Deterministic complexity classes 11 / 27 Different Models of Computation: 1 We can simulate t steps of a k-tape Turing machine with an equivalent 1-tape TM in t2 steps. 2 We can simulate t steps of a two-way infinite k-tape Turing machine with an equivalent standard k-tape TM in O(t) steps. 3 We can simulate t steps of a RAM-machine with a 3-tape TM in O(t3) steps. Vice-versa in O(t) steps. Consequence: PTIME is the same for all these models (unlike linear time) Robustness of the Definition If PTIME is to be the mathematical model of efficient computation, it should not depend on the exact computation-model we are using, or how we encode the input (within reason). Paul Goldberg Deterministic complexity classes 12 / 27 Consequence: PTIME is the same for all these models (unlike linear time) Robustness of the Definition If PTIME is to be the mathematical model of efficient computation, it should not depend on the exact computation-model we are using, or how we encode the input (within reason). Different Models of Computation: 1 We can simulate t steps of a k-tape Turing machine with an equivalent 1-tape TM in t2 steps. 2 We can simulate t steps of a two-way infinite k-tape Turing machine with an equivalent standard k-tape TM in O(t) steps.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages41 Page
-
File Size-