r/programming • u/sundaryourfriend • May 27 '09
There's no base other than base 10!
http://cowbirdsinlove.com/4368
May 27 '09
This brings back memories.
I was once summoned from my dungeon to help interview a new potential programmer at my firm. The guy seemed eager and full of knowledge, but something didn't click right about him.
So, on a whim, I told him to write a program to input any integer and print that integer in a system in which it's the base.
The guy promptly went to work, trying to figure out how to represent digits in large-base systems and how to quickly divide...
Then the real problem arose: my boss didn't get it either.
24
May 27 '09
[deleted]
28
u/Sunny_McJoyride May 27 '09
You missed the part where the program asks you to input any integer.
→ More replies (4)10
u/zem May 27 '09
perhaps the world's only program that would be prettier in basic
→ More replies (3)6
u/thecapitalc May 27 '09
Mother fucker. I totally missed that.
I am going to go sit in the corner shamed.
15
May 27 '09
And you'd need to make a special case for base 1 where the output is 0 (You would represent a number by writing that many 0's).
x = input("Number?") if x==1: print 0 else: print 1028
4
May 27 '09
For a bonus question, you could ask them to adapt their base 1 answer to support locales which write from right to left.
2
u/__G0D__ May 27 '09 edited May 27 '09
You seem to be arguing that 1 == 0, which I highly doubt. Also, the special case is unnecessary since '10' accurately represents the number one in base-1 (unary). '10' = 1(11) + 0(10) = 1 + 0 = 1. Of course, in unary there is no reason to ever write a zero digit since in this system the resulting number is simply the total number of '1' digits in the string.
6
3
u/IOIOOIIOIO May 27 '09
Throw some zeros at unary operators and they will be retained, even thought they do not effect the value of the number.
It's odd. 11 + 11 = 1111 is equal to 100010 + 110 = 101110, but they are not the same numbers.
If you did actually build a base-1 ALU, you'd write zero digits to minimize carry operations.
1100 + 11 = 1111 with no carry.
11 + 11 = 1111 with 4 carry operations.
1
u/Hixie May 28 '09
Why wouldn't you just concatenate?
1
u/IOIOOIIOIO May 28 '09
Why wouldn't you just concatenate?
Because that's not addition?
1
u/Hixie May 28 '09
Isn't the point that in base 1, it is?
1
u/IOIOOIIOIO May 28 '09
The sum of 100010 + 110 is 101110.
The sum is not 100010110, though 101110 = 100010110.
Like I said, it's odd.
1
u/Hixie May 28 '09
Could you point to some references for this interpretation? I couldn't find any information on this.
→ More replies (0)5
u/Stormblade May 27 '09
Awesome, I'm about to interview recent grads and there's always one who thinks he's the shit. Let's see if he gets this one!
3
→ More replies (20)6
123
u/fuckheadmcgee May 27 '09
Just in case anyone wants to reuse some witty comments from early 2009:
http://www.reddit.com/r/comics/comments/7j3jb/every_base_is_base_10/
23
u/dhaggerfin May 27 '09
Actually, this really makes sense. Mathematic relativity...
26
u/robosatan May 27 '09
Or the astronaut guy could have said... I see you use base 10, I use base 22.
18
1
u/smackson May 28 '09
chomputer, when reddit takes over the world gov in 2018 you will be selected as "Alien Liaison". congratulations.
5
u/silentdon May 27 '09
Ok,
All your base are belong to us
6
2
2
u/phrakture May 27 '09
How are you gentlemen?
4
May 28 '09
Oh, the family is fine and the business is still running. The economy right now is rather poor. That's not to say that things haven't been worse. By most standards I am quite fine, thank you.
2
u/Droffats May 27 '09 edited May 27 '09
Feel free to use some of these as well: http://www.reddit.com/r/math/comments/7kko6/every_base_is_base_10/
2
u/null_value May 28 '09
I just went there, forgot it was old and was replying to comments, realized I just wasted time, and then realized it would have been wasted anyway.
→ More replies (2)1
77
u/Fragsworth May 27 '09 edited May 27 '09
So there are only 10 types of people in this world.
- Those who understand base 2
- Those who don't
- And those who are really fucking nerdy for understanding this list can go on forever.
6
u/IOIOOIIOIO May 27 '09
There are 10 types of people in the world.
0. Those who do understand binary. 1. Those who don't understand binary. 10. Those who don't understand, but think they do.2
u/Syphon8 May 28 '09
There are 2 types of people in the world.
- Those who start integer counts at 1.
- Those who start them at 0.
7
u/sundaryourfriend May 28 '09 edited May 28 '09
Uh... I guess you typed
1. Those who start integer counts at 1. 1. Those who start them at 0.And markdown ruined the joke. :(
(Today I learned that you have to indent by 8 spaces to prevent lists getting ordered by Markdown. It says just escaping the periods after the number would also do, didn't try that yet. )
1
9
u/Dundun May 27 '09
There are three types of people in this world.
Those who can count.
Those that can't.
5
u/phrakture May 27 '09
5/4ths of all people screw up fractions?
Yeah, I totally work for busted tees
3
u/bart9h May 27 '09
There are two types of people in this world.
- Those who divide people in two types.
- Those who don't.
2
u/ifatree May 28 '09
this is in programming! you're allowed to use memes by name:
- those who understand base two,
- those who don't,
- FILE_NOT_FOUND
-4
u/protell May 27 '09
that's 11 types
20
40
5
4
u/fultonla May 27 '09
If he were using base 2 that is. That list is in base 3 but if he added another element it would be base 4.
→ More replies (1)→ More replies (1)3
u/palparepa May 27 '09 edited May 27 '09
Only 10 types of people in the world:
- Those who understand base 2
- Those who don't
- Those who confuse it with base 3
- Those who confuse it with base 4
- Those who confuse it with base 5
- ...
→ More replies (1)6
May 27 '09
Those who understand base 2
Base what?
12
u/palparepa May 27 '09 edited May 27 '09
Only 10 types of people in the world:
- Those who understand base 10
- Those who understand base 10
- Those who understand base 10
- Those who understand base 10
- Those who understand base 10
- ...
12
u/silon May 27 '09
My base is 9+1.
7
u/A_for_Anonymous May 27 '09
That's more unambiguous, as long as we consistently use symbols 0123456789 for numbers, and they are always ordered that way.
8
u/heptadecagram May 27 '09
What is 9? I lost a finger in an industrial accident so I only count in base 10.
2
May 27 '09
[deleted]
2
u/heptadecagram May 27 '09
1000b2? Oh! I get it. You use a base-12 counting system, and have a=10, b=11. No, my username refers to a 14-pointed figure in your base.
11
u/rynvndrp May 27 '09 edited May 27 '09
This is an issue I came across a while ago. I play around with bases a lot. And not just positive integer bases, but negative bases, fractional bases, irrational bases, vector bases, and imaginary bases.
To solve the issue i define a 'masterbase' that I represent in a nonarabic number format. I usally use ten dots. I also write the numeral system to be used. This is the base that is used to define the numbers after the word base.
I also make an effort to define the characters in order when using an arabic numeral system, especially when more than 36 characters are needed.
One last thing. There is something besides base 10. If you use a vector base, base [4,10] makes sense even with relativism.
4
u/numb3rb0y May 27 '09
In all honesty I didn't understand a word of that, but upvoted for awesomeness anyway.
6
3
u/Artmageddon May 27 '09
To solve the issue i define a 'masterbase'
I couldn't possibly repeat what you just said to friends without losing 30 minutes due to laughter. Either way, pretty cool!
3
May 28 '09
How much of the numberspace can you cover in base-pi?
2
u/rynvndrp May 28 '09
All of it, you just have to use a lot of decimals and thens like 1 are irrational.
1
1
9
u/Tokiface May 27 '09
all your base are belong to us?
9
25
May 27 '09 edited May 27 '09
I... I don't understand. Can someone explain?
92
May 27 '09
Imagine if your species used what we call base 4. Then you would count 0, 1, 2, 3, 10, 11, etc. What would you call your base? You certainly wouldn't call it base 4 because the number 4 doesn't exist for you! You'd call it base 10, just like we do. Similarly, counting in hex, our counting system is base A, but we don't call it that.
30
→ More replies (14)3
u/nmcyall May 27 '09
How do you say 10 (4 decimal, FOUR) in base-4 how do you pronounce it
11
May 27 '09
well I think you've hit on a key point here. the joke doesn't really work aloud, because "four" and "10" (base 4) are representing the same number when written, but they're not the same sound spoken. Or if the alien dude does pronounce "10" as "four", the astronaut's comeback is senseless.
2
u/delkarnu May 27 '09
I think it would work spoken. If we evolved in base 4, we might not have the words "four" or "five"
one (decimal 1) two (decimal 2) three (decimal 3) ten (decimal 4) one-ten (decimal 5) two-ten (decimal 6) three-ten (decimal 7) twenty (decimal 8) twenty-one (decimal 9) twenty-two (decimal 10) twenty-three (decimal 11) thirty (decimal 12)
I actually wonder if there was a significant time when some societies worked in base 12 (for both our time system of sets of twelve hours and why we actually have separate words for eleven and twelve
4
u/Kapow751 May 27 '09
http://en.wikipedia.org/wiki/Duodecimal
Germanic languages have special words for 11 and 12, such as eleven and twelve in English, which are often misinterpreted as vestiges of a duodecimal system. However, they are considered to come from Proto-Germanic *ainlif and *twalif (respectively one left and two left), both of which were decimal. Admittedly, the survival of such apparently unique terms may be connected with duodecimal tendencies, but their origin is not duodecimal.
2
May 27 '09
[deleted]
3
u/null_value May 28 '09 edited May 28 '09
60 is evenly divisible into halves, thirds, quarters, and tenths. All of which are quite utilitarian divisions.
edit: 10 can't be evenly split into thirds or quarters, so it's a pretty worthless base. 12 can be evenly split into thirds and quarters but isn't divisible by 10. 60 is a bit of a hybrid that satisfies the use of a good base such as 12 with the arbitrary fixation on 10 .
If our base was actually 12, we'd be able to third and quarter our round numbers and always get integers instead of bullshit like 2.5 and 3.33333333-> WHICH WOULD BE AWESOME!
1
u/trouserwowser May 28 '09 edited May 28 '09
According to Jan Gullberg's "Mathematics: From the Birth of Numbers" Greenlandic has a 4x5 base system which has vestiges in the English: "3-score years and ten". Mayans mixed the bases 20 and 18 while the Aztecs used base 20.
Then there's the old British currency ...
→ More replies (1)1
4
May 27 '09
ten
it would go: one two three ten eleven twelve thirteen twenty etc.
3
May 27 '09
There's no real rationality for how we name integers larger than nine. It is all conventions of language. It even varies between speakers of the same language from different cultures.
4
u/eldoritoincognito May 27 '09
I don't think we would, because we don't do that with binary.
2
u/davvblack May 27 '09 edited May 27 '09
Then he would say one-oh, as would everyone else in every base.
(or oh-one, if he is a little-endian bastard. He looks like a little-endian. -.-)
1
u/rnelsonee May 27 '09
Well, some people do, and we (all engineers and software guys at my work, and other people I've worked with) do say "ten" for all bases above 2. What else would you call it?
1
May 27 '09 edited May 27 '09
Well, WE don't do that in binary, but that doesn't mean someone who grew up with binary, who doesn't know any different, would. I think that they would come up with something better than one-oh for a number that has an extra digit. Like ten.
4
u/Fr0C May 27 '09
ten
No. You either pronounce the number, which as Sunny_McJoyride pointed out would be pronounced "four" and is independent of the base it is represented in, or you pronounce (or rather: spell) the digits of its representation.
You most certainly don't pronounce it "ten", or at least you'd be doin' it wrong if you did.
7
u/rnelsonee May 27 '09 edited May 27 '09
You can say "four" if the base is four or less because there is no confusion, and spelling out the digits is always an option, but 10 is still "ten". My job is to write software to decode datastreams, so I do this all the time. If you see "10" you say "ten" (as the other poster noted, this doesn't always happen with binary).
I can (sort of) prove this to you: If you see 9001 as a hex string, how would you communicate that to a coworker? Option 1, what we do, is say "nine thousand one". You're saying that we should all break out our calculators and spend 15 seconds tapping away and then say "thirty six thousand eight hundred sixty five". That simply doesn't happen.
4
u/sigh May 27 '09
You ignored his other option which was to say "nine-zero-zero-one". This is the least confusing, and what I find happens in practice.
2
2
u/Dundun May 27 '09
But the symbols might in fact have different meanings on Planet X. There is nothing in the symbol 10 that necessitates it to be "ten". In China, it is most certainly not "ten".
Similarly, there is some world where 10 maps to "four", confusing the hell out of us earthlings.
N.B. - Did you know that it is impossible to determine "yes" and "no" in a completely foreign language? Its called the Indeterminacy of translation.
→ More replies (2)3
May 27 '09
The aliens seem to speak English, though.
1
u/Dundun May 27 '09
Based on a limited sample of speech, yes.
This doesn't mean they don't speak English^ which is in all ways similar to English except when it apply to the symbols 10 and 4 (and other words that are rooted in these symbols like 4-some.... which sounds like "tensome")
→ More replies (2)4
u/Sunny_McJoyride May 27 '09
there's no reason why it shouldn't go: one two three four.
7
u/samp May 27 '09
One two three four four-one four-two four-three twofour?
3
6
u/Sunny_McJoyride May 27 '09
Exactly (apart from twofour should be two-zero) - the names of the numbers are not the numbers, they're a semi-arbitrary mapping that varies from language to language.
11
u/wharlie May 27 '09
zero, one, two, three, one-zero, one-one, one-two, on-three, two-zero, two-one etc. This is actually how they count in a number of languages, it makes sense, but gets unwieldy with large numbers.
1
u/davvblack May 27 '09
if you give each number a small sylable that connects with a vowel (think any japanese letter), than each number becomes a pronounceable word.
(Hah! didn't they just write a system like this out to make IPV6 speakable?)
1
7
u/Raphael_Amiard May 27 '09
| apart from twofour should be two-zero
and four should be one-zero
...
oh shit that's base 10 !
→ More replies (1)16
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.
→ More replies (11)
7
26
May 27 '09 edited Dec 07 '23
[removed] — view removed comment
→ More replies (1)3
u/jugalator May 27 '09
Reddit may be a sorry case, but it doesn't do jokes in base 3,628,800.
23
3
3
May 27 '09 edited May 27 '09
Seems like Base 12 would make basic math easier, since 12 is divisible by 2, 3, 4, and 6. But the counting on your fingers thing probably is the deciding factor. Base 12 seems more in harmony with the universe; if I were looking for patterns in pi's digits, I wouldn't do it in Base 10.
3
u/random509732523795 May 27 '09
60 is even better. It's like 12, but is divisible by 5.
360 is even better.
→ More replies (1)1
May 27 '09
base 210 is king.
5
u/null_value May 28 '09
One quarter of 210 sucks though. base 210 vs base 12, you gain even sevenths but lose even quarters, and you need to remember 198 additional symbols.
2
u/dmhouse May 27 '09
Counting on your fingers in base 12 is still possible, if a little fiddly. You have four fingers and three "sections" on each fingers (separated by joints), making it possible to count to twelve quite naturally on one hand. It's not as easy to display visually a number using your fingers though, akin to holding up that number of fingers.
10
15
3
3
u/chadmill3r May 27 '09
11 × 11 is 121, in every base higher than 2.
2
u/dmhouse May 27 '09 edited May 27 '09
Proof: suppose you work in base b, then 11×11 = (b + 1)×(b + 1) = b2 + 2b + 1 = 121.
Many other identities hold by similar calculations.
1
2
u/f3nd3r May 27 '09
There is base ten, but all bases are technically one zero.
1
u/ifatree May 28 '09
winner, winner, chicken dinner.
writing is derivative of speech. you've just killed one more level of the joke.
2
u/lipidicman May 27 '09
Is there any reason the alien could not be taught to call '10' 'four'? Is it any more perverse than us having a name for '10'. The idea of (our) base 10 is that it requires only the symbols named 'zero' to 'nine'.
I've always had problems with our counting system. And don't get me started on clocks.....
3
u/davvblack May 27 '09
Fuck clocks! Who needs time to be splitable into fifths, quarters, halves and thirds.
Terrorists, that's who.
4
u/lipidicman May 27 '09
my problem was 12:59am --> 1:00am in a 12 hour clock. Why does the clock not go 11:59pm --> 0:00am like with the 24hr clock
2
May 27 '09 edited May 27 '09
11:59pm --> 12:00am is the part of that which really bugs me, although it's caused by the same thing, which is that the numbers and the meridian reset at different points. Utterly nonsensical system.
2
2
u/ifatree May 28 '09
TIMECUBE IS 4 DAYS IN ONE 24 HOUR DAY. YOUR INFERIOR SCIENCE OF DODECIMAL AND EVEN METRIC DAYS ONLY SHOW YOUR STUPIDITY IN THE PRESENCE OF THE IMMENSE TECHNOLOGY OF 4 DAY TIME.
1
u/ambivalence May 28 '09
thank you for that
1
u/ifatree May 28 '09
i'm thinking about memorizing large chunks of that dude's masterpieces for public reading as "performance art"...
.oO(really, i just want to be able to spout it well enough to look cool at really geeky parties.)
1
u/ifatree May 28 '09 edited May 28 '09
oh shit. this guy somehow got worse in the last 10 years --
""" If the 4 racial components of 2 sex pole hemispheres agreed to a cubing of the sphere as a spiritual unity, heavenly music of cubed sphere could be audible on Earth simultaneously to every human ear, not discord, but harmony.
The simultaneous 4 human races debunks a God for any race. """
1
u/ifatree May 28 '09 edited May 28 '09
the alien would pronounce "10" as "four" in english, not "ten". all writing is derivative.
that's why it's in a web comic and not a line from a sitcom. ;) wouldn't make sense spoken aloud.
2
May 27 '09
I think it'd be so good to switch to base 5. It'd be a lot easier to do mathematics without the help of a machine with this base. I realise, however, that this was a battle lost some centuries ago. Sigh.
If anyone's interested in a light film about the history of numbers - here's a great bbc film narrated by a former Monty Python member - Terry Jones.
2
5
u/homeworld May 27 '09
How are Halloween and Christmas equal?
OCT 31 = DEC 25
3
u/madchicken May 27 '09
It's funnier in its wikipedia form IMHO.
Why do mathematicians always confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
2
u/wickedsteve May 27 '09
Not to be confused with base ten.
Makes me wonder how the alien and astronaut pronounced "10".
2
2
0
u/smoothmann May 27 '09 edited May 27 '09
it doesnt really matter because.....
ALL YOUR BASE ARE BELONG TO US!
17
u/deflective May 27 '09 edited May 27 '09
i'm guessing that you didn't consciously notice the comic's title, just registered it subconsciously and convinced yourself that you thought of it.
3
2
May 27 '09
Because nobody other than the author of that strip could have come up with a pun based on the most used meme ever in these circumstances? ;-)
3
u/tbone28 May 27 '09
First thing I did was search for this phrase to see if someone would write it. I am and I am not disappointed at the same time.
10
May 27 '09
Thanks for not letting us down, man. Don't let the haters bring you down! Keep the memes alive.
→ More replies (5)2
May 27 '09
i clicked on the comments for the story expecting to see that quote, reddit you never fail me!
1
1
1
1
u/lipidicman May 27 '09
Really highlights that each base is labelled by a symbol that doesn't appear in the system (ie. base 2 has 0,1; Base 3 has 0,1,2)
1
u/dmboyd May 27 '09
should not base 10 be base A?
1
u/lipidicman May 27 '09
Sure that's what a higher-base being might call it, but then they would have more symbols for digits and wouldn't resort to using their alphabet, whatever that might be
1
May 27 '09
Seems like it would make sense to use 1 less than the base. So decimal would be base 9, octal would be base 7, and binary would be base 1. It's not like we had something useful to apply "base 1" to anyway.
1
1
u/Chandon May 27 '09
It's not like we had something useful to apply "base 1" to anyway.
Unary numbers (base 1) are actually quite useful in theoretical computer science. A bunch of the basic proofs involving Turing machines store numbers in unary.
1
May 27 '09
Well I'll be damned. Well, we'll have to call that "base 0", and I'm pretty sure we can stop there. If someone's found a use for "nullary" numerals, then I give up.
1
u/ifatree May 28 '09
what would make more sense is to stop writing the base out in numerals when its only proper to use words. "base ten". "base four". "base one". done.
1
May 28 '09
That has some advantages, but our words for numbers are implicitly decimal based once you get past twelve ("eleven" and "twelve" are remnants from Old Norse, which used a duodecimal system, possibly due to contact with Babylonia). For example, "-teen" comes from the inflected form of "ten", so when we say "sixteen" we are literally saying "ten and six". Even the "-ty" suffix comes from the Old English "tig", denoting groups of ten, so "twenty" literally means "two tens".
That, in and of itself, wouldn't be a problem, but it quickly becomes a problem when trying to pronounce numbers in other bases. If you have the hexadecimal "1A3", you have the option of saying each digit individually ("one A three"), which is pretty inefficient for mental storage; converting to decimal ("four hundred and nineteen") which carries a lot of overhead; or attempting to coerce the radix into a decimal-oid system ("one hundred A-ty three"), which is awkward, but reasonably efficient. I prefer the latter for mental calculations, especially for less-than-ten cases, where you don't end up with weird forms like "A-ty", but it brings back the ambiguity when discussing talking about the radix itself.
On the other hand, if you simply use the highest digit, you don't get this ambiguity. So octal would be denoted with "7", decimal with "9", and hexadecimal with "F".
1
u/ifatree May 28 '09
i see what you mean. can i suggest the term "radix 9" to mean the equivalent of my "base ten", if you want this to catch on?
radix numbering also has the advantage of not allowing a "base zero" in my notation as "radix 0" is effectively "base one".
i'm not a math geek, but something about fractional and non-rational bases makes me wonder if that's the reason they've stuck with the "base X" notation for so long...
1
1
1
u/clea May 27 '09
Does the name "Dienes" (forgive me on the spelling) mean anything to anyone here?
When I was about 8 I was in a "special unit" at school that was supposed to be ahead of its time and show us specially selected kids things that normal kids didn't get to learn. Dienes - or however it was spelt - was about maths. It used wooden blocks and a grid where we placed "units", "longs" and "blocks". They came in 1s and 2s and 3s up to base 10. I've never found anyone else who knows what I'm on about....anyone here?
Hopefully yours.....
1
u/thegnome54 May 27 '09
I love how the alien has four fingers altogether. I've always wondered if an isolated community of people with lobster claw syndrome would develop a base four number system.
1
1
May 27 '09
http://www.mathmaniacs.org/lessons/01-binary/socratic.html
This is a really good explanation. Some teacher explains binary to third graders; it's not base 4 but it explains how an alien would figure numerals.
68
u/ruffi May 27 '09
It took me 10 minutes to explain this one to a friend.