in Algorithms retagged by
312 views
0 votes
0 votes
When can i used logarithms to compare two functions asymptotically?

What is the procedure and rules?

If we have n^2 ans n^3..if we compare using logarithms..thwn they tuen out to be asymptotically equal.should i then compare them by "not" ignoring the constant terms?.
in Algorithms retagged by
312 views

1 Answer

1 vote
1 vote

Remember befor apllying log cancle common terms in funtions. otherwise it leads wrong answer.

Example: n3 , nso on take log both given O(logn). 

But correct method is cancle common terms = n2 then take see n s always greter than 1 so n3 is greater than n2.

3 Comments

If there is no common factor..even then can i get a case where log comparision wont work ?
0
0

if you talk about 2n and 3n since it is seen 3n  is always greater than appling log is wrong

give me case i will tell u based on that how we do .

0
0
I dont have. Case..i just wanted to know the general way of solving usimg logarithms.

So if i get 2 functions as asymptotically equal in logarithms..then should i discard solving it and use another approach?..or should i consider the value of constants as well.

For ex..for 2^n and 3^n...on applying log..we get log2*logn...and log3*logn...so in this case..should solve usingsome.other method?..or sincr log2<log3..i should consider 2^n as O(3^n)

?
0
0