I have an assignment that has to do with Big O notation and I just want to make sure if my solutions are right and if not why.
(a)Give an example of a function that is O(n^2018) but not O(n^2017).
my answer : T(n) = 5*n^2018 + 2 * n
(b) Show that the function T(n) = 5n^3 is not O(n^2 ).
my answer: Assume that T(n) is O(n^2). Then there are positive reals c and k such that n^3 ≤ c * n^2, for all n≥ k. Assume that n^2 is non-zero. Therefore, dividing by n^2 we will have n≤ c. This is going to fail for the values that are bigger than c. Thus, T(n) = n^3 is not O(n^2).
(c) Show that if T(n) = a*(n^2) + b*n + c for some integers a, b, c then T(n) = O(n^2 ).
my asnwer:
T(n) = a*(n^2) + b*n + c
≤ a*(n^2) + b*n + c*n
= a*(n^2) + n*( b + c)
≤ a*(n^2) + (n^2)*(b + c)
= (n^2) * ( a + b + c)
Thus, for all n≥ 1 , we have T(n) ≤ (n^2) * ( a + b + c) Hence T(n) is O(n^2).