Professional Documents
Culture Documents
Big O
Prove
Disprove
Suppose f(n) is O(thing). Then there exists a c and k such that 0 ≤ f ( n ) ≤ c∗thing ∀ x ≥ k . But this implies
that f ( n ) / thing ≤ c. This fails for values of x that are greater than c. We have a contradiction, therefore
f(n) is not O(thing).
Omega
Prove
Disprove
Suppose f(n) is Θ (thing). Then there exists a c and k such thatc∗thing≤ f ( n ) ≤ 0 ∀ x ≥ k . But this implies
that f ( n ) / thing ≥ c. This fails for values of x that are smaller than c. We have a contradiction, therefore
f(n) is not Θ (thing).
Theta
Prove
Because f(n) is Big O and Big Theta, f(n) is Big Omega by definition.
Disprove
Suppose f(n) is O(thing). Then there exists a c and k such that 0 ≤ f ( n ) ≤ c∗thing ∀ x ≥ k . But this implies
that f ( n ) / thing ≤ c. This fails for values of x that are greater than c. We have a contradiction, therefore
f(n) is not O(thing).
OR
Suppose f(n) is Θ (thing). Then there exists a c and k such thatc∗thing≤ f ( n ) ≤ 0 ∀ x ≥ k . But this implies
that f ( n ) / thing ≥ c. This fails for values of x that are smaller than c. We have a contradiction, therefore
f(n) is not Θ (thing).
Recursion/Backtracking/Dynamic Programming
Let <thing> be true when n = k. We will prove that <thing> is true when n = k+1.
Greedy
Consider an optimal solution {P_1, … , P_m} that differs from the greedy solution {G_1, … ,G_l}. Suppose
G_i is the first <thing> that greedy chose that does not appear in the optimal solution. (This exists
because l <= m). If no <thing> in the set of P_i’s does <thing2>, {P_i} is not optimal. If P_j does <thing3>
than greedy would have picked P_j instead of G_i. So I can replace P_j with G_i without conflict. Thus by
induction the set of P_is can be transformed to a set of G_is of size k, greedy is optimal.
NP-Complete by Reduction
Image
Ect.
Certificate of Problem is a YES instance iff Certificate of NP-Hard Problem is a Yes instance
Build YES Certificate of Problem such that we find a YES Certificate of NP-Hard Problem
Build YES Certificate of NP-Hard Problem such that we find a YES Certificate of Problem.