Friday, February 9th, 2007 03:04 pm
I was lying in bed the other night thinking about bases of arithmetic....

You know, it's kinda odd that insomnia due to math isn't that rare, for me.

Anyway, I was thinking about bases of arithmetic, and Hal Clement's throwaway gag in Still River* about an ancient academic controversy over octal versus duodecimal at the School in his story, and the problem of factoring, and how weak the theoretic justifications for all those specific bases are.

You may be surprised at this claim. "But octal is clearly the most rational," you might be saying. "Binary is the most fundamental base of arithmetic, and octal is a logical extension of that."

Uh-huh. Logical extension how, exactly? If you've got an old 24-bit mainframe?

"That just implies hexadecimal is even better."

Yeah, okay, but that's still just one advantage – convenient relation to binary. Besides, larger bases get more and more inconvenient as you have to memorize more and more figures and (more importantly) bigger and bigger multiplication tables. So hex is great for computer scientists, and octal used to be great for computer scientists, but that doesn't translate to their being the best day-to-day radices. They've got one advantage – one huge advantage – but it's only a useful advantage in a few contexts.

And when we turn to duodecimal, base 12 (and its cousin, sexagesimal, base 60), we find a similar sole advantage: the base has many factors. Yeah, that's great if you're writing fractions – 1/3 becomes 0.4duodecimal, 4/15 becomes [00].[16]sexagesimal (each bracket is a decimal representation of one figure), etc. – but how often do you need to?

Actually, that gets to the key point: what do you need to do regularly with a number system? Really, it comes down to:

  • Write.
  • Add.
  • Subtract.
  • Multiply.
  • Divide.

...pretty much in that order. I mention "write" because while messing with the basic principle of positional notation may be fun, standard positional notation is a pretty solid, intuitive way to write down how many books you have on the second shelf of your bookcase.** And while binary may be logically the simplest radix, 10101 takes up a lot more space than 21†. (Oh, and just coming up with symbols for a sexagesimal system is horrid, forgetting all its other disadvantages.)

So, what about these others? Well, we're only looking at standard positional systems, so whatever advantages balanced ternary systems have, we're ignoring them. Anyway, in standard positional systems, 'add' and 'subtract' pretty much make only one contribution to complexity: how many digits are in your basic addition tables. And since we humans have shown that we can handle base 10 pretty well, anything up to around that size is probably fine. Multiplication is almost the same, but there's an advantage for highly composite (and not-quite-highly composite) radices – all the rows with divisors of the base are simpler. (I guess that means duodecimal isn't quite as pointless as I thought.) Division – well, you're doing long division, so have to come up with a compromise between having fewer digits (higher radix) and fewer multiples of the denominator (lower radix). Oh, and having lots of divisors means fewer recurring 'decimals'.

This sounds like it's building up to sell duodecimal after all. No, it isn't.

I'm saying we should use senary. Base six.

The actual inspiration for this came that night, when I was comparing duodecimal and octal to decimal. Duodecimal, I had decided, had the advantage of many factors. Octal, of being a power of 2. But what about decimal?

Well, as it happens, I had already realized that decimal was unusually good at testing divisibility. As it happens, there are two types of numbers that are very easy to check divisibility of in a given base: factors of the base, and adjacent natural numbers to the base. In decimal, the first group consists of 2, 5, and 10. The latter group consists of 9 and 11. Divisibility by the first set can be checked through examining the final digit – an even digit means multiple of 2, 5 or 0 mean multiple of 5, 0 means multiple of 10. This is really easy – in big O notation, it's O(1), meaning it takes a constant length of time for any number. As for 9 and 11, it's easy to prove from modulo arithmetic that you need merely add all the digits (for 9 – 'casting out nines', basically) or alternately add and subtract (for 11) to check divisibility. These are both O(log n) – the time they take is proportional to the length of the number, written out.‡

Now, all bases get the benefits of these two effects. But because 9 is a power of 3, in base 10 this means that testing divisibility by 2, 3, 5, and 11 is easy. Four of the first five prime factors, accounting for 75.76% of all numbers. That's pretty good – only missing the seven. Duodecimal only gets 2 and 3 from its factors, and 11 and 13 from the casting-out methods, so it misses five and seven. Octal would get seven, of course (one less than the base), but it only has two as a prime factor and nine = three squared as one over the base, so it misses five.

But six doesn't. It misses eleven, but with seven it gets 77.14%, better than base 10, which beat bases 8 and 12. It's smaller than 10, which means only six symbols and 21 unique entries each on the addition and multiplication tables. (It would be 36, but since 2+3 = 3+2 and 2*3 = 3*2, a large fraction drop out.) Being smaller also makes long division easier – you need only write 5 multiples of the divisor, instead of 9. Against that, you've got longer numbers, but even when you get pretty large (e.g. the age of the universe, 13.7 billion years), it's not a big difference (13 senary figures as opposed to 11 decimal figures). Being divisible by 2 and 3 means 1/2, 1/3, and 1/4 are all easy (1/4 = 0.13senary), and adds extra simplicity to two rows of the multiplication table (which has only six to start with, including the ones row).

Add these factors together, and I think that makes 6 the perfect base.§


But hey, who cares what I think!

[Poll #924107]




* Which is actually a pretty lame book, on rereading, but I still like it.
** Not that bijective numerations are that hard to count in – I just didn't want every link to be to Wikipedia.
† I'm not counting the Adobe Photoshop manual in this count.
‡ Which, you must note, is often much less than the number itself.
§ Yes, I did in fact spent seven hours writing a long, technical discussion of the relative merits of five different systems of positional notation, combined with an a priori enumeration of the most important principles of a number system, just so I could conclude with that sentence. I regret nothing!
Saturday, February 10th, 2007 04:15 am (UTC)
Your reasoning interests me. Certainly, if it were about implementing a new system of bases, senary would rate well, though I'd still be given to using a base that's a power of two. Teach someone hex from the time they first start counting, and - I imagine - it'd become happily intuitive all by itself. Plus, for as long as computers use binary, it removes a barrier to more people understanding more of how they function. Maybe it wouldn't be as easy as senary, but it'd likely be worth it eventually.

(But then, why not quaternary? Easy access to binary, hexadecimal, duotrigesimal, quadrosexagesimal, and eventually, octovigesacentimal, sexaquinquagesibicentimal, duodecapentacentesimal, quadrovigesamillesimal, and so on. And, of course, SI measurements would also need to change to the new base, otherwise it'd be just as bad as Imperial measures. (Also, writing out those base names was kind of fun.))

My vote is swayed by two things. The first is backwards compatibility. Decimal is backwards-compatible for at least three centuries of civilisation. The second is the easy availability of simple calculation tools for decimal - ie, fingers.

(That said, fingers are, in fact, senary-compatible. People could, with minimal effort, count to 35 556. So, I suppose it's just the backwards-compatibility.)
Saturday, February 10th, 2007 04:18 am (UTC)
Also, whatever radix gets to be the default, it'll always be base 10 for its users. Discuss.
Saturday, February 10th, 2007 01:14 pm (UTC)
Well, the importance of binary computers is likely to remain for a long time – there's been some claims that ternary computers would have been more efficient, but we've got so much technical improvement invested in binary architecture that they won't catch up for a long time, if ever.

Hmm – quarternary? Disadvantage is that thirds don't come out even, but otherwise it's pretty decent. 13.7 billion decimal (11 digits) has 16 quits (heh!), which is a little long, but with only 4 symbols we may be able to write them smaller.

(Actually, I think SI measurements would convert automatically if we just renamed the kilogram. That done, we could just make new prefixes for powers in 4 or 6 or whatever.)

Backward compatibility is pretty important, I suppose, but we managed to abandon Roman numerals all right. And compatibility with finger counting, as you pointed out, doesn't change with senary. The only question is whether it's enough of an improvement to overwhelm cultural inertia.

Which, of course, it is not.
Saturday, February 10th, 2007 01:18 pm (UTC)
Well, duh! ;)

By the way: when speaking in an alternate base, do you edit your terms appropriately? Like, in base ||||, "One, two, three, ten, eleven, twelve, thirteen, twenty, twenty-one, ..."?
Saturday, February 10th, 2007 01:37 pm (UTC)
Fifths don't come out even in senary, so it's a disadvantage that'll carry through anyway. For ease of use with binary computers, quaternary has a definite advantage, and would somewhat improve the precision of results returned by the machine (mostly by eliminating conversion errors).

And... yes. We'd just need to change the prefixes. Metre, quadrimetre, hexadecametre, would that the words for prefixes weren't base 10.

Roman numerals are little more than a notation system, though, which is quite efficient when you translate it into sets of counters in a little sandpit. (Plus, Roman numerals are still base 10. Ten Is make an X. Ten Xs make a C. Ten Cs make an M. Symbols for multiples of five are added for convenience. It would, however, be interesting to work out what MCMXLVIIIIIX is.)

Senary has, I think, the greatest finger counting potential; it easily supports subtraction of all possible two-digit numbers. But, it translates badly into anything binary.
Saturday, February 10th, 2007 01:46 pm (UTC)
Except those wouldn't be appropriate terms. Without making up completely new words, I'd see it more as:

1 - One
2 - Two
3 - Three
10 - Four
11 - Four and one
12 - Four and two
13 - Four and three
20 - Eight
21 - Eight and one
...
30 - Twelve
...
100 - Sixteen
101 - Sixteen and one
...
110 - Sixteen and four
111 - Sixteen four and one

Which is good up until 333 (Forty-eight twelve and three, decimal 63), at which point the words all break. Which is, again, a conceptual problem with any attempt to move away from decimal: all the words are decimal, so you need to convert it to say it easily.
Saturday, February 10th, 2007 01:47 pm (UTC)
Actually, wait. It doesn't even last that long. It breaks down at 200.
Saturday, February 10th, 2007 05:17 pm (UTC)
That was the point of my suggestion. In your version, you're still converting to decimal, just on a digit-by-digit basis instead of whole hog. I'm suggesting converting "ten" to mean ||||, "twenty" to mean |||| |||, "one hundred" to mean |||| |||| |||| |, etc. If it were hex we were using, we'd be in trouble, since words for Bhex don't really exist, but in quarternary the words for the figures all exist. Just throw away the extras and redefine, and our decimal language will work.
Saturday, February 10th, 2007 05:31 pm (UTC)
You know, I think we're pretty much in agreement. Ignoring cultural inertia, you place a higher value on compatibility with binary than I do, and that basically describes our differences.

Although, curiously enough, senary's finger-counting advantage wasn't a factor in my reckonings – mostly because I consider our five-fingered hands to be a purely arbitrary aberration. ;)
(Anonymous)
Thursday, February 15th, 2007 01:23 am (UTC)
see http://curvebank.calstatela.edu/newmath/newmath.htm for the audio (with permission) of Tom Lehrer's song "New Math" --- wherein he explains octal arithmetic ("But don't panic! Base eight is just like base ten really - if you're missing two fingers!") ... excellent satire ("But in the new approach, as you know, the important thing is to understand what you're doing, rather than to get the right answer.") ... cf. also http://s13.invisionfree.com/DozensOnline/index.php?showtopic=142 for "My Case for Base Six" and counter-arguments for base 12 ...
Friday, February 16th, 2007 12:55 am (UTC)
Hah! tnx – the Tom Lehrer was great, and it's nice to see another fella come up with senary as a logical base.
Saturday, May 31st, 2008 08:02 pm (UTC)
When I was creating All-That-Is (http://www.all-that-is.net), I toyed with the idea of using a different base than 10, but decided against it, on the basis that for the purpose of roleplaying it would be too tricky for the players to do the conversions on the spot, and honestly, most wouldn't even bother. This is the same reasoning I had behind not giving all of the numbers different names and symbols - if I was writing a background language/numbering system (think Klingon in the Star Trek universe, or the second language in Futurama) then I'd have no problem switching it around, but the whole point was that I wanted there to be a universal numbering system for the whole planet.

Once I'd decided to go with 10 as the base number, I worked on everything being done in base 10. There are 10 races (http://all-that-is.net/index.php?title=Races), which means that there's 10 countries (http://all-that-is.net/index.php?title=Countries). There's 10 orc tribes (http://all-that-is.net/index.php?title=Orcs), 10 Narcarbia Islands (http://all-that-is.net/index.php?title=The_Narcarbia_Islands), and 100 Nevah-Nevah islands (http://all-that-is.net/index.php?title=Nevah-Nevah).

More relevantly, however, the year is split into 10 months (http://all-that-is.net/index.php?title=Months), each of which has 50 days. Each day has 10 hours made up of 100 minutes made up of 100 seconds.

I also really like the number 3, so there are 30 types of travellers (http://all-that-is.net/index.php?title=Travellers), 30 races (if you include halflings and exclude Orgs, which most people do), 3 rogue countries, and 3 rogue orc tribes.
Saturday, May 31st, 2008 08:27 pm (UTC)
You're right - there is a huge benefit to using the method everyone already uses. I was just thinking if we started over, or for Lojban (http://www.lojban.org/tiki/tiki-index.php?page=Home+Page&bl) or some other philosophical conlang.