Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would prefer base-12; it has a lot of benefits. See http://en.wikipedia.org/wiki/Duodecimal, especially http://en.wikipedia.org/wiki/Duodecimal#Comparison_to_other_...

Instead of changing our clocks, we could just change our numbering system. Having 50 (that's 5 x 12) seconds per minute, 50 minutes per hour, and 20 hours per day seems perfectly reasonable.



I'd like to use base-11. Prime numbered bases eliminate lots of special cases.


Choosing a radix is a balance between the number of prime factors (and brevity) and the number of symbols to keep track of. I think twelve strikes a good balance as well.


In that case 3 is your number. (Because it's the closest number to e, 2.71)

There is a currency based on it (with the provably least number of coins necessary to make any kind of change), ternary logic, balanced ternary is especially cool, etc.


Why is being close to e a good thing?


Actually, the best number depends. Basically, you want to have as few operations as possible, but you also want them easy.

Having base b for number n, you need log_b n digits where each digit is an element of (0..b-1). So working on those representations takes something like f(log_b n, b) operations. Where the function f depends on the operation you are looking at.

A good base should keep f small in relation to all n.

One very natural choice for f, I can't remember which at the moment, leads to e being the best base in theory---so 3 being good in practice.

If you are working with something like trees on disk (yes, data structures are very intimately related to numbering systems---read Okasaki's Purely Functional Data Structures for more information) a very big b, i.e. branching factor in this case, like 1024 is useful: Loading a new digit/node from disk into memory takes a long time, but once it's in memory, your operations will be fast.


But 12 only gains you one more factor that's not a power of 2, and is 30 times more difficult to implement (operation tables have 144 cells for base 12, compared to 4 cells for base 2).


That's why you should use the digits -n/2 to +n/2 for base n. That shrinks the tables by a factor of four.


Oh no, I just knew someone would come and argue for balanced n-ary on this thread :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: