You say «You need at least lg (n!) + O(1) bits of information to discover this number, and therefore need at least lg (n!) + O(1) comparisons to do the sort».

But, for example, we can check that array is sorted in n-1 comparisons, which means that some permutations can be “discovered” in O(n) comparisons, not in O(n × lg(n)) as stated. And who knows, may be some other permutations need maximum possible n×(n-1) / 2 = O(n^2) comparisons to discover.

The problem come from statement «A binary comparison gives you one bit of information». I think that is wrong, because the amount of information the comaprison gives you depends on comparisions you done before.

]]>I am curious as to why people don’t like the ln notation; It could be my Asperger’s talking, but explicit seems better then implicit to me.

]]>But isn’t this equation true for ALL x ? Independent of whatever x may represent.

]]>However, this is not a case of an advanced source writing “log” and implicitly meaning log_10. This is what I’m claiming essentially never happens.

]]>TAOCP V1 p 23 where it’s defined, or any of the appendix B ‘Index to notations’. ]]>

Aside from Excel macros, every programming language I know of uses “log” to mean natural log. And so does every **advanced** math book I can recall.

I have occasionally seen ln for natural log; I saw it a couple weeks ago in an article written for an undergraduate audience. But I have never seen a math article that writes “log” and assumes the reader knows that the author intends this to mean log_10. On the other hand, I often see things like “log(1 + x) ≈ x for small x” which implies natural logs.

Numerous people have commented that they learned to use “log” for log_10, that’s it’s common in their country or profession, etc. But nobody has cited an advanced math source that makes this implicit assumption.

]]>Growing up in the South in the U.S., we used “ln” for base-e, and “log” for either base 10 or base 2. This appears to be pretty common. I have worked with people all over the world since then, and I haven’t run into any trouble or confusion with these conventions.

It’s true that this approach means that “log” is ambiguous. In this case that’s a good thing. It means that each author can pick the convention that works best for what they are working on, rather than people using the “wrong” convention having to noise up their formulas with a bunch of constants.

]]>Yes I think the debate here is really about national conventions, I’m also a PhD, also from the Ecole Normale Supérieure in Paris (I remind you that Americans are still measuring sticks with inches…) and in France we actually consider poor education to use `log` without subscript (as the log without base is only defined up to a constant, as it was remarked), and we will always use `ln` to denote the natural logarithm.

]]>In the interest of consistency (“use what makes the most sense”) then you should define Pi as 3.283….

It fits much more naturally into the world of logs of e and radian measurement.

]]>I guess national specifics does have a role. E.g. in former USSR countries:

log is for any base

lg is for base 10

ln is for base e

On my scentific calculator (made in China, obviously), there are separate buttons which are marked as follows:

log_a so that one could specify any base,

log for base 10

ln for base e

The Wikipedia article about the decadic logarithm says this:

On calculators it is usually “log”, but mathematicians usually mean natural logarithm rather than common logarithm when they write “log”. To mitigate this ambiguity the ISO specification is that log_10(x) should be lg (x) and log_e(x) should be ln (x).

I admit I don’t do math daily but I would stick with these standards so as not to complicate things.

]]>Actually, g, the number of comparisons required to sort n items using only binary comparisons is n lg n plus low order terms, not n ln n.

This follows from basic information theory. You are trying to “discover” a number between 1 and n!. A binary comparison gives you one bit of information. You need at least lg (n!) + O(1) bits of information to discover this number, and therefore need at least lg (n!) + O(1) comparisons to do the sort.

It’s then a matter of using Stirling’s approximation or something similar to get this in whatever form you need:

lg (n!) + O(1) = n lg n + O(n) = (1 + o(1)) n lg n

]]>Elementary math books often use log as you say, in English speaking countries and around the world. But I have never seen a mathematics journal article, for example, that writes “log” and implicitly means “log_10″.

]]>As far as I know your statement “(log log base 10) is the UNIVERSAL convention in advanced mathematics.” is true only if the UNIVERSAL is equivalent to “english speaking world”.

]]>I read several times in my undergrad math/chem/biol/physics books about how X was the supreme achievement of the human mind…..

Respectfully, take a chill pill here – what matters, at least for the 98% of non math majors, is that the world have a consistent and universally applied standard; it doesn’t matter all that much what it is.

In my world, biology, Log = base10 and Ln= base 2 or e

please, why don’t you get together with the guys who think differently, toss a coin, and decide on a standard.

That doesn’t mean there are no situations in which other bases might be preferable, of course, but it isn’t at all the case that the only reason anyone has for preferring natural logs is that they make calculus nicer.

]]>I have a PhD and I am an alumni of Ecole Normale Superieure from Paris. you know, this school with eleven Fields medals.

I guess I qualify as having done math past basic calculus.

Note that even wikipedia entry on logarithm uses ln for log_e

What seems clear is that (as often) US have a different convention than the rest of the world.

]]>In computer science of course you just say “log”, without reference to the base, because all logs have the same big-O behavior due to that handy proportionality fact John referenced.

If you’re reporting big-O behaviour, you just say “log”. However, this is only a small part of computer science.

Big-O makes sense for reporting the time that an algorithm theoretically takes, because faster computers are always being produced. Of course, constant factors actually matter; Sedgewick points out that something like 80% of algorithms published in SODA are “galactic algorithms”, in the sense that they are asymptotically faster than the algorithms used today, but the constant factors mean that the speedup will only be realised if you feed it a galaxy’s worth of data.

However, space requirements are a different matter. A bit can be (and regularly is) made physically smaller, but they can’t be theoretically smaller.

Information theory gives us hard limits on how many bits are required to transmit a member of a family of data structures across a communications channel. Transmitting the number N, for example, *requires* lg N + O(1) bits. The low-order terms are “within a constant factor”, but the high order terms are not.

You can halve the amount of time it takes to transmit, and you can halve the physical size of a container to store it in, but you can’t reduce the number of bits.

And that’s why the base of logarithms still matters in computer science.

]]>