All about that base

Image from i.redditmedia.com and submitted by kettlersOfsatan
image showing All about that base

NEDM64 on October 23rd, 2017 at 21:02 UTC »

“Oddly specific number”...

https://www.reddit.com/r/ProgrammerHumor/comments/69ivqo/oddly_specific_number/

Anticode on October 23rd, 2017 at 21:26 UTC »

A (non-techy) colleague of mine was complaining about how his old work software would only allow lists of 32 items. If you went past that it would crash. He was saying, "Why 32? That's what I always wondered. What a weird number to stop on. 32! Why not 25? Or 50? It bugs me to this day and that was almost 10 years ago."

I gave him a quick layman's explanation of "computer numbers" and binary - his head nearly exploded.

Pascals_Tricycle on October 23rd, 2017 at 23:41 UTC »

I think it is pretty amazing how everyone has so much intuition built up on base 10, but how most people in elementary school are never really taught about how our system of counting works. I also don't think they teach the concept well even in a college course.

For example, I doubt many people without computer science or mathematics degrees think of a number like 4,512 as being shorthand for:

4x1000 + 5x100 + 1x10 + 2x1

which is really:

4x103 + 5x102 + 1x101 + 2x100

which is why it is "base 10".

And that you can easily convert a number to base 10 by using that pattern. Like 10010 in base 2 is just:

1x24 + 0x23 + 0x22 + 1x21 + 0x20 = 16 + 0 +0 + 2+ 0 = 18 (in base 10)

And 10010 in base 3 is just:

1x34 + 0x33 + 0x32 + 1x31 + 0x30 = 81 + 0 +0 + 3+ 0 = 84 (in base 10)

I know that gets taught in a basic computer science curriculum, but I feel like often times it isn't presented as simply as that. I never forget how to convert to base 10, because I just deconstruct a number with base 10 (like I did with 4,512 above) and quickly remember the pattern again.

You can also convert from base 10 to other bases pretty easily when you know this same pattern, but I won't cover that in this comment or else it'd get long.