2.5 Complexity and Asymptotic Analysis Flashcards
Why do we capture order of growth?
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
What is big o notation?
Abstract programs in terms of how fast their running time grows with respect to their input size
If g eventually dominates f…..
There exists k in N
∀(n:N) n>k → g(n) > f(n)
if O(g) is the set of functions associated with g is f in O(g) then.....
There exists C > 0 such that f is eventually dominated by C x g
f(n) ≤ Cg(n)
Properties of Big O
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)
What is a lower bound?
Any solution to that problem is at least that complex
Ω
What is an algorithmic gap?
The problem lower bound complexity is less than the current best algorithms upper bound complexity
What is space complexity?
Describes how much memory it requires to run. Often fixed. Often have more space than we have time.
What is P = NP
Can every problem verifiable in Polynomial time also be solved quickly in polynomial time.
What is a complexity class?
A set of functions with the same asymptotic complexity
Examples of problems in P?
Calculating GCD
Determining if a number if prime
Member of a context free grammar
Examples of problems in NP?
Boolean satisfiability
Factorisation into primes
Chinese postman
Graph colouring