Monday, August 7, 2017

Number Bases

It was Christmas time when the kid and I started talking about number bases.  The air outside was more than normally chill for San Francisco.  In the winter here, thanks to the fog, the air’s still damp, so cold feels really cold, but the chill was compensated for by town being even prettier than usual; sporting all it’s holiday lights.  People on public transit were more tired than in other seasons; the holiday rush, and December’s early sunsets combined to make a sleepy, almost lethargic atmosphere.  The season also seemed to have made our generally friendly fellow bus riders even a little more affable.  Smiles swept across their faces a little more quickly.  People scooched and shuffled to help each other get into the crowded buses.

The kid and I were on one of these buses, returning to the house from who knows where when, mostly just to liven up the ride, and with only the slightest hint of an ulterior motive, I asked her, “How many numbers can you make from a single digit?”

Why’d I do it?
I did in fact have an ulterior motive even if it was just a smidgen of one.  In my work with computers I use a lot binary, a number system that only has two values per digit, 0, and 1.  I also use a number system called hexadecimal.  Hexadecimal has 16 different numbers.  They are, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f, (seriously, not making it  up).  I wanted to be able to talk to my kids about what I do at work.  Hence the question, “How many different numbers can you make with a single digit?

Technical terms (a brief interlude)
Please excuse one more interruption in our tale.  Before we go too much further, let’s get the fancy technical terms out of the way.  Binary and hexadecimal are specific names for two specific systems of numbering.  Mathematicians, (who for various syntactic and semantic reasons are probably cringing as they read this), call these systems of numbering ‘number bases’.  The binary system is called ‘base 2’, (there are two single digit numbers in the system, 0, and 1).  Hexadecimal is called base 16.  That’s because there are 16 single digit numbers, (go ahead,count them above… yes, a - f are numbers in hexadecimal).  None of us can really escape number bases, we can just choose not to discuss them; the system we all use every day is  base 10, (0 - 9: 10 numbers).

Learning our native base
So, back to the kid’s and my conversation. You’ll recall I asked, “How many numbers can you make with one digit?”  She was unsure, so I suggested counting them.

“1, 2, 3, 4, 5, 6, 7, 8, 9, 10…”

As the bus veered off of Ocean, to enter Persia, in our little neighborhood called Excelsior, I interrupted, “Stop!  Can you write down 10 with one digit?”

“What?”

“When you write down 10, how many digits—characters—do you have to use?  What do you write down on paper for 10?”

“A 1, and a 0,” she answered.

“OK, so 10 doesn’t count because we only want to know how many single digit numbers there are.  Ten takes two digits, a one, and a zero,” I said as I wrote the digits in the air with my finger, being careful to get the one on her left, and the zero on her right as I faced her; a trick I’d learned in my college beer-money job—tutoring physics.  I continued, “So, how many number can you make with a single digit?”

“9?”

“What about 0?  It’s a single digit right?”

“Oh yeah, 0!”

“So, how many single digit numbers are there?”

 “Nine plus one more for 0,” she said counting on her fingers.  “So, 10.”

 “Awesome!  You just figured out what number base we use!  The number of single digits in a number system is called its base.  We use base 10.”

“OK,” she said with a grin.

We stopped to pick up new passengers at the corner of Persia and MIssion.  The kid and I were able to grab seats as people filed first out, and then into the bus.  As we sat down, our neighbors got on carrying pink boxes of Salvadoran pastries from the bakery near our stop.  The warmth of their aroma hit us as the boxes and their associated passengers scattered throughout the bus.  As we got back under way, I jumped back into our conversation.

“So, what number system do we use every day?  What base?”

“10,” the kid exclaimed as we got a sideways glance from a sleepy fellow passenger.

“Good job!  So, what’s the biggest number you can make with single digits?”

“10?” she pondered.

“Really?  Doesn’t that take two digits?”

“Oh yeah!  OK, 9 then.”

“Cool deal!  So, what number base do we use?”

“Base 10!”

“What’s the biggest single digit number?”

“9!”

The bus squeaked to a stop at Naples.  Lots of people live near there.  They all trundled off.  The doors closed and the bus continued to power up the hill..

“What if we were in base 4?  How many single digit numbers would we have?”

“What?”

“So, in base 10 we have 10 single digit numbers.  If we had another system called base 4, how many single digit numbers do you think it would have?”

“4?”

“Yup!” I beamed as we crossed Vienna.  What would they be?  Which numbers?”

“1, 2, …”

“What about zero?” I interjected.

“Oh, 0, 1, 2, 3, and 4.”

“Really 4?  How many numbers is that with 4 in there?  Count them.”

Hammie started out counting.  “1, …”

“Make sure you start with zero.”

“0, 1, 2, 3, 4,” she took time to look at her five fingers that were now up.

“Too many numbers right?  We only want four numbers for base 4 just like there were 10 single digit numbers in base 10.  Got it?”

“I think so.”

“So, how many single digit numbers in base 4?”

“4”

“What are they?”

“0, 1, 2, and 3.”

“Sweet!  What’s the biggest single digit in base 4?”

“3!”

“Cool!  So, the biggest single digit is always one less than the base.  In base 10 it was 9.  In base 4 it was 3.”  We got off the bus at our stop, and trundled up the hill, talking about number bases as we made our way through the chill night air up to the house.

The Base Game
We spent time on the next several bus rides going over all sorts of bases.  I figured worst case, the kid was working on counting and on subtracting one.  What could we lose?

Before long, she could habitually respond with the correct answers to my questions about number bases.  As the game became easy, I began to plan my next question.  What happens when you run out of room in your single digit?

Next:
When digits are all filled up.


No comments: