Math Fundamentals18 sections · 814 units
Open in Course

Why Bases Don't Matter in Big-O (Constant factor)

All logarithms are equivalent

In Big-O notation, we write O(logn)O(\log n) without specifying the base. Why? Because changing the base only multiplies by a constant.

From the change of base formula: log2(n)=log10(n)log10(2)3.32log10(n)\log_2(n) = \frac{\log_{10}(n)}{\log_{10}(2)} \approx 3.32 \cdot \log_{10}(n). The factor 3.323.32 is constant, and Big-O ignores constants.

So when you see O(logn)O(\log n) in algorithm analysis, the base is usually 22 (because of binary splits), but it doesn't matter for asymptotic analysis.