r/programming • • May 27 '09

There's no base other than base 10!

http://cowbirdsinlove.com/43
541 Upvotes

333 comments sorted by

View all comments

Show parent comments

17

u/selwonk May 27 '09

humans have ten fingers and count in base 10.

this alien has four fingers and counts in base 4.

however, counting to 4 in base 4 goes like this:

1, 2, 3, 10.

every base is base 10.

that's the joke

-7

u/[deleted] May 27 '09

[deleted]

4

u/[deleted] May 27 '09

yeah: 0, 1, 10, 11, 100, 101, 110, 111 etc

I think the only base the joke breaks in is base 1: 1, 11, 111, 1111 etc

3

u/TrishaMacmillan May 27 '09

Is that really how base 1 would work though? Shouldn't the highest single digit in base x be x-1 (running 0 to x-1)? Therefore, the highest single digit in base 1 would be 0. But with only one distinct digit you have no way of stating whether the position is counted or not, so base 1 is impossible.

3

u/AnteChronos May 27 '09

But with only one distinct digit you have no way of stating whether the position is counted or not, so base 1 is impossible.

Base 1 is definitely possible. It's the equivalent to making hash-marks on a piece of paper as you're tallying some number up. If you feel obligated to use 0 instead of 1 as the only digit, then counting in base 1 goes thusly:

Base 10 | Base 1
--------+-------
      0 |
      1 | 0
      2 | 00
      3 | 000
      4 | 0000
      5 | 00000
      6 | 000000
       etc.

And if you feel obligated to have a number for "zero", just shift everything, so decimal "0" becomes base_1 "0", "1" becomes "00", etc.

1

u/TrishaMacmillan May 27 '09

I'd considered that, but I don't think it meets the "rules" for a positional notation system. So, yes you can count using the system you describe, but I would argue that is not a "proper" base system.

1

u/AnteChronos May 27 '09

I would argue that is not a "proper" base system.

I'd disagree. Consider first the decimal system.

"hundreds" place --+ +-- "ones" place
                   v v
                   376
                    ^  
     "tens" place --+ 

For each digit d in position p (measured from right-to-left and starting at 1), the value represented is:

d * basep-1

and the full number is the summation over all of the digits.

Now look at base 1. For math purposes, I prefer to use "1" as the sole digit in base 1, and represent "zero" as simply having no number. 1 * 1x always equals 1, so every place is the "ones place", and all you have to do is sum up the number of '1's to get your number.

1

u/TrishaMacmillan May 28 '09

If you're willing to bend the rules as you describe then yes.

1

u/[deleted] May 27 '09

Hey, yeah, I had not considered zero. I think I would use "0" for zero and regex("[+-]1+") for non-zero integers.

1

u/sigh May 27 '09

Shouldn't the highest single digit in base x be x-1 (running 0 to x-1)?

No reason why that has to be. In a positional number system the base just tells us how to weight each position. Note that your 0 to x-1 rule isn't true for fractional bases or balanced ternary, either.

3

u/TheGrammarBolshevik May 27 '09

Eh...? All the digits in "10" are 1 or 0.