0
$\begingroup$

In the class we have something like for example

$\frac{2\log (n) }{ 2n}$

I think if we are going the change the log base from 2 to e, we would have

$\frac{1}{n}\cdot\frac{\ln(n)}{ \ln2}$

However, my professor always get an equivalent answer which is

$\frac{1}{\ln2}\cdot \frac{\ln(n)}{n}$

I know they are equivalent and I can obtain one from the other, but I am wondering if there is a way to get my professor's answer immediately for further calculation.

Thanks and please correct me if I am wrong.

  • 0
    is my edit correct?2017-02-25
  • 0
    "I know they are equivalent and I can obtain one from the other, but I am wondering if there is a way to get my professor's answer immediately for further calculation. " I do not understand the question. If you know they are equivalent, then if you know how to get one you know the other. $\frac 1a \frac bc = \frac 1c\frac ba$ is trivially obvious so what are you asking?2017-02-25

4 Answers 4

0

Are you seriously asking why $\frac 1n \frac {\ln n}{\ln 2} = \frac 1{\ln 2}\frac {\ln n} n$?

Is it not obvious that $\frac ab \frac cd = \frac ad\frac cb$?

Any rate $\log_b m = \frac {\log_k m}{\log_k b} = \frac 1{\log_k b}\log_k m$

because

if $\log_b m = x$ then $b^x = m$ so $(k^{\log_k b})^x = k^{x\log_k b} = m$. And so $x \log_k b = \log_k m$ and therefore $\log_b m = \frac {\log_k m}{\log_k b} = \frac 1{\log_k b}\log_k m$

  • 2
    No, I was not asking that. Even if I was, I would not be ashamed of my lack of understanding and/or my limited abilities. Anyhow, the question was already answered, and thanks for your contribution.2017-02-25
1

Hint: See the formula $$\log_a b=\frac{\ln(b)}{\ln(a)}=\frac{\lg(b)}{\lg(a)}$$ where all variables are assumed to be positive and $$a\ne 1$$

  • 0
    I am using the formula, and my professor does. Why do we get the same answer in a different format?2017-02-25
  • 0
    but $$2\log\left(\frac{n}{2n}\right)=2\log\left(\frac{1}{2}\right)$$ if $$n\ne0$$2017-02-25
  • 0
    if you meant $$\frac{\log_2 n}{n}$$ then we have $$\frac{1}{n}\frac{\ln(n)}{\ln(2)}$$2017-02-25
  • 0
    It's actually the second one. Thanks a lot, Dr. Sonnhard Graubner2017-02-25
1

For any two bases $a,b \in (0,\infty) \backslash \{1\}$ and any $x > 0$, to change the base from $b$ to $a$ you use the rule:

$\log_a(x) = \frac{\log_b(x)}{\log_b(a)}$

  • 0
    I am using the formula, and my professor does. Why do we get the same answer in a different format?2017-02-25
  • 1
    Perhaps your professor took several minor steps in succession without pausing two let you know that several minor steps were taken instead of one big step...2017-02-25
  • 1
    The first minor step would be: $\frac{2 \log_2 n}{2n} = \frac{ \log_2 n}{ n} = \frac{1}{n} \log_2 n$. The next minor step would be use of the base-change formula: $\frac{1}{n} \log_2 n = \frac{1}{n} \frac{\ln n}{ \ln 2}$, and the last minor step would be rearranging the factors in the denominator $\frac{1}{ \ln 2} \frac{\ln n}{n}$. My guess is that he swept over these minor steps with one action, making it seem like it was all one big step.2017-02-25
  • 0
    That's it. Thanks ! I thought I was doing something different. Thanks a lot.2017-02-25
  • 0
    No problem at all2017-02-25
1

To begin with, you and your professor evidently make the following simplification in the expression, as follows: $$\frac{2\log_2(n)}{2n} = \frac{\log_2(n)}{n}.$$ Now, what does it mean to divide by $n,$ as in this formula? Answer: it is multiplication by $\frac1n.$ So really you're just looking at two quantities, $\log_2(n)$ and $\frac1n,$ which are multiplied together.

Your analysis of the expression is perfectly OK. You recognize that it is actually $\frac1n \cdot \log_2(n),$ and you then replace $\log_2(n)$ by a known equal quantity.

But that is only one way to describe the change in base. You can just as well write $$ \frac{\log_2(n)}{n} = \log_2(n) \cdot \frac1n = \frac{1}{\ln(2)} \cdot \ln(n) \cdot \frac1n, $$ which you can then rewrite to get your professor's expression or something like yours.

But this is just an example of a more general observation, which is that $$ a \cdot (k\cdot x) = k \cdot (a\cdot x). $$ That is, if we have some product of quantities, such as $a\cdot y,$ and we want to use $x$ instead of $y$ in this formula, where $y = k\cdot x,$ we can either substitute $k\cdot x$ where $y$ appeared in the original product, or we can substitute $x$ for $y$ and then multiply the entire product by $k.$ The first way says that $a\cdot y = a \cdot (k\cdot x),$ while the second way says that $a\cdot y = k \cdot (a\cdot x).$

Once you understand why this is true, you may find it is sometimes convenient to make the substitution in the second way rather than the first way. If you do this often enough, it may become almost second nature to do this.

So it may be that your professor sees $\frac{\log_2(n)}{n}$ as a product involving $\log_2(n).$ Then, knowing that $$ \log_2(n) = \frac{1}{\ln(2)} \cdot \ln(n), $$ your professor may have used the "second way" of changing a product with $\log_2(n)$ into a product with $\ln(n),$ that is, $$ \frac1n \cdot \log_2(n) = \frac{1}{\ln(2)} \cdot \left( \frac1n \cdot \ln(n) \right). $$

That is just a guess; we cannot read your professors mind. But the fact that the two expressions (your answer and your professor's) are exactly the same quantity in every possible case should give you some assurance that either expression is a correct rewriting of the original expression.