7. TIME COMPLEXITY Flashcards

1
Q

How do we compute the running time of an algorithm Ð

A

As a function of the length of the string representing the input and don’t consider any other parameters.

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

What is asymptotic analysis?

A

One convenient form of estimation, where we seek to understand the running time of the algorithm when it is run on large inputs

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

The asymptotic notation is also called

A

big-O notation

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

Big-O notation has a companion called small-o notation. How does that work?

A

Big-O notation says that one function is asymptotically no more than another. To say that one func- tion is asymptotically less than another, we use small-o notation.

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

Polynomial time algorithms are fast enough for many purposes, but exponential time algorithms are rarely useful. Why is that ?

A

For example, let n be 1000, the size of a reasonable input to an algorithm. In that case, n^3 is 1 billion, a large but manageable number, whereas 2^n is a number much larger than the number of atoms in the universe.

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

Exponential time algorithms typically arise when we solve problems by exhaustively searching through a space of solutions, called ?

A

brute-force search.

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

All reasonable deterministic computational models are ?

A

polynomially equivalent.

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

What is P ?

A

P is the class of languages that are decidable in polynomial time on a deterministic single-tape Turing machine.

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

The class P plays a central role in our theory and is important because

A
  1. P is invariant for all models of computation that are polynomially equivalent to the deterministic single-tape Turing machine, and
  2. P roughly corresponds to the class of problems that are realistically solv-
    able on a computer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A verifier for a language A is an algorithm V , where

A

A = {w| V accepts ⟨w, c⟩ for some string c}.
We measure the time of a verifier only in terms of the length of w, so a polynomial time verifier runs in polynomial time in the length of w. A language A is polynomially verifiable if it has a polynomial time verifier.

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

What is a certificate, or proof, of membership in A ?

A

A verifier uses additional information, represented by the symbol c in Defini- tion 7.18, to verify that a string w is a member of A. This information is called a certificate, or proof, of membership in A.

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

What is NP ?

A

NP is the class of languages that have polynomial time verifiers.

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

The term NP comes from ?

A

nondeterministic polynomial time

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

A language is in NP iff it is decided by some nondeterministic polynomial time
Turing machine.

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

We define the nondeterministic time complexity class NTIME(t(n)) as

A

analogous to the deterministic time complexity class TIME(t(n)).

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

P

A

the class of languages for which membership can be decided quickly

17
Q

NP

A

the class of languages for which membership can be verified quickly.

18
Q

The question of whether P = NP is one of the greatest unsolved problems in theoretical computer science and contemporary mathematics.

A
19
Q

what are NP-complete problems

A

Certain problems in NP whose individual complexity is related to that of the entire class. If a polynomial time algorithm exists for any of these problems, all problems in NP would be polynomial time solvable.

20
Q

A Boolean formula is satisfiable if some assignment of 0s and 1s to the variables makes the formula evaluate to ?

A

1.

21
Q

A function f : Σ∗ −→ Σ∗ is a polynomial time computable function if some polynomial time Turing machine M exists that halts with just f (w) on its tape, when started on any input w.

A
22
Q

Language A is polynomial time mapping reducible,1or simply polynomial time reducible, to language B, written A ≤P B, if

A

a polynomial time computable function f : Σ∗ −→ Σ∗ exists, where for every w,
w ∈ A ⇐⇒ f ( w ) ∈ B .
The function f is called the polynomial time reduction of A to B.

23
Q

A language B is NP-complete if it satisfies two conditions:

A
  1. B is in NP, and
  2. every A in NP is polynomial time reducible to B.
24
Q
A
25
Q
A