Determine whether each of the functions 2n+l and 22n is O(2n).
Solution:
Step-1:
In this problem we need to determine whether each of the functions and
is
.
Note:
Let us consider f and g are functions from the set of integers to the set of real numbers.
The estimate value can be said that f(x) is O(g(x)) if there are constants C and k such that
, where C > 0 and x> k.The constants C and k are called the witnesses to the relationship.
The definition of f(x) is O(g(x)) says that f(x) grows slower than some fixed multiple of g(x) as x grows without bound.
Step-2:
Consider,
Now we have to show that
, since
.
Therefore , , where n > 1.
By using the above note , it is clear that C = 2, k = 1 and
Therefore , C = 2and k = 1 are witnesses for
Step-3:
Consider,
Now we have to show that
, since
.
For every power of , the term in p(n) has a power twice in value.
So,
Step-4:
Therefore , C = 2and k = 1 are witnesses for , and
.