Time Complexity Flashcards

1
Q

Definition 5.1 (Time Complexity)

A

Let M be a deterministic decider, i.e. a deterministic TM that halts on all inputs. We define the running time or time complexity of M as the function f : N → N, such that f(n) is the maximum number of steps or transitions that M uses on any input of length n. In that case, we say that “M runs in time f(n)” or “M is an f(n) time Turing machine”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Definition 5.2 (Asymptotic Upper Bound)

A

Let f, g be functions of form f, g : N → R≥0. We say that
f(n) = O(g(n))

if there exists a real number c > 0 and an integer n0 > 0 such that for every integer n ≥ n0, we have

                         f(n) ≤ c g(n).

In this case we say that g(n) is an (asymptotic) upper bound for f(n).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Definition 5.3 (Exponential and Polynomial Bound)

A

Let f : N → R≥0 be given.

  For f(n) = O(n^p) (p ∈ N_0), f has a polynomial 
  bound.
   For f(n) = 2O(n^δ) (δ ∈ R≥δ), f has an exponential 
   bound.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Definition 5.4 (Check notes)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Definition 5.5 (Time complexity Class)

A

Let t : N → R≥0 be a function. The time complexity class, TIME(t(n)), is the set of all languages that are decidable by an O(t(n)) time single-tape deterministic Turing machine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Theorem 5.1 (Deterministic Equivalence)

A

Let t(n) be a function such that t(n) ≥ n. For every t(n) time (deterministic) multi-tape decider there exists an equivalent O(t^2(n)) time (deterministic) single-tape decider.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Definition 5.6 (Running Time)

A

Let N be a nondeterministic decider. The running time of N is the function f : N → N, giving the maximum number of steps f(n) that N uses on any
branch of its computation on any input of length n.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Theorem 5.2 (Nondeterministic Decider Equivalence)

A

Let t(n) be a function, such that t(n) ≥ n. For every t(n) time nonderministic single-tape decider there exists an equivalent 2^O(t(n)) time deterministic singletape decider.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Definition 5.7 (Class P)

A
The complexity class P is the set of all languages that are decidable in
polynomial time on a deterministic single-tape Turing machine, i.e.
P = U[k∈N0] TIME (n^k).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Theorem 5.3 (P)

A

We define the problem / language P AT H by
P AT H = {(G, s, t) | G is a directed graph that has a path from s to t} .
It holds P AT H ∈ P.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Definition 5.8 (Relatively Prime)

A

Let x, y be natural numbers. x and y are relatively prime, if it holds for their greatest common divisor (gcd)
gcd(x, y) = 1 .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Theorem 5.4 (RELPRIME)

A

We define the problem / language RELP RIME by
RELP RIME = {(x, y) | x and y are relatively prime} .
It holds RELP RIME ∈ P.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Theorem 5.5 (CFG and P)

A

It holds ACF G ∈ P, hence every context-free language is a member of P.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Definition 5.9 (nondeterministic time complexity class)

A

Let t : N → R≥0 be a function. The nondeterministic time complexity class, NTIME(t(n)), is the set of all languages that are decidable by an O(t(n))
time nondeterministic single-tape Turing machine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Definition 5.10 (The class NP)

A
) The complexity class NP is the set of all languages that are decidable in polynomial time by a nondeterministic single-tape Turing machine, i.e.
NP = U[k∈N0] NTIME (n^k).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Definition 5.11 (Verifier)

A

A verifier for a language A is a deterministic decider VA that takes as input hw, ci (w,c strings) such that it holds:
w ∈ A iff there exists c such that hw, ci is accepted by VA.
c is called certificate.

17
Q

Definition 5.12 (Polynomial Time V)

A

Let A be a language and VA be its verifier that takes the input hw, ci. We call VA polynomial time verifier if it has a polynomial running time in the size of w. Moreover A is called polynomially verifiable, if there exists a polynomial time verifier for it.

18
Q

Definition 5.13 (Alternative definition for NP)

A
NP is the class of languages for which
there exist polynomial time verifiers.
19
Q

Theorem 5.6

A

Let A be a language. There exists a polynomial time verifier for A if and only if there exists a nondeterministic polynomial time decider that recognizes A.

20
Q

Definition 5.14

A

Let G = (V, E) be a directed graph. A Hamiltonian path in G is a directed path that goes through each node exactly once.