Most active commenters
  • eviks(4)

←back to thread

190 points baruchel | 18 comments | | HN request time: 0.894s | source | bottom
Show context
zerof1l ◴[] No.44421424[source]
Here's the gist:

For nearly 50 years theorists believed that if solving a problem takes t steps, it should also need roughly t bits of memory: 100 steps - 100bits. To be exact t/log(t).

Ryan Williams found that any problem solvable in time t needs only about sqrt(t) bits of memory: a 100-step computation could be compressed and solved with something on the order of 10 bits.

replies(7): >>44422352 #>>44422406 #>>44422458 #>>44422855 #>>44423750 #>>44424342 #>>44425220 #
1. zombot ◴[] No.44422352[source]
> log(t)

log to what basis? 2 or e or 10 or...

Why do programmers have to be so sloppy?

replies(5): >>44422370 #>>44422485 #>>44422742 #>>44422905 #>>44422929 #
2. 12345ieee ◴[] No.44422370[source]
It doesn't matter in O() notation.
3. Tarq0n ◴[] No.44422485[source]
This is very common. Log without further specification can be assumed to be the natural log (log e).
replies(4): >>44422511 #>>44422753 #>>44422859 #>>44423290 #
4. griffzhowl ◴[] No.44422511[source]
In information theory it usually means log base 2
5. eviks ◴[] No.44422742[source]
Another reason is because base e notation is ln, not log
replies(2): >>44424223 #>>44424343 #
6. eviks ◴[] No.44422753[source]
no, that's what ln is for
replies(1): >>44427512 #
7. holowoodman ◴[] No.44422859[source]
No. Usually log without further specification is base10.

Except in mathematics and physics, where it usually is base e.

Except sometimes in computer science, where it can be base 2.

But there are more of those weirdnesses: "ld" can be "log decimal", so base 10; or "logarithmus dualis", so base 2. Base 2 is also sometimes written as "lb" (log binary). You really need to know the conventions of the field/subfield to know which is which.

replies(2): >>44424688 #>>44426960 #
8. anonymous_sorry ◴[] No.44422905[source]
It's not sloppiness, it's economy.

You can convert between log bases by multiplying by a constant factor. But any real-world program will also have a constant factor associated with it, depending on the specific work it is doing and the hardware it is running on. So it is usually pointless to consider constant factors when theorising about computer programs in general.

9. derbOac ◴[] No.44422929[source]
One answer, from a certain perspective, is that it's relative to your encoding base. It's logarithmic in operations, with the base depending on the encoding.
10. mort96 ◴[] No.44423290[source]
In this case, and in many other cases, log without further specification is meant to be understood as just "it is logarithmic" without further specification. With big O, we don't differentiate between log bases, just as we don't differentiate between scale factors. In fact, converting from one log base to another is just multiplying by a constant.
11. tempodox ◴[] No.44424223[source]
If only! The math libs I know use the name `log` for base e logarithm, not `ln`.
replies(1): >>44424277 #
12. eviks ◴[] No.44424277{3}[source]
hm, you're right, this unfortunatley proves the original point...
13. tzs ◴[] No.44424343[source]
It depends on the field.

For example in programming base e is more common. For example log is base e in C/C++, JavaScript, Java, Python, Perl, Mathematica, Fortran, and Rust.

Another example is number theory. I just checked a few number theory books from my library and most used base e: Hardy & Wright's "An Introduction to the Theory of Numbers", Apostol's "Introduction to Analytic Number Theory", Baker's "A Comprehensive Course in Number Theory", Ingham's "The Distribution of Prime Numbers", Baker's "Transcendental Number Theory", Ribenboim's "The Book of Prime Number Records", Kumanduri & Romero's "Number Theory with Computer Applications", and Niven's "Irrational Numbers".

The only number theory book I found using ln rather than log was Gelfond's "Transcendental & Algebraic Numbers".

replies(1): >>44424501 #
14. eviks ◴[] No.44424501{3}[source]
That confusion is unfortunate, thanks for checking the books!

Am now a bit curious as to what the country/scientific field table with most common log notation would look like as it seems there is indeed a lot of variance...

https://mathworld.wolfram.com/Ln.html

> The United States Department of Commerce recommends that the notation lnx be used in this way to refer to the natural logarithm (Taylor 1995, p. 33).

> Unfortunately, mathematicians in the United States commonly use the symbol logx to refer to the natural logarithm, as does TraditionalForm typesetting in the Wolfram Language

15. eru ◴[] No.44424688{3}[source]
Log without a basis (at least to me) usually indicates that the basis doesn't matter in this context (or is obvious).

I usually see either base e or base 2 as the default. In which applications do people use both logarithms and base 10 as the default? I mean, especially these day. In the olden days of the slide ruler base 10 was probably more common.

replies(1): >>44426557 #
16. holowoodman ◴[] No.44426557{4}[source]
> In which applications do people use both logarithms and base 10 as the default?

Engineering. For example dB is defined in base 10.

17. gbacon ◴[] No.44426960{3}[source]
Base 2 is also sometimes abbreviated lg.
18. thaumasiotes ◴[] No.44427512{3}[source]
Well, you're right that that's what "ln" is for. But more specifically "ln" is for indicating the natural log on calculators that already have another button labeled "log". Tarq0n is correct that "log" without further specification can be assumed to be the natural log.