2.5 Complexity and Asymptotic Analysis Flashcards

1
Q

Why do we capture order of growth?

A

exact counts are complicated
it is necessary to consider many different cases
there is no easy way to analyse sub-components and combine
Different compilers might affect the results

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

What is big o notation?

A

Abstract programs in terms of how fast their running time grows with respect to their input size

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

If g eventually dominates f…..

A

There exists k in N

∀(n:N) n>k → g(n) > f(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
if O(g) is the set of functions associated with g
is f in O(g) then.....
A

There exists C > 0 such that f is eventually dominated by C x g
f(n) ≤ Cg(n)

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

Properties of Big O

A
f in O(f)
not necessarily symmetric
pre-order relation
O(1) ⊆ O(n)
O(n^m) ⊈ O(n^(m+1))
O(1) ⊈ O(log n) ⊈ O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a lower bound?

A

Any solution to that problem is at least that complex

Ω

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

What is an algorithmic gap?

A

The problem lower bound complexity is less than the current best algorithms upper bound complexity

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

What is space complexity?

A

Describes how much memory it requires to run. Often fixed. Often have more space than we have time.

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

What is P = NP

A

Can every problem verifiable in Polynomial time also be solved quickly in polynomial time.

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

What is a complexity class?

A

A set of functions with the same asymptotic complexity

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

Examples of problems in P?

A

Calculating GCD
Determining if a number if prime
Member of a context free grammar

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

Examples of problems in NP?

A

Boolean satisfiability
Factorisation into primes
Chinese postman
Graph colouring

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