Question

What does "lg" mean in the following phrase?

"... we ignore the least significant lg t bits of x when referring to Mt[x]." (Knuth, 2005, pp. 4-5).

From the context, it seems like "lg t" means "t -1" so that lg 2 would be 1 and lg 5 would be 4. That said, what is the strict meaning of "lg" here?

References

Knuth, D. E. (2005). The art of computer programming: Volume 1, fascicle 1 : MMIX, a RISC computer for the new millennium. Upper Saddle River, New Jersey: Addison-Wesley.

Was it helpful?

Solution 2

lg means log to the base 2.

i.e. lg(4) = 2, lg(2) = 1.

OTHER TIPS

"lg" is commonly used to represent base 2 logarithms but this is a misuse is propagated in a few computer science texts.

Logarithm abbreviations are governed by standards. The abbreviation "lg" is reserved under DIN (DIN 1302) and ISO standards (ISO-31-11, ISO 80000-2) for a logarithm base 10. Since "lg" is widely used in other science and engineering fields in this manner, no one should use "lg" to refer to a base 2 logarithm.

The correct abbreviation for base 2 logarithm is logarithmus binaris (the binary logarithm) is "lb," though some Germans still use "ld" (for logarithmus dualis).

One of the most popular texts misusing the abbreviation (Cormen et alli: Introduction to Algorithms) commits several other mathematical sins (such as misusing "asymptotic") that make it more difficult for students to connect the material to their precalculus and calculus courses.

References:

  1. Wikipedia - Binary Logarithm: Notation
  2. Guide for the Use of the International System of Units (SI) — NIST Special Publication 811, 2008 Edition — Second Printing
  3. Quantities and units – Part 2: Mathematical signs and symbols to be used in the natural sciences and technology

Probably logarithm of t with base 2.

The quoted passage refers to Knuth Vol. 1 [1]. Section 1.2.2 of this monumental work is entitled "Numbers, Powers, and Logarithms". Here's how Knuth explains his notation:

"One might expect that in computer work binary logarithms (to the base 2) would be more useful, since most computers do binary arithmetic. Actually, we will see that binary logarithms are indeed very useful, but not only for that reason; the reason is primarily that a computer algorithm often makes two-way branches. Binary logarithms arise so frequently, it is wise to have a shorter notation for them. Therefore we shall write , following a suggestion of Edward M. Reingold."

1: Knuth, The Art of Computer Programming, third edition, Addison-Wesley, 1997.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top