ANSWER:
f(N) = O(g(N)) means that there exist positive constants c and n0 such that f(N) ≤ c * g(N) for all N ≥ n0
ANSWER:
We must demonstrate that there exist positive constants c and n0 such thatn2 ≤ c * n2 for all n ≥ n0Choose c = 1. Clearly n2 ≤ n2 holds for all values of n, so it certainly holds whenever n ≥ 1.
If we choose n0 = 1, we have demonstrated that there exist positive constants c = 1 and n0 = 1 such that
n2 ≤ c * n2 for all n ≥ n0
ANSWER:
We must demonstrate that there exist positive constants c and n0 such thatn2 + 1 ≤ c * n2 for all n ≥ n0Choose c = 2. Then
n2 + 1 ≤ 1 * n2holds whenever1 ≤ 1 * n2which is true for all n ≥ 1.If we choose n0 = 1, we have demonstrated that there exist positive constants c = 2 and n0 = 1 such that
n2 + 1 ≤ c * n2 for all n ≥ n0
ANSWER:
We must demonstrate that there exist positive constants c and n0 such thatk * n2 + 1 ≤ c * n2 for all n ≥ n0Choose c = k + 1. Since k is a positive constant certainly k + 1 is too. Then
k * n2 + 1 ≤ (k + 1) * n2holds whenever1 ≤ 1 * n2which is true for all n ≥ 1.If we choose n0 = 1, we have demonstrated that there exist positive constants c = k + 1 and n0 = 1 such that
n2 + 1 ≤ c * n2 for all n ≥ n0
ANSWER:
A counterexample is in this case a set of assignments to f, g and h so that f(n) = O(g(n)) and f(n) = O(h(n)) are both true but g(n) ≠ h(n)Pick f(n) = n2, g(n)= n3 and h(n)= n4.
We can show that f(n) = O(g(n)) and f(n) = O(h(n)) are both true. However, it is clearly the case that g(n) ≠ h(n).
ANSWER:
A counterexample is in this case a set of assignments to f, g and h so that f(n) = O(g(n)) and g(n) = O(f(n)) are both true but f(n) ≠ g(n)Pick f(n) = n2 and g(n)= n2+1.
We can show that f(n) = O(g(n)) and g(n) = O(f(n)) are both true. However, it is clearly the case that f(n) ≠ g(n).
ANSWER:
From f(n) = O(g(n)) we know that there exist positive constants c and r such thatf(n) ≤ c * g(n) ∀ n ≥ rFrom g(n) = O(h(n)) we know that there exist positive constants d and s such that
g(n) ≤ d * h(n) ∀ n ≥ sBoth inequalities will hold if n ≥ r and n ≥ s. We can therefore conclude that:
f(n) ≤ c * g(n) ≤ c * (d * h(n)) ∀ n ≥ max(r,s)Thus we have shown that there exist positive constants k = c*d and n0 = max(r,s) such thatf(n) ≤ k * h(n) ∀ n ≥ n0
ANSWER:
From f1(n) = O(g1(n)) we know that there exist positive constants c1 and n1 such thatf1(n) ≤ c1 * g1(n) ∀ n ≥ n1From f2(n) = O(g2(n)) we know that there exist positive constants c2 and n2 such that
f2(n) ≤ c2 * g2(n) ∀ n ≥ n2Both inequalities will hold if n ≥ n1 and n ≥ n2. We can therefore conclude that:
f1(n) f2(n) ≤ c1 * g1(n) * c2 * g2(n) ∀ n ≥ max(n1,n2)orf1(n) f2(n) ≤ c1 * c2 * g1(n) * g2(n) ∀ n ≥ max(n1,n2)