Comment

Comment by jetrink

The "area" that you want to minimize is the number of digits, d, times the base, b.

    A = d * b
d is roughly equal to the log of the number represented, N, base b.

    d ~= ln(N)/ln(b)
Substituting,

    A ~= b * ln(N) / ln(b)
Take the derivative of the area with respect to b and find where the derivative is zero to find the minimum. Using the quotient rule,

    dA/db = ln(N) * (ln(b)*1 - b/b) / ln(b)^2

    0 = ln(N) * (ln(b) - 1) / ln(b)^2

    0 = ln(b) - 1

    ln(b) = 1

    b = e
I hope I got that right. Doing math on the internet is always dangerous.
parent jetrink 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton