Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
679 views
in Technique[技术] by (71.8m points)

big o - Log and exponent conversion in Big Oh notation

I'm doing some basic Big-oh problems in class and when reading the answer key, I'm having trouble understanding these log conversions that my professor did. I'd appreciate it if someone could write out the steps.

  1. We are trying to show that formula and this is the first step formula which i dont understand
  2. we are showing that formula and the first step is formula
  3. We are showing formula and the first step is formula

Thank you!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

So, a logarithm is just the power you need to raise something to in order to get a certain value. Typically in computer science problems, we are raising 2 to some power (which is also called the base of the logarithm).

So, for example, the (base 2) logarithm of 8 is 3, because you need to raise 2 to the 3rd power to get 8.

A consequence of this is that for any number n, n = 2^(log n). Does that make sense? We know that log n is the power that you need to raise 2 to to reach n, so if you actually raise 2 to that power, you should get n.

So, for your first problem, you are starting with the expression n^(sqrt n). But we know that n = 2^(log n) so we are going to substitute this in for the first n, yielding (2^(log n))^(sqrt n), and by the rules of exponents, this means we can just multiply the two exponents together, yielding 2^(sqrt(n)log(n)) which is the first step you were shown.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...