The good folk of Aberfeldy congregation, in a spirit of togetherness and camaraderie, have been having a twice-weekly lock-down quiz with each team taking a turn to be Question Master. It's all great fun and there is much variety in subject matter and style. Now, the purpose of a quiz, in my opinion, is primarily to WIN! On the other hand someone who knows all the answers may have won, but has he benefited from his prowess? Has he learned anything? Learning something new, being fascinated by an answer, or being motivated to go off and do research into something one previously knew nothing about is far more important.
In my quizzes I always include a maths question. I am no mathematician but I do find numbers and their relation to the world around us quite enthralling. It seems that I am in a minority. It was suggested that my maths questions should be banished to room 101; and that gave me an idea for another question. 101 looks like a binary number: convert binary 101 to decimal. The answer is 5 but what was most exciting was that Rachael asked why that was the answer; that has prompted me to write up an explanation.
To understand binary, or any other base for that matter, requires that we understand the base that we use in everyday life without conscious thought – base ten, decimal. In this system there are but ten numerals, zero through to nine. We know what each digit represents: if we have three sweeties Luke, Josh and Naomi can have one each. If there are five then John and Rachael can each have a sweety too. We would need forty or so to provide one for every member of the congregation. It would be sad if they had to go without because we had no way of representing a number greater than nine. We would have to place five orders of eight sweets. Yet we have a means of combining those numbers such that we can count well beyond nine, indeed to infinity and beyond. We have to combine them, otherwise we would need an infinite number of single marks to represent every possible value. That would be impractical. We mix up those ten numerals according to some rules. Our brains are trained to do instant multiplication and addition calculations so that we can evaluate the information. In the sum 9 + 1 in what way does 10 represent the answer, given that both one and zero are less than nine and the answer has to be greater than nine? Subconsciously we are taking the first number as a group of ten and then adding on the individual units. Thus:
1 x 10 + 0 = 10
1 x 10 + 9 = 19
19 + 2 = 2 x 10 + 1 = 21
The first digit tells us how many groups of ten to which we must add the units. To go beyond 99 we need to create another group, this time a group of ten lots of ten. We call it, in English, a hundred but it is really 10^2, or 10 x 10. When we see the number 275 our brain calculates (2 x 10 x 10) + (7 x 10) + (5 x 1) and that has meaning to us. 'What? 275 Quid? You must be joking'. Or, 'Cor, that's cheap'.
Another way or representing the above is (2 x 10^2) + (7 x 10^1) + (5 x 10^0) and you will see a pattern emerging. Please note that any number raised to the power zero always equals one, and any number raised to the power one always equals itself. What we call a thousand is really 10^3 or 10 x 10 x 10. You get the drift. Try it out. On a calculator 'power of' is achieved by use of the caret (^) symbol. 10^3 = 1000.
Exactly the same logic can be applied to every other base. In binary, base two, there are only two digits: one and zero. Nevertheless huge numbers can still be represented. Instead of working in groups of ten we are restricted to using groups of two, simply because numbers 2 to 9 do not exist in this base. Here's nought to ten in binary representation:
2^3 2^2 2^1 2^0
8 4 2 1
0
1
1 0
1 1
1 0 0
1 0 1
1 1 0
1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
Working from right to left our column headings are 2^0, 2^1, 2^2, 2^3, 2^4, 2^5 etc. Evaluated into decimal they are 1, 2, 4, 8, 16, 32... Once this is understood, evaluating a binary code into something more meaningful to humans is simply a process. Follow the rules. Binary 101 = (1 x 2 x 2) + (0 x 2) + (1 x 1) = (1 x 2^2) + ( 0 x 2^1) + (1 x 2^0) = decimal 5.
If you wanted to work in base five (I don't know why you would, but you might) 423 = (4 x 5^2) + (2 x 5^1) + (3 x 5^0) = 113. The rules are exactly the same. Incidentally, ordering those five batches of eight sweeties gives us an example of base eight, octal: 50 octal equals 40 decimal. If you are interested in an explanation of hexadecimal, base 16, and how that relates to binary and computing, let me know.
But why binary? What's the point? That is the question that I remember struggling with at school. I don't think that I ever had it satisfactorily answered. As I couldn't see the point I didn't pay enough attention. But now I know. Binary is absolutely fundamental to our digital world. A computer is a collection of millions of switches that cause electrons to flow or not flow. Am I ON, or am I OFF? Am I 1 or 0? Clever people then come along and create operating systems to translate this hardware activity into something that we humans can relate to. There are lots of them – Unix, Linux, DOS, Windows, Android... If output n is ON then display this character or colour, else display something different. Software developers build programs and applications that do useful and fun things for us. There are variations; pulses of light are sent along a fibre-optic cable. Software then decodes those patterns and sequences into information meaningful to us. To illustrate, we might think of a lighthouse. Each one has a unique pattern of flashes. Timing them, and then doing a lookup, will tell the sailor which lighthouse he can see and therefore will give him his location. ON/OFF. Information. A transmitter sends out radio waves at certain frequencies. Your receiver (smart phone) is programmed to accept, decode and present the information to you. That's all it boils down to. 1 or 0. Binary choices. One or the other. This or that. Light or dark. Right or wrong. Good or bad. It's all around us, invisible but pervasive. As long as there is a boffin then we don't need to understand. Millennials were once described as people who can't live without technology but have no idea how it works. They don't need to. It's broke – throw it away. It's too slow – get a faster one. There's nothing wrong with it – throw it away anyway. Keep up with the trend. And with the advent of 5G, the amount of data flowing around the globe will just explode. Binary is here to stay.
PS related to this is Boolean Algebra. See below if you are interested.
Back