retagged by
763 views
0 votes
0 votes

If f (n), g(n) and h(n) are non-decreasing complexity functions.

if f(n) ∈ O(h(n)), what is the  relation between  f(n)  and (g ◦ h(n) + c), for any constant c ≥ 0, where a ◦ b is the composite function of a and b.

A  f(n)  ∈ O(g ◦ h(n) + c),

B  f(n)  ∈ $\Theta$(g ◦ h(n) + c),

C  f(n)  ∈$\Omega$(g ◦ h(n) + c),

D  none

?

retagged by

1 Answer

0 votes
0 votes

okk  ( // g is not multilpied it is composition of function ) 

 

suppose  h(n)  = 3n^2 + c.

f(n) belongs to O (h(n)) .

so O (h(n) ) can be n ^2 , n^3 etc.....

suppose i fix f(n) as n^3


now take function (g ◦ h(n) + c)

so The composition of functions f : A → B and g : B → C is the function
gof : A → C given by gof (x) = g(f (x)) ∀ x ∈ A

so g(h(n) ) =g ( 3n^2 +2 )  which is appox. g( n^2 ).

i take two cases when g(n) < h(n) and 2nd g(n) > h(n)

so suppose g(n) = n  then it is g(n) = n ^2 .now O(g(n)) can be n^2 can be n^3 etc. means go some where in n we get it in worst case. so  f(n) belongs to O ( g. h(n) )

suppose g(n) = n ^3 

then g(n^2) = n ^6 then g(n ) is n^6 and f(n) is n^2 here so f(n) < g(n).

so i think it is option b.

edited by
Answer:

Related questions

0 votes
0 votes
0 answers
1
aka 53 asked Nov 25, 2017
337 views
I wanted to know how θ is derived for a problem. Can we write it directly Example n^4 + n^3+ n^2 Here worst case will be n^4 since it is the term with highest power(wors...