2 2 votes It answer is given as A but according to me answer should be C. Please help Algorithms algorithms time-complexity asymptotic-notations + – I_am_winner 1.7k views answer comment Share Follow Print See all 12 Comments 12 12 Comments reply sakharam commented Sep 6, 2018 reply Follow flag f(n)=1/n g(n)=1 f(n)<*g(n) 21/n>=1 0 0 replyShare Swapnil Naik commented Sep 6, 2018 reply Follow flag For x <= y, I can write nx = O(ny) . eg n2 = O(n3 ) also for '=' --- n2 = O(n2 ) according to Big-O definition. Definition of Big-O says f(n) <= cg(n) for c>0 and n>n0 , then I can write f(n) = O(g(n)), Hence I can say first one is true. Statement 2 is True, it's a property. Even we can apply log on both sides. Hence, both statements are true and answer should be C. 0 0 replyShare Magma commented Sep 6, 2018 reply Follow flag sakharam please elaborate more ! 0 0 replyShare Shaik Masthan commented Sep 6, 2018 reply Follow flag @Swapnil Naik it's a property. Even we can apply log on both sides. can you provide some reference 0 0 replyShare Swapnil Naik commented Sep 6, 2018 reply Follow flag According to the example given by Dharmendra I am sure that property is false. I thought it's true because we can take log on both sides like how we find a function which has greater complexity, but later I realized even that is not true https://gateoverflow.in/91704/asymptotic-complexity Please correct me If I am wrong if f(n) = O(g(n)) then I) 2f(n) = O(2g(n)) II) log(f(n)) = O(log(g(n))) These both statements are false right? 0 0 replyShare Magma commented Sep 6, 2018 reply Follow flag f(n) = O(g(n)) => f(n) <=g(n) [ means f(n) should be g(n) or less than g(n) ] [1 ,2, 3, 4 .........g(n) max ] =>f(n)/g(n) <=1 2f(n) = O 2g(n) 2f(n) <= 2g(n) 2f(n)-g(n) <=1 20 <= 1 [when f(n) = g(n)] 2-1 <=1 [when f(n) = g(n)-1] 2-2 <=1 [when f(n) = g(n)-2] ...... 21-g(n) <=1 therefore, condition is hold true option C is right 0 0 replyShare Shaik Masthan commented Sep 6, 2018 reply Follow flag @Magma https://math.stackexchange.com/questions/1482733/big-o-if-fn-ogn-prove-2fn-o2gn @Swapnil Naik https://cs.stackexchange.com/questions/42764/if-fn-ogn-then-is-logfn-ologgn 2 2 replyShare srestha commented Sep 7, 2018 reply Follow flag @Shaik Here answer should be D) rt? because take counter in 1) take n=1/x if x=2 and y=3 then $\frac{1}{x^{2}} >\frac{1}{x^{3}}$ 0 0 replyShare Shaik Masthan commented Sep 7, 2018 reply Follow flag @srestha, mam you can't substitute something in place of n given that, if 0 ≤ x ≤ y then nx = O(ny) --------------- give such x,y which is false. 0 0 replyShare I_am_winner commented Sep 7, 2018 reply Follow flag can you give some example in against of 2 statement 0 0 replyShare srestha commented Sep 7, 2018 reply Follow flag @Shaik why n cannot be substituted? 0 0 replyShare Shaik Masthan commented Sep 7, 2018 reply Follow flag mam, you are inversing the n ===> for getting correct result, your result should be inverse 0 0 replyShare Please log in or register to add a comment.
0 0 votes we know statement 1 is true. statement 2: f(n)=2n g(n)=n then f(n)=O(g(n)) but 2f(n) $\neq$ O(2g(n)) i.e. Answer : A Dharmendra Lodhi answered Sep 6, 2018 Dharmendra Lodhi comment Share Follow See 1 comment 1 1 comment reply himanshu19 commented Sep 7, 2018 reply Follow flag This looks good 0 0 replyShare Please log in or register to add a comment.