Question & Answer: Prove or disprove: a) f(n) = 2^n + 1 = O(2^n) b) f(n) = 2^n + 1 = theta (2^n) c) f(n) = 2^2n = O(2^n) d) f(n) = 2^2n = theta (2^n)…..

4. Prove or disprove : a) f(n) 2+1-0(22) b) f(n) = 2n+1=Θ(2) c) f(n) = 22n=0(2) d) f(n) 2272-0(2) 22 eCC22 r2222 Pffff b) c) d)ONLY DO PART C AND D

Expert Answer

 Part c is incorrect, hence need to be disproved.

c) f(n) = 2^2n = O(2^n)

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Prove or disprove: a) f(n) = 2^n + 1 = O(2^n) b) f(n) = 2^n + 1 = theta (2^n) c) f(n) = 2^2n = O(2^n) d) f(n) = 2^2n = theta (2^n)…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

Big O describes an upper limit on the growth behaviour of a function, for example the runtime of a program, when inputs become large. So for function f(x) = log(n), or f(x) = n, both are O(n^2), because both are always smaller than n^2. This is due to the fact that Big O notation gives us the upper bound, which need not to be the just greater than the exact function.

Hence for Part c, we can see easily that 2^2n is always greater than 2^n, hence f(n) can’t be O(2^n) in any case.

Similarly for part D, it is correct.

for Theta notation, the function gives us the lower bound, which means for f(n) = log(n) or f(n) = n, for both, the lower bound can be theta(1), because 1 is always lesser than log(n) or n;

So for part d, as 2^n is always lesser than 2^2n, hence we can safely say that

f(n) is theta(2^n).

Still stressed from student homework?
Get quality assistance from academic writers!