Hacker News new | ask | show | jobs
by Tangurena2 27 days ago
From an information theory perspective, the most efficient base for computations would be e (2.718). And trinary is closer than binary.
3 comments

I have an axe to grind. Radix economy makes a shallow argument when calculating the wrong per-digit information cost.

I need some functions to show what I mean. Calculate logarithms, calculate the number of digits, and convert a base-n unit of information into base-2 units of information. Finally, calculate the information cost: the number of digits, times the information needed per digit.

  import ln, floor
  define log := (num,base) -> ln(num) / ln(base)
  define digits := (num,base) -> floor(log(num,base) + 1)
  define tobits := (base) -> log(base,2)
  define infocost := (num,base) -> digits(num,base) * tobits(base)
  define infocost_wikipedia := (num,base) -> digits(num,base) * base
  define infocost_tbwtc := (num, base) -> (digits(num,base) - 1) * tobits(base) + tobits(base- 1)
https://www.desmos.com/calculator/1wfdtsuaav

I define a logarithmic per-digit information cost, following information theory. For example, 1 trit = log(3,2) bits. This results in no advantage for any base (in which case, choose base 2).

Wikipedia uses a linear per-digit information cost equal to the base. This holds when communicating options takes linear time (Wikipedia's example of a phone menu). This results in advantage for base e (in which case, choose base 3).

The video "The Best Way To Count" uses the logarithmic digit cost, and also notes that the leading digit carries less information (it excludes 0, like a IEEE floating point mantissa). This results in advantage for base 2.

Therefore, know the context to apply the right cost analysis!

https://en.wikipedia.org/wiki/Optimal_radix_choice

https://en.wikipedia.org/wiki/Talk:Optimal_radix_choice#Why_...?

https://en.wikipedia.org/wiki/Talk:Optimal_radix_choice#Bina...

https://youtu.be/rDDaEVcwIJM?t=701 timestamp 11:41

I still don't get what is being optimized for to get e as the answer
Optimizing for "radix economy", an argument that attempts to balance the digit cost against the choice of base. When the cost per digit equals the base, e turns out optimal. But when the cost per digit equals the digit's information content (bit, trit, etc; 1 trit = log(3,2) bits), all bases turn out about equal.

https://en.wikipedia.org/wiki/Optimal_radix_choice

True. Radix economy.