|
|
Subject:
big oh notation
Category: Computers > Algorithms Asked by: seurhe-ga List Price: $2.00 |
Posted:
02 Sep 2003 21:49 PDT
Expires: 02 Oct 2003 21:49 PDT Question ID: 251660 |
Is lg x=O(ln x) ? Is ln x=O(lg x)? here lg means log with base 2 ln means log with base e and O is big oh notation |
|
Subject:
Re: big oh notation
Answered By: livioflores-ga on 02 Sep 2003 23:13 PDT |
Hi seurhe!! Let me start with a definition: Let n be the size of the input and f (n), g(n) be positive functions of n: f(n) = O(g(n)) is equivalent to say "There exist positive constants x and k such that for all n>k, f(n) =< x*g(n)" One of the properties of the logarithms is: log-a(n) = log-b(n) / log-b(a) Here log-a(n) means logarithm with base a of n. Then we have: lg(n) = ln(n)/ln(2) = (1/ln(2)).ln(n) = c1.ln(n); then lg(n) is O(ln(n)) Also ln(n) = lg(n)/lg(e) = (1/lg(e)).lg(n) = c2.lg(n); then ln(n) is O(lg(n)). In cases like that we say that lg(n) is big-theta of ln(n). For reference about that visit the following page from Everything2.com: "Big-oh notation": http://www.everything2.com/index.pl?node=Big-oh%20notation I hope this helps you. Please,if you find this answer unclear, request an answer clarification before rate this answer. Best regards. livioflores-ga | |
| |
|
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |