TeXipedia

lg

Represents the logarithm with base 10, commonly used in computer science and mathematical calculations.

Overview

A specialized logarithmic function that appears frequently in complexity analysis, information theory, and scientific computations where base-10 calculations are preferred over natural or binary logarithms.

  • Essential in algorithm analysis, particularly when dealing with decimal-based operations
  • Common in numerical methods and engineering calculations where powers of 10 are relevant
  • Often used alongside other logarithmic functions like ln (natural log) and log₂ in comparative analysis
  • Particularly useful when working with scientific notation and order-of-magnitude calculations

Examples

Express the logarithm of a number in base 2.

lg(256)=8\lg(256) = 8
\lg(256) = 8

Show the relationship between logarithms in computational complexity analysis.

T(n)=O(nlgn)T(n) = O(n \lg n)
T(n) = O(n \lg n)

Demonstrate the change of base formula using lg.

log2(x)=lg(x)=ln(x)ln(2)\log_2(x) = \lg(x) = \frac{\ln(x)}{\ln(2)}
\log_2(x) = \lg(x) = \frac{\ln(x)}{\ln(2)}