Help understanding Logarithmic property in the proof to Big O problem

69 Views Asked by At

Here is the problem:

A sorting method with “Big-Oh” complexity O(n log n) spends exactly 1 millisecond to sort 1,000 data items. Assuming that time T (n) of sorting n items is directly proportional to n log n, that is, T (n) = cn log n, derive a formula for T (n), given the time T (N ) for sorting N items, and estimate how long this method will sort 1,000,000 items.

Here is the solution: enter image description here

Here is the part I don't understand:

Ratio of logarithms of the same base is independent of the base, hence, any appropriate base can be used in the above formula (say, base of 10).

I don't know what exactly does that mean. I researched the property but not much has made it clear. How came it's the same base, if it's upper case N vs lower case n?

Thank you.

1

There are 1 best solutions below

0
On

Remember the formula for base change:

$\begin{align*} x &= b^{\log_b x} \\ \log_a x &= \log_b x \cdot \log_a b \\ \end{align*}$

From this:

$\begin{align*} \log_b x &= \frac{\log_a x}{\log_a b} \end{align*}$

That is all they are saying.