Live data from Hacker News

The Lost Art of Logarithms

lostartoflogarithms.com

61–70 of 204 posts

Re: The Lost Art of Logarithms

#61

I found that looking at the original motivation of logarithms has been more elucidating than the way the topic is presented in grade-school. Thinking through the functional form that can solve the multiplication problem that Napier was facing (how to simplify multiplying large astronomical observations), f(ab) = f(a) + f(b), and why that leads to a unique family of functions, resonates a lot better with me for why lo…

I often wonder about this. I also believe that mathematical pedagogy strive to attract people that are very smart and think in the abstract like euler, and not operationally, meaning they will get it intuitively.

For other people, you need to swim in the original problem for a while to see the light.

Re: The Lost Art of Logarithms

#62
post #56

I feel frustrated that we cannot conceive of numbers like 10^80 (atoms in the universe) or 10^4000 (number configurations for a system with 4000 variables having 10 states each). Maybe there are superbrains out there in the universe that can do so.

I feel like I have a much better grasp of those numbers since I started using logarithms for mental maths: https://entropicthoughts.com/learning-some-logarithms

Re: The Lost Art of Logarithms

#64
post #44

Here's an logarithmic fact that I've made use of frequently: If X is a random variable having a uniform distribution between zero and one, then –ln( X )/ λ has an exponential distribution with rate λ . This relationship comes in handy when, for example, you want to draw weighted random samples. Or generating event times for simulations.

The general version of this is called inverse transform sampling [0], which uses the fact that for the cdf F of any random variable X the random variable Y = F(X) has a standard uniform distribution [1]. Since every cdf increases monotonically on the unit interval, every cdf is invertible [2]. So apply the inverse cdf to both sides of the previous equation and you get F^-1(Y) = X is distributed like X . Sampling from…

For the particular case of the exponential distribution we can go further. By taking advantage of the theory of Poisson processes, we can take samples using a parallel algorithm. It even has a surprisingly succinct SQL translation:

    SELECT *
    FROM Population
    WHERE weight > 0
    ORDER BY -LN(1.0 - RANDOM()) / weight
    LIMIT 100  -- Sample size.
Notice our exponentially distributed random variable on prominent display in the ORDER BY clause.

If you're curious, I explore this algorithm and the theory behind it in https://blog.moertel.com/posts/2024-08-23-sampling-with-sql....

Re: The Lost Art of Logarithms

#65
post #56

I feel frustrated that we cannot conceive of numbers like 10^80 (atoms in the universe) or 10^4000 (number configurations for a system with 4000 variables having 10 states each). Maybe there are superbrains out there in the universe that can do so.

I guess you have to define what you mean by "conceive". I'm not sure you can even conceive a number like 1,000, if you're talking about holding an intuitive visual understanding in your mind at once. Like, I can easily see 100 in my mind's eye as a 10x10 grid of circles. Even if I don't see each one clearly, I have a good sense of the 10 on each edge and the way it fills in. But ask me to imagine 10 of those side-by-…

My first cut at conceiving is to answer "how long would it take a really fast computer to count to that number". The answer for 10^4000 is still something like 10^3978 years. So, a still inconceivable time.

(100 tera-ops computer) [edited to correct calculation)

Re: The Lost Art of Logarithms

#66
Interesting insight why applying a log transform often makes data normally distributed: Pretty much all laws of nature are multiplications (F=ma, PV=nRT, etc). If you start with i.i.d random variables and multiply them, you get log-normal data by virtue of the central limit theorem (because multiplications are additions on a log scale; and the CLT is also somewhat robust to non iid-ness). Thinking of data as the result of a lot of multiplications of influential factors, we thus get a log-normal distribution.

Re: The Lost Art of Logarithms

#67
post #66

Interesting insight why applying a log transform often makes data normally distributed: Pretty much all laws of nature are multiplications (F=m a, P V=n R T, etc). If you start with i.i.d random variables and multiply them, you get log-normal data by virtue of the central limit theorem (because multiplications are additions on a log scale; and the CLT is also somewhat robust to non iid-ness). Thinking of data as the…

All data is linear when plotted on a loglog scale with a thick marker.

Re: The Lost Art of Logarithms

#68
post #24

Here's an logarithmic fact that I've made use of frequently: If X is a random variable having a uniform distribution between zero and one, then –ln( X )/ λ has an exponential distribution with rate λ . This relationship comes in handy when, for example, you want to draw weighted random samples. Or generating event times for simulations.

How long do I have to study math to understand this?

If you study calculus and introduction to probability theory, then you're ready to learn this. So the answer is about 2 years after high school.

Re: The Lost Art of Logarithms

#69
One of my favorite tricks in elementary school was to convince people I can calculate any logarithm for any number of their choosing.

> Me: Pick any number.

> Friend: Ok, 149,135,151

> Me: The log is 8.2

Of course I'm simply counting the number of digits, using 10 as the base, and guessing the last decimal point, but it certainly impressed everyone.

Re: The Lost Art of Logarithms

#70
post #18

Earlier quoted context omitted.

Good book indeed, just that I wouldn't use a book to look up Win32 API functions.

Oh, the hours I'd spend browsing through tech books back in the day... good times.

Yeah, a good tech bookstore was a golden way to spend an hour.
Post reply on HN