5: Complexity Flashcards

1
Q

Within which time and space complexities can you copy an input from an input tape to a working tape in a multi-tape TM? How could you improve this for the language 𝐿(0 ^ (2 ^ π‘š))?

A

Copying across would take DTIME(2𝑛 log2(𝑛)) and DSPACE(𝑛).
You could instead have a binary number to count the number of input symbols on the working tape, incrementing it every time you read a new input symbol. Since the language is a number of 0s equal to a power of 2, after reading them all the working tape will consist of a 1 and all 0s afterwards. This improves space complexity to DSPACE(log2(𝑛)) and time complexity to ??.

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

What is a computation resource? List 5.

A

An asset that enables computations of increased complexity and difficulty.
time; space; energy; the number of comparisons; the number of calls to an oracle.

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

How do you measure time and space complexity in TMs?

A

Time ≑ the number of transitions made by TM.

Space ≑ the number of tape cells touched by TM.

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

What is an instance of a problem?

A

An input word that falls within (the language of) a problem.

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

Consider a positive non-decreasing function 𝑓 ∢ N β†’ N, 𝐿 a language, L, (over some alphabet 𝐴),
and 𝑛 being the length of the input to f(n).
True/false: DTIME(𝑓 (𝑛)) > {𝐿 | 𝐿 is decided by some (deterministic) TM in at most 𝑓 (𝑛) transitions}

A

False. Here, DTIME(𝑓 (𝑛)) = {𝐿 | 𝐿 is decided by some (deterministic) TM in at most 𝑓(𝑛) transitions}

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

What is a complexity class?

A

A set of computing problems, grouped by the time and space complexities that they require to solve.

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

How do you mathematically define deterministic polynomial time complexities?

A

P = βˆͺ π‘˜β‰₯1 DTIME(𝑛^π‘˜)

So the union of all factors raised to some k where k >= 1

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

What does ∈^? mean?

A

A ∈^? B = whether A is an element of the set B. (?)

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

What are the consequences of the Time and Space Hierarchy Theorems

A
  • DTIME(n ^ 2) is strictly more powerful than DTIME(n)
  • DTIME(n ^ 1042) is strictly more powerful than DTIME(n ^ 1041)
  • If d > c >= 1, DTIME(n ^ d) is strictly more powerful than DTIME(n ^ c).
  • DTIME(n ^ Ο€) is strictly more powerful than DTIME(n ^ e) since Ο€ > e.
  • DSPACE(n * log(n)) is strictly more powerful than DSPACE(n).
  • DTIME(2 ^ n) is strictly more powerful than DTIME(n ^ 3)
  • Much more time (or space) means more problems solvable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens when adding a β€œlarge” amount of time and/or space?

A

Adding a β€œlarge” amount of time and/or space gives a strict hierarchy of complexity classes.

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

Let 𝑓 be a positive non-decreasing function 𝑓 ∢ N β†’ N
Let 𝐿 be a language (over some alphabet 𝐴),
and 𝑛 be the length of the input.
True/false: NSPACE(𝑓 (𝑛)) = {𝐿 ∣ There is some certificate 𝑐 such that 𝐿 is decided by a Deterministic TM which takes 𝑐 as additional input using at most 𝑓 (𝑛) additional tape cells}

A

True.

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

What is the Space Hierarchy Theorem?

A
Any increases in asymptotic space increases a system's computational power.
Let f(n) = o(g(n)), where f(n) is space-constructible.
Then DSPACE(g(n)) \ DSPACE(f(n)) β‰  βˆ…
So there are more problems that can be done in f(n) space that can't be done in g(n) space if f(n) is space-constructible and f(n) > g(n).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the big theta notation mean?

A
  • If 𝑓 (𝑛) = Θ(𝑔(𝑛)), then 𝑓 and 𝑔 are the same size
  • 𝑓 and 𝑔 are within a constant factor
  • 𝑓 = 𝑂(𝑔(𝑛)) and 𝑓 = Ξ©(𝑔(𝑛))
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Consider a positive non-decreasing function 𝑓 ∢ N β†’ N, 𝐿 a language, L, (over some alphabet 𝐴),
and 𝑛 being the length of the input to f(n).
True/false: DSPACE(𝑓 (𝑛)) > {𝐿 | 𝐿 is decided by some (deterministic) TM in at most 𝑓 (𝑛) tape cells}

A

False. Here, DSPACE(𝑓 (𝑛)) = {𝐿 | 𝐿 is decided by some (deterministic) TM in at most 𝑓 (𝑛) tape cells}

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

How can you relate time and space complexities?

A

NTIME(𝑓 (𝑛)) βŠ† DSPACE(𝑓 (𝑛))
AND
NSPACE(𝑓 (𝑛)) βŠ† βˆͺ𝑐DTIME(𝑐𝑓 (𝑛))

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

How can you relate Non-deterministic vs Deterministic Space?

A

Let𝑓 (𝑛) β‰₯ log 𝑛. Then

NSPACE(𝑓 (𝑛)) βŠ† DSPACE((𝑓 (𝑛))^ 2)

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

How can you mathematically relate NPSPACE and DSPACE?

A

PSPACE = βˆͺ π‘˜β‰₯1 DSPACE(𝑛^π‘˜)

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

When is 𝑇(𝑛) Ξ©(𝑓 (𝑛))?

A

There exist constants 𝑐 and a 𝑛0 > 0 such that for all 𝑛 > 𝑛0, 𝑇(𝑛) β‰₯ 𝑐 β‹… 𝑓 (𝑛). Intuitively, 𝑇(𝑛) grows no less than 𝑓 (𝑛) for large 𝑛. This is an asymptotic lower bound.

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

True/false: P problems βŠ‚ EXP problems.

A

True.

20
Q

When is 𝑇(𝑛) Θ(𝑓 (𝑛))?

A

There exist constants 𝑐1, 𝑐2, and a 𝑛0 > 0 such that for all 𝑛 > 𝑛0, 𝑐1β‹… 𝑓 (𝑛) ≀ 𝑇(𝑛) ≀ 𝑐2β‹… 𝑓 (𝑛). Intuitively,𝑇(𝑛) grows like 𝑓 (𝑛) for large 𝑛. This is an asymptotic tight bound.

21
Q

Prove NSPACE(𝑓 (𝑛)) βŠ† DSPACE((𝑓 (𝑛))^ 2)

A

??

22
Q

Prove NTIME(𝑓 (𝑛)) βŠ† DSPACE(𝑓 (𝑛))

A

??

23
Q

What is the Non-deterministic Space Hierarchy Theorem?

A
Let𝑓 (𝑛) = π‘œ(𝑔(𝑛)).
Then NSPACE(𝑔(𝑛)) \ NSPACE(𝑓 (𝑛)) β‰  βˆ…
24
Q

Let 𝑓 be a positive non-decreasing function 𝑓 ∢ N β†’ N
Let 𝐿 be a language (over some alphabet 𝐴),
and 𝑛 be the length of the input.
True/false: NTIME(𝑓 (𝑛)) = {𝐿 ∣ There is some certificate 𝑐 such that 𝐿 is decided by a Deterministic TM which takes 𝑐 as additional input using at most 𝑓 (𝑛) transitions}

A

True.

25
Q

What is the significance of all regular languages being DSPACE(1)?

A

Don’t need any more tape cells than those used by the input word. They’re recognised by DFAs, which have no memory and so can be turned into TMs that recognise the same language using tape cells only also used to take input.

26
Q

How can you define NTIME?

A

Let 𝑓 be a positive non-decreasing function 𝑓 ∢ N β†’ N
Let 𝐿 be a language (over some alphabet 𝐴),
and 𝑛 be the length of the input.
NTIME(𝑓 (𝑛)) = {𝐿 ∣ There is some certificate 𝑐 such that 𝐿 is decided by a Deterministic TM which takes 𝑐 as additional input using at most 𝑓 (𝑛) transitions}
AND
NTIME(𝑓 (𝑛)) = {𝐿 ∣ There is some nondeterministic TM 𝑀 such that for any word 𝑀 ∈ 𝐿, any computation path takes at most 𝑓 (𝑛) transitions}

27
Q

How can you define NSPACE?

A

Let 𝑓 be a positive non-decreasing function 𝑓 ∢ N β†’ N
Let 𝐿 be a language (over some alphabet 𝐴),
and 𝑛 be the length of the input.
NSPACE(𝑓 (𝑛)) = {𝐿 ∣ There is some nondeterministic TM 𝑀 such that for any word 𝑀 ∈ 𝐿, any computation path takes at most 𝑓 (𝑛) additional tape cells}
AND
True/false: NSPACE(𝑓 (𝑛)) = {𝐿 ∣ There is some certificate 𝑐 such that 𝐿 is decided by a Deterministic TM which takes 𝑐 as additional input using at most 𝑓 (𝑛) additional tape cells}

28
Q

What is diagonalisation, and Cantor’s diagonalisation method?

A

Diagonalisation is when you take a matrix or set, and build a new row in which every ith element is different from the ith element in the ith row (so complement of a bit if binary).
Cantor applied diagonalisation to show that the matrix of all infinite binary sequences is infinite (uncountable) since the new row from diagonalisation will be different from every other row. Assuming the set is countable, you should be able to enumerate all its elements as s0 to sn as described but the new row made by diagonalisation contradicts this as it is not in the set, proving the set of all binary sequences to be uncountable and infinite by proof by contradiction.

29
Q

What does it mean for a function to be time-constructible?

A

A function, f(n), is called time constructible if there is a TM, which given the string 1 ^ n as input stops, with f(n) on its tape (in binary) after f(n) transitions (time). If a function is o(n) then it cannot be time constructible.

30
Q

What is the proof for the Time Hierarchy Theorem?

A

??

31
Q

How do you mathematically define deterministic exponential time complexities?

A

EXP = βˆͺ π‘˜β‰₯1 DTIME(2^ (𝑛 ^ π‘˜))

So some factor raised to some variable in turn raised to some constant

32
Q

What is NPSPACE?

A

nondeterministic polynomial space complexity

33
Q

How are DSPACE and NSPACE related?

A

DSPACE(𝑓 (𝑛)) βŠ† NSPACE(𝑓 (𝑛))

34
Q

How are DTIME and NTIME related?

A

DTIME(𝑓 (𝑛)) βŠ† NTIME(𝑓 (𝑛))

35
Q

Why and how are the polynomial and exponential time complexity classes different?

A

In polynomial, the factor is raised to a constant k; in exponential, the factor is raised to a variable n that is itself raised to a constant k.

36
Q

How do you mathematically define deterministic logarithmic space complexities?

A

L = DSPACE(log 𝑛)

37
Q

Prove that P problems βŠ‚ EXP problems.

A

??

38
Q

How are the larger complexity classes related?

A
P ⊊ EXP
NP ⊊ NEXP
L ⊊ PSPACE ⊊ EXPSPACE
P βŠ† NP
PSPACE βŠ† NPSPACE
EXP βŠ† NEXP
39
Q

What is the Non-deterministic Time Hierarchy Theorem?

A
Let𝑓 (𝑛   1) log 𝑓 (𝑛   1) = π‘œ(𝑔(𝑛)).
Then NTIME(𝑔(𝑛)) \ NTIME(𝑓 (𝑛)) β‰  βˆ…
40
Q

How can you relate space and time, determinism and non-determinism?

A

DTIME(𝑓 (𝑛) βŠ† NTIME(𝑓 (𝑛)) βŠ† DSPACE(𝑓 (𝑛))
P βŠ† NP βŠ† PSPACE
AND
DTIME(𝑓 (𝑛)) βŠ† NTIME(𝑓 (𝑛)) βŠ† DSPACE(𝑓 (𝑛))
βŠ† NSPACE(𝑓 (𝑛)) βŠ† DTIME(2𝑂(𝑓 (𝑛)))
P βŠ† NP βŠ† PSPACE βŠ† NPSPACE βŠ† EXP

41
Q

Prove NSPACE(𝑓 (𝑛)) βŠ† βˆͺ𝑐DTIME(𝑐𝑓 (𝑛))

A

??

42
Q

How can you relate Nondeterministic vs Deterministic Time?

A

NP βŠ† EXP

P βŠ† NP

43
Q

Can you get additional power by adding a constant amount of time and/or space?

A

No.

44
Q

Can we relate complexity classes (time vs space)?

A

Yes, some.

45
Q

True/false: All regular languages are DSPACE(1).

A

True.