During Christmas dinner at my house we always have Christmas crackers, those colourful paper tubes that pop with a loud bang when you pull them apart to find a paper crown, jokes and a tiny toy inside.
This year, my toy was a “magic calculator,” which was a set of six small cards, each of which had a couple of dozen or so numbers printed on it.
The trick was that you asked another person to pick one of the cards and choose a number from that card without telling you what it was. Then you asked them to look at all the cards, and tell you which of the cards had their number on it.
From this information alone, you could tell them the number they had chosen (as long as you knew the trick, which was to add together the numbers in the top left corner of each selected card). Amazingly, the sum was always their secret number.
To the unsuspecting person, this seems like magic, but to the magician who knows that there is a secret addition, it looks suspiciously like math: the question was, how did the trick work?
All of us at the dinner table puzzled over this for a few minutes until my son, who is in Grade 12 and is a bit of math whiz, looked at it and immediately announced to the surprise of everyone else: “It’s easy – it’s just a binary code.”
Binary, or “base-2,” is another way of representing numbers that uses only the numerals 0 and 1 instead of 0 through nine.
My son was able to deduce that binary numbers were behind the magic trick because he combined careful observation skills with a good math education that had prepared him to recognize a certain pattern when he saw it.
The numbers in the top left corner of each card were not random, but a specific sequence: 1, 2, 4, 8, 16, 32, which are the powers of 2 (and also just happen to be written in binary as 1, 10, 100, 1000, 10,000, and 100,000).
Furthermore, the top left corner number was always the lowest number on each card. And finally, the highest number on every card was 63 (equal to 111111 in binary).
All this information together tipped him off that the six cards were just a way of representing all of the binary numbers that have up to six digits (which are the equivalent of all of the ordinary numbers up to and including 63).
Each card represented one of the six digits, and if the binary number had a “1″ in that place, then the ordinary or “base-10″ version of the number appeared on that card; if it had a “0″ in that place, the base-10 number was not on the corresponding card.
As an example, the number 37 written in binary is “100101.” Thus “37″ would appear only on the cards having top corner numbers of “32″ (representing the left-most binary digit in “100101″), “4″ (representing the fourth digit from the left) and “1″ (the last digit on the right). “37″ would not appear on any of the other cards because the binary number has a “0″ in the places represented by those cards (i.e. the second, third and fifth digits from the left, the cards for which have “16″, “8″ and “2″ as their top corner numbers).
Adding together the top corner numbers of the selected cards then gives 32 4 1 = 37.
Since any base-10 number can be represented by an equivalent binary number, this trick can be extended to work for any number at all if you have enough cards to work with and the patience to do a lot of addition, but six cards is more than enough to make a very impressive party trick.
However, binary numbers are a lot more useful than just for magic tricks.
One common application is under our noses all the time in electronic devices ranging from smart phones to computers.
As amazing as these devices have become in recent years, all of them fundamentally operate on nothing more complicated than a lot of binary numbers with lots of digits.
Any piece of information, whether it is a number, a letter, a text symbol, a colour, a memory address or a specific pixel location on a display screen can be coded as binary numbers using a series of voltages that are either on or off (“1″ or “0″).
Binary numbers quite literally flash unseen through all of these devices to power our electronic world. Now that’s magic!
My son the math whiz also has a T-shirt with the slogan “There are 10 kinds of people in the world: those who understand binary and those who don’t.”
So which kind are you: Group 1 or Group 10?
Dr. Todd Arsenault is the president of the Science East Association. The mission of the association is to inspire and inform through hands-on science experiences. See www.scienceeast.nb.ca. His column appears every fourth Wednesday.
