Mr. Isulo, a famous alien computer scientist, has designed efficient
algorithms to solve two problems whose solutions will help the Martian government preserve the color of their home planet: • One algorithm performs n^4 + 3n^2 + 5 steps, where n is the size of the algorithms' input. • The other algorithm performs 2n^2 + 10 steps, where n is the size of the algorithms' input.
Help Mr. Isulo convince the Martian government to pay him for his work by formally proving the following two theorems.
Recall that f ∈ O(g) if ∃n0 ∈ N ∃c ∈ R+ ∀n ∈ N, n ≥ n0 →f(n) ≤ cg(n).
a. [8 marks] n^4 + 3n^2 + 5 ∈ O(n^4 ).
b. [8 marks] 2n^2 + 10 ∈ O(3n^2 + 7n). Hint: first choose a value of c that you think will work, and once you have c do some algebra to determine how to choose n0.
303,122 students got unstuck by Course
Hero in the last week
Our Expert Tutors provide step by step solutions to help you excel in your courses