Bits: Numbers as Bits (Part I)

If you think dogs can’t count, try putting three dog biscuits in your pocket and then giving Fido only two of them.

Phil Pastoret

In mathematics, a base or radix is the number of different digits that a system of counting uses to represent numbers.  the most common base used today is the decimal system. Because “dec” means 10, it uses the 10 digits from 0 to 9.

Wikipedia

As promised, we’re taking a step back from the historical approach for now. Our journey continues with some context which will make it easier to work with and reason about bits and binary numbers.

There is a lot of information online covering numerical bases and their properties. Here, we will focus on demystifying the basics by presenting them in a more straightforward language.

What is a Bit?

The bit is a basic unit of information in computing and digital communications. The name is a portmanteau of binary digit.[1] The bit represents a logical state with one of two possible values. These values are most commonly represented as either “1”or”0″, but other representations such as true/falseyes/no+/, or on/off are common.

https://en.wikipedia.org/wiki/Bit

A bit is functionally a two-state switch. Think of an ordinary “mechanical” one-button lightswitch. Just the lightswitch, not tied to anything else. It can only have two states, which you can observe visually: up or down, pushed or not pushed, etc. A bit is a lot like that: it can hold either a value of 0 or a value of 1.

Of course, you can assign more meaning to a bit than just 0 and 1, and we will discuss this possibility in one of our next posts. In this article, we will look at 0 and 1 as numbers.

What is Counting?

Counting is the process of determining the number of elements of a finite set of objects. The traditional way of counting consists of continually increasing a (mental or spoken) counter by a unit for every element of the set, in some order, while marking (or displacing) those elements to avoid visiting the same element more than once, until no unmarked elements are left; if the counter was set to one after the first object, the value after visiting the final object gives the desired number of elements. 

https://en.wikipedia.org/wiki/Counting

Everyone is familiar with counting. It’s part of our everyday lives. However, much of this happens automatically through memorized patterns, so we’re not usually aware of the details of what is going on when we count.

I find the above-mentioned definition, while correct, possibly confusing to some people. What is counting? Just count, use numbers.

In layman’s terms, you start with a pile of things that you need to count, and start moving them to another pile. As you do that, you use a mental or physical counting board/abacus to keep track of how many objects you have moved so far.

Hypothetically, if you had an abacus with a single column, with the same number of beads as the objects you are trying to count, then that single column would be enough to “physically count”, without putting names to numbers. But (natural) numbers, though countable, are infinite. So we need to reason about them in more abstract ways.

As a practical totally fabricated example, let’s say you are an ancient-times merchant and you own a single column, ten-bead abacus, and each week you know you have to receive ten animal skins as part of a trade agreement. With little instruction, you’d for sure be able to know whether there are ten animal skins in a pile or to take ten animal skins from a pile using this method, never knowing about numbers.

When the number that you need to count increases, it becomes impractical to use that single column method. How would you come up with the number if there were, say 3000 beads on the single-column without recounting? How would you deal with interruptions?.

Assigning a name or symbol for that quantity also becomes paramount. That’s where numerical systems, or thinking of quantities as “piles of piles” come into play (more on that below). In a sense, numerical systems are there to help us communicate by naming quantities.

There are some … who think that the number of the sand is infinite in multitude … again there are some who, without regarding it as infinite, yet think that no number has been named which is great enough to exceed its multitude … But I will try to show you [numbers that] exceed not only the number of the mass of sand equal in magnitude to the earth … but also that of a mass equal in magnitude to the universe.

Archimedes, 3rd century B.C., The Sand-Reckoner

Archimedes made a surprisingly accurate prediction for the number of m grains of sand that would fit in the universe in his writing The Sand-Reckoner. And this approximation was fueled by trying to name some “mass equal in magnitude to the universe”. He needed to know what the universe’s “mass” would be, to exceed it Even as far back as the 3rd century B.C. naming big quantities was important, and to this day mathematicians fight about who can name the biggest number.

Counting in Base 10 (Decimal Base)

Let’s take a trip down memory lane to refresh our memories and break down the counting process into its integral parts.

  • We count in piles of 10, even if we don’t always think about it. An example of these piles are the columns of the counting board below;
  • Our piles each represent a digit from 0 up to 9;
  • The pile on the left of another pile “stands for” an amount 10 times bigger. In other words, in our counting board below, the rightmost column stands for digits, the middle column stands for tens and the leftmost column stands for hundreds;
  • The thought process for going beyond 9 within any pile while counting is: “I have reached the maximum amount I can make in this pile. I need to start a new pile here and add one to the pile on the left”; If the pile on the left had also reached its maximum, we apply the same rule to that pile, and so on;
  • In reality, we don’t have a hard limitation on the number of digits; we can always add one more pile to the left, following the same rule.

You can use the numerical input box to play around with the board see these concepts in action:

A few observations about the board:

  • There are three columns on the board, each one representing a digit. Thus, the board can represent numbers from 0 to 999.
  • Columns each have 9 beads that can be moved around to represent a digit. In other words, we have a "name" for each of the ten states of a column;

Counting in Base 2 (Binary Base)

What about counting in binary? Let's copy-paste our rules from the previous section and adapt them to having only 0 and 1 as digits. You can adapt these rules, in a similar fashion and apply them to any other base of your choosing.

  • We count in piles of 10 2, even if we don't always think about it. It will get some getting used to. An example of these piles are the columns of the counting board below;
  • Our piles each represent digits from 0 up to 9 1;
  • The pile on the left of another pile "stands for" an amount 10 2 times bigger. In other words, in our counting board below, the rightmost column stands for digits, the middle column stands for tens twos and the leftmost column stands for hundreds fours;
  • The thought process for going beyond 9 1 within any pile while counting is: "I have reached the maximum amount I can make in this pile. I need to start a new pile here and add one to the pile on the left"; If the pile on the left had also reached its maximum, we apply the same rule to that pile, and so on;
  • In reality, we don't have a hard limitation on the number of digits; we can always add one more pile to the left, following the same rule.

You can use the numerical input box to play around with the board see these concepts in action:

A few observations about the board:

  • There are three columns on the board, each one representing a binary digit. Thus, the board can represent numbers from 0 to 111 (in binary). corresponding to 0 to 7 (in decimal);
  • Columns each have 9 1 beads that can be moved around to represent a digit. In other words, we have a "name" for each of the ten two states of a column;

So how do we know that 7 is the largest number with 3 binary digits? Well, we know the maximum for each column is 1. We also know that the columns' values per unit are 4, 2, and 1, respectively. Remember that each time we "move left" through the "binary" piles the column's value per unit doubles. Adding 4 * 1 , 2 * 1 , and 1 * 1, we get 7.

We'll cover this in more detail in the next post when we will cover base conversions. Afterward, we will dive deeper into the particularities of bits and the binary numerical system.

I hope you've enjoyed this small math reminder on numerical bases, and I hope to see you next time!