Deterministic Complexity Measures: Time and Space Deterministic Time and Space Complexity Measures Definition Let M be any DTM with L(M) Σ, and let x Σ be any input. For the computation M(x), define the time function and the space function, denoted respectively by Time M and Space M, both of which map from Σ to N, as follows: Time M (x) = Space M (x) = m undefined if M(x) has exactly m + 1 configurations otherwise; number of tape cells in a largest configuration of M(x) if M(x) terminates undefined otherwise. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 1 / 22
Deterministic Complexity Measures: Time and Space Blum s Axioms Let ϕ 0,ϕ 1,ϕ 2,... be a fixed Gödelization (i.e., an effective enumeration) of all one-argument functions in IP, the class of all partial recursive (i.e., computable) functions. Let IR be the class of all total (i.e., everywhere defined) recursive functions. Let Φ IP be a function mapping from N Σ to N, and write Φ i (x) as a shorthand for Φ(i, x). We say that Φ is a Blum complexity measure if and only if the following two axioms are satisfied: Axiom 1: For each i N, D Φi = D ϕi. Axiom 2: The set {(i, x, m) Φi (x) = m} is decidable. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 2 / 22
Deterministic Complexity Measures: Time and Space Deterministic Time and Space Complexity Measures Definition (continued) Define the functions time M : N N and space M : N N by: max Time M (x) if Time M (x) is defined for x: x =n time M (n) = each x with x = n undefined otherwise; space M (n) = max Space M (x) if Space M (x) is defined for x: x =n each x with x = n undefined otherwise. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 3 / 22
Deterministic Complexity Measures: Time and Space Deterministic Time and Space Complexity Classes Definition Let t and s be functions in IR mapping from N to N. Define the following deterministic complexity classes with resource function t and s, respectively: DTIME(t) = A DSPACE(s) = A A = L(M) for some DTM M and, for each n N, time M (n) t(n) A = L(M) for some DTM M and, for each n N, space M (n) s(n) ;. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 4 / 22
Deterministic Complexity Measures: Time and Space Deterministic Time and Space Complexity Classes Remark: Note that a deterministic Turing machine M decides its language. If A = L(M) then both time M (n) and space M (n) are defined for each n N. In contrast, a nondeterministic Turing machine accepts its language. Thus, the nondeterministic case is treated slightly differently. The resource functions t and s in are called the names of DTIME(t) and DSPACE(s), respectively. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 5 / 22
Deterministic Complexity Measures: Time and Space Deterministic Time and Space Complexity Classes Remark: If M is a Turing machine with more than one tape, then Space M (x), the size of a largest configuration of M(x), is defined to be the maximum number of tape cells, where the maximum is taken both over all tapes and over all configurations in the computation. If there is a separate read-only input tape, then only the space used on the working tapes is to be taken into account (reasonable due to sublinear space functions such as logarithmic space). J. Rothe (HHU Düsseldorf) Kryptokomplexität I 6 / 22
Nondeterministic Complexity Measures: Time and Space Nondeterministic Time and Space Measures Definition Let M be any NTM with L(M) Σ, and let x Σ be any input. Let Time M (x,α) and Space M (x,α) denote the time and space functions for each path α in M(x). For the computation M(x), define the nondeterministic time and space function, denoted by NTime M and NSpace M, both of which map from Σ to N, as follows: min Time M(x,α) if x L(M) NTime M (x) = M(x) accepts on path α undefined otherwise; NSpace M (x) = min Space M (x,α) if x L(M) M(x) accepts on path α undefined otherwise. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 7 / 22
Nondeterministic Complexity Measures: Time and Space Nondeterministic Time and Space Measures Definition (continued) Let t and s be functions in IR mapping from N to N. We say that M accepts a set A in time t if for each x A, we have NTime M (x) t( x ), and for each x A, M does not accept x. We say that M accepts a set A in space s if for each x A, we have NSpace M (x) s( x ), and for each x A, M does not accept x. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 8 / 22
Nondeterministic Complexity Measures: Time and Space Nondeterministic Time and Space Complexity Classes Definition (continued) Define the following nondeterministic complexity classes with resource function t and s, respectively: NTIME(t) = A A = L(M) for some NTM M that accepts A in time t(n) ; NSPACE(s) = A A = L(M) for some NTM M that accepts A in space s(n). J. Rothe (HHU Düsseldorf) Kryptokomplexität I 9 / 22
Resource Functions Resource Functions Remark: It is reasonable to consider collections F of similar resource functions and to define the complexity class corresponding to F by DTIME(F) = DTIME(f) etc. f F Such a collection F contains all resource functions with a similar rate of growth. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 10 / 22
Resource Functions Resource Functions Remark: Consider the collections of functions mapping from N to N each: ILin contains all linear functions, IPol contains all polynomials, 2 ILin contains all exponential functions whose exponent is linear in n, and 2 IPol contains all exponential functions whose exponent is polynomial in n. More generally, for any function t : N N, define the collection of all functions linear in t (respectively, polynomial in t) by: ILin(t) = {f f = l t and l ILin}; IPol(t) = {f f = p t and p IPol}. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 11 / 22
Asymptotic Rate of Growth Asymptotic Rate-of-Growth Notation Definition For functions f and g mapping from N to N, define the following notation: f(n) ae g(n) to mean that f(n) g(n) is true for all but finitely many n N. Analogously, the notations < ae, ae, and > ae are defined. The subscript ae of ae, etc. stands for almost everywhere. Similarly, the notation f(n) io g(n) means that f(n) g(n) is true for infinitely many n N. Analogously, the notations < io, io, and > io are defined. The subscript io of io, etc. stands for infinitely often. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 12 / 22
Asymptotic Rate of Growth Asymptotic Rate-of-Growth Notation Definition For functions f and g mapping from N to N, define the following notation: f O(g) there is a real constant c > 0 such that f(n)+1 ae c (g(n)+1). f o(g) for all real constants c > 0, f(n)+1 < ae c (g(n)+1). J. Rothe (HHU Düsseldorf) Kryptokomplexität I 13 / 22
Asymptotic Rate of Growth Asymptotic Rate-of-Growth Notation Definition f g lim sup n f(n)+1 g(n)+1 <. Note that f O(g) f g. Intuitively, f g means that, by order of magnitude, f does not grow faster than g, with at most finitely many exceptions allowed. f g lim sup n f(n)+1 g(n)+1 = 0. Note that f o(g) f g. Intuitively, f g means that, by order of magnitude, g does grow strictly faster than f, with at most finitely many exceptions allowed. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 14 / 22
Asymptotic Rate of Growth Asymptotic Rate-of-Growth Notation Definition f io g lim inf n f(n)+1 g(n)+1 <. Intuitively, f io g means that, by order of magnitude, f does not grow faster than g, at least not for infinitely many arguments. f io g lim inf n f(n)+1 g(n)+1 = 0. Intuitively, f io g means that, by order of magnitude, g does grow strictly faster than f, at least for infinitely many arguments. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 15 / 22
Asymptotic Rate of Growth Asymptotic Rate-of-Growth Notation Definition Write f g for g f, f g for g f, f io g for g io f, and f io g for g io f. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 16 / 22
Some Central Worst-Case Complexity Classes Some Central Worst-Case Complexity Classes Space classes L = DSPACE(log) NL = NSPACE(log) LINSPACE = DSPACE(ILin) NLINSPACE = NSPACE(ILin) PSPACE = DSPACE(IPol) NPSPACE = NSPACE(IPol) EXPSPACE = DSPACE(2 IPol ) NEXPSPACE = NSPACE(2 IPol ) J. Rothe (HHU Düsseldorf) Kryptokomplexität I 17 / 22
Some Central Worst-Case Complexity Classes Some Central Worst-Case Complexity Classes Time classes REALTIME = DTIME(id) LINTIME = DTIME(ILin) P = DTIME(IPol) NP = NTIME(IPol) E = DTIME(2 ILin ) NE = NTIME(2 ILin ) EXP = DTIME(2 IPol ) NEXP = NTIME(2 IPol ) J. Rothe (HHU Düsseldorf) Kryptokomplexität I 18 / 22
Some Central Worst-Case Complexity Classes Polynomial versus Exponential Functions t(n) n = 10 n = 20 n = 30 n.00001 sec.00002 sec.00003 sec n 2.0001 sec.0004 sec.0009 sec n 3.001 sec.008 sec.027 sec n 5.1 sec 3.2 sec 24.3 sec 2 n.001 sec 1.0 sec 17.9 min 3 n.059 sec 58 min 6.5 years Table: Comparing some functions (Garey & Johnson 1979) J. Rothe (HHU Düsseldorf) Kryptokomplexität I 19 / 22
Some Central Worst-Case Complexity Classes Polynomial versus Exponential Functions t(n) n = 40 n = 50 n = 60 n.00004 sec.00005 sec.00006 sec n 2.0016 sec.0025 sec.0036 sec n 3.064 sec.125 sec.256 sec n 5 1.7 min 5.2 min 13.0 min 2 n 12.7 days 35.7 years 366 centuries 3 n 3855 centuries 2 10 8 centuries 1.3 10 13 centuries Table: Comparing some functions (Garey & Johnson 1979) J. Rothe (HHU Düsseldorf) Kryptokomplexität I 20 / 22
Some Central Worst-Case Complexity Classes What if the Computers Get Faster? t i (n) Computer 100 times 1000 times today faster faster t 1 (n) = n N 1 100 N 1 1000 N 1 t 2 (n) = n 2 N 2 10 N 2 31.6 N 2 t 3 (n) = n 3 N 3 4.64 N 3 10 N 3 t 4 (n) = n 5 N 4 2.5 N 4 3.98 N 4 t 5 (n) = 2 n N 5 N 5 + 6.64 N 5 + 9.97 t 6 (n) = 3 n N 6 N 6 + 4.19 N 6 + 6.29 Table: What if the computers get faster? (Garey & Johnson 1979) J. Rothe (HHU Düsseldorf) Kryptokomplexität I 21 / 22
Some Central Worst-Case Complexity Classes Time versus Space for Deterministic Classes Theorem 1 DTIME(t) DSPACE(t). 2 DSPACE(s) DTIME(2 ILin(s) ) if s log. Proof: See blackboard. J. Rothe (HHU Düsseldorf) Kryptokomplexität I 22 / 22