Binary Logarithm

In mathematics, binary logarithm is the logarithm in the base 2 (log2n). Binary logarithm is frequently written lg n. It is the inverse function of the exponential function 2n. Binary logarithm is often used in computer science and information theory, because it is closely connected to the binary numeral system. The number of digits (bits) in the binary representation of a positive integer number n is the integral part of lg n + 1, i.e.
\lfloor \lg n\rfloor + 1.
In information theory, the definition of the amount of self-information and information entropy involves binary logarithm; this is needed because the unit of information, the bit, refers to information resulting from an occurrence of one of two equally probable alternatives. Binary logarithm also frequently appears in the analysis of algorithms. If we start with number n greater than 1, and repeatedly divide it by 2, the number of iterations needed to get a value at most 1 is again the integral part of lg n. This idea is used in the analysis of several algorithms and data structures. For example in binary search, the size of the problem to be solved is halved in each iterations, therefore roughly lg n iterations are needed to obtain a problem of size 1, which is solved easily in constant time. Similarly, a perfectly balanced binary search tree containing n elements has height lg n+1. However, the running time of an algorithm is usually expressed in big O notation, ignoring constant factors. Since log2 n = (1/logk 2)logk n, where k can be any number greater than 1, algorithms that run in O(log2 n) time also run in, say, O(log13 n) time. Base of a logarithm in expressions O(log n) or O(n log n) is thus not important. In other contexts, though, base of a logarithm needs to be specified. For example O(2lg n) is not the same as O(2ln n) because the former is equal to O(n) and later to O(n0.6931...). Algorithms with running time n lg n are sometimes called linearithmic. Some examples with running time O(lg n) or O(n lg n) include:
Compare: natural logarithm (Base e), common logarithm (Base 10)

 

<< PreviousWord BrowserNext >>
german battlecruiser gneisenau
list of people by name: gw gx
list of people by name: gy
list of people by name: gz
el caney
san juan hill
glucagon
rabbit proof fence (movie)
kassaman
immunosuppressive drug
injection
lactic acidosis
lipodystrophy
macrovascular disease
microvascular disease
pancreas transplant
peripheral vascular disease
proinsulin
peter north
amerika samoa
battle of nechtansmere
klystron tube
el gran carlemany
angola avante
fair antigua, we salute thee
custody and repatriation
gneisenau
hong kong museum of history
molecular clock
minister of foreign affairs (france)
list of ships of the german navies
atr
dillingen (district)
london and south western railway
tdk
pale rider
herapathite
london necropolis company
brookwood cemetery
potometer
grammy awards of 1966
grammy awards of 1967
ningbo
grammy awards of 1968