You are on page 1of 3

Proofs

Big O

Def: f ( n ) is O ( g ( n ) ) if ∃ c ,k such that ∀ n ≥ k ,|f ( n )|≤ c∗|g ( n )|

Prove

By the definition of Big O, f(n) is O(thing) if f ( n ) ≤ c∗thing for some n≥ k .

Set n ≥ k=something∧c≥ f(n)/(thing), therefore f(n) is O(thing).

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

Def: f ( n ) is Ω ( g ( n ) ) if ∃c , k such that ∀ n≥ k ,|f ( n )|≥ c∗|g ( n )|

Prove

By the definition of Big Theta, f(n) is Θ (thing) if f ( n ) ≥ c∗thing for some n≥ k .

Set n ≥ k=something∧c ≤ f(n)/(thing), therefore f(n) is O(thing).

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

Def: f ( n ) is Θ ( g ( n ) ) if f ( n ) isO ( g ( n ) )∧f ( n ) is Ω ( g ( n ) )

Prove

By the definition of Big O, f(n) is O(thing) if f ( n ) ≤ c∗thing for some n≥ k .

Set n ≥ k=something∧c≥ f(n)/(thing), therefore f(n) is O(thing).

By the definition of Big Theta, f(n) is Θ (thing) if f ( n ) ≥ c∗thing for some n≥ k .

Set n ≥ k=something∧c ≤ f(n)/(thing), therefore f(n) is O(thing).

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

Base Case: when n=1, <thing> is true.

Let <thing> be true when n = k. We will prove that <thing> is true when n = k+1.

Work to show n= k+1 is true.

Thus by induction <thing> is true.

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

Problem from NP-Hard Problem

Certificate of Problem -> Certificate of NP-Hard Problem

Constraints -> Constraints

Constraint 1 -> Constraint 1

Ect.

Choices -> Choices


Choice 1-> Choice 1

Construct Poly-Time Reduction based on above

Certificate of Problem is a YES instance iff Certificate of NP-Hard Problem is a Yes instance

Certificate of Problem YES, implies Certificate of NP-Hard Problem YES

Build YES Certificate of Problem such that we find a YES Certificate of NP-Hard Problem

Certificate of NP-Hard Problem YES, implies Certificate of Problem.

Build YES Certificate of NP-Hard Problem such that we find a YES Certificate of Problem.

You might also like