Tuesday, September 04, 2007

Multiplication and addition in different bases (plus binary)

As promised(!) I will draw up some multiplication and addition tables, but for base 12! (Why not 13? Well an exercise in the book was to draw up base 12, and ... you'll soon find out why).

I have previously mentioned calculations in base 10 and base 13, and now have gone for something in between i.e. base 12. A quick recap (otherwise known as a 'copy and paste job' and it's allowed because this is a new post! :p) If we let k denote the integer we have, then k can be written in base 12 by the following formula,

k = (a_n \times 12^n) + (a_{n-1} \times 12^{n-1}) + ... + (a_1 \times 12) + a_0

where a_n, a_{n-1},... a_1,a_0 are integers from zero to 11 and n is any positive integer. It must be noted that we require digit symbols for '10' and '11', so we'll write A for ten and B for eleven.

Multiplication in my opinion, is much simpler than addition; but that is only initially as you will soon see. Since I'm in a slow mood today, I will be taking things slowly! Below is a blank table for addition in base 12. Guess what you're meant to do next? Well if you're not familiar with basis, have a bash at the table below and see how you do:

\begin{array}{c|ccccccccccc}+_{12} &1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B   \\\cline{1-12} 1 &    &  & & & &  \\ 2 &  &  & & & &   \\ 3 &  & & & &\\ 4 \\ 5 & & \\  6 & \\ 7\\ 8 & & & & &  & & \\  9 & & & & & & \\ A \\ B\\ \end{array}

I'll get you started... 1+1= , actually wait 1+2=3 should get you started! (I couldn't lie about 1+1 you see.) Now I'll ramble for a bit whilst you're filling the table in. I had initially tried completing an addition table for base 7, and is it necessary to state that I failed miserably at the addition one? I had naively, or stupidly gone into modulo arithmetic mode so using the table above, 9+4=1 in base 12, or so I had claimed. It doesn't if you've done the same as me, which I doubt since only I seem capable of bringing congruences into everything! (We got of on a rocky start you see...)

Rambling over, the completed table should look like:*

\begin{array}{c|ccccccccccc} +_{12} &1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B\\\cline{1-12} 1 &2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B & 10   \\ 2 &3 &4 & 5 & 6 & 7 & 8 & 9 & A & B & 10 & 11    \\  3 &4 & 5 & 6 & 7 & 8 & 9 & A & B & 10 & 11 & 12 \\  4 &5 & 6 & 7 & 8 & 9 & A & B & 10 & 11 & 12 & 13 \\ 5 &6 & 7 & 8 & 9 & A & B & 10 & 11 &12 & 13 & 14  \\  6 &7& 8 & 9 & A & B & 10 & 11 & 12 &13& 14 &15  \\  7 &8 & 9 & A & B & 10 & 11 & 12 & 13 & 14 &15 &16 \\ 8 &9 & A & B & 10 &11 &12 &13 &14 &15 & 16 & 17  \\ 9 &A & B & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 &18 \\  A &B & 10 & 11 & 12 & 13 & 14 & 15& 16& 17 & 18 & 19 \\  B &10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 1A \\  \end{array}

And yes, I have asked myself WHY BASE 12! Some of you may have spotted the pattern and completed it by that (I did), but if you haven't gone (mod12) then you should all be OK. I'll do an example: 9+3 = 12 (in base 10) but 10 in base 12. I believe its pronounced one-two? (but don't quote me on that!). We get from 12 to 10 by using the formula above as follows:

k=12= 1 \times 12 + 0

In this case a_1= 1 and a_0= 0, hence because k=a_0a_1; 12 = 10 in base 12. (If you look at the previous post, in base 10 we actually have 1 \times 10 +2, which is were we get the 12 from). If you have any problems with that or if I've written anything incorrectly, please do let me know. The key to this is that the meanings of the digits depends on their position.

Addition and multiplication both become *coughs* trivial, once you've got the hang of things. You'll notice this if when doing the sum 12+3, you think to yourself what 15 is in terms of base 12. (You'll get the spidey feeling!) If you think addition and multiplication in base 12 is tedious, then I would recommend trying a smaller base to get to grips with things. I didn't manage to complete the multiplication table for base 12, and so the reader may wish to complete it as an exercise(!). Well I have filled in the 'boring' and easy answers so you should have less reason to be bored.

\begin{array}{c|ccccccccccc} \times_{12} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B\\\cline{1-12} 1 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B\\ 2 & 2 & 4 & 6 & 8 & A & 10 & 12 & 14 & 16 & 18 & 1A\\  3 & 3 & 6 & 9 & 10 & 13 & 16 & 19 & 20 &  &  &  \\  4 & 4 & 8 & 10 & 14 & 18 &20 &  \\  5 & 5 & A & 13 & 18 & 21  \\  6 & 6 & 10 & 16 & 20 &  & 30 & & & & 50 &   \\  7 & 7& 12 & 19 &  &  &  & 41 & \\ 8 & 8 & 14 & 20 &  &  & 40 &  & 54 &  \\ 9 & 9 & 16 &  &  &  &  & &  & 69 & \\ A & A & 18 &  &  &  & 50 &  &  &  & 84 \\ B & B & 1A & &  & && && & 92 &A1 \\ \end{array}

If you're feeling up to it, you could always check my answers!! (My advice is to not linger too much on addition and multiplication, once you've got that 'spidey feeling'.)

I have previously talked about multiplication in different bases, so won't dwell on this for long. I will just do a quick example for one of the numbers that haven't been done in the table, and 7 x 8 it is. In base 10, (7 x 8=56). We know that 5 x 12 =60, so we must have that 56= 4 x12 + a_0. A simple subtraction then tells us that we must have a_0=8, hence in base 12, 56 is equal to 48. (56= 4x12 + 8) If that doesn't register, have a read through my previous post here.


Woo, thankfully that is all I am going to say on multiplication and addition in different bases. Well now quite all, but I most definitely will never choose a base bigger than nine.

The second part of this post is to do with binary. What kind of a mathematician is one who is clueless of binary? Or should mathematicians know what binary is? Once upon a time in Blogistan the following image surfaced:

I knew that the other two boxes were, but the joke was lost on me. Binary numbers, for those who might be as ignorant as I was (which I doubt), are numbers in base 2. I understood that you could only use 0 or 1, since in one supervision, my PT had done something with binary numbers in connection with the Chinese triangle. (I had only copied it down but not understood it). The following 'joke' also used to go whoosh over my head:

"There are 10 kinds of people in the world, those who understand binary math, and those who don't."

I hope that having read my posts about different bases, you are now 'in on the joke'. Yes, you deserve a good old chuckle at that and at the people who think that says 10! (Oops, was I not meant to write that?) I am still chuckling at how stupid (in want of a better word) this all seems; and at my own stupidity too. I feel like I'm part of some 'cool club' now - those who know what the heck binary and different bases are. The question now being asked again is, should mathematics student know about all this before starting their degree?

What I find good about other bases, is that I have more freedom of some sort. Previously I had only ever worked in base 10 you see, but now there is no restriction. I can even dilebrately annoy people who ask me what 7x8 is by saying it's 48, or by asking what base they're working in! :D. Another question that I will look into is whether different bases are actually used in maths, and what they're used for. (Apart from binary maybe). So this concludes the base posts I think.



*If you must know I had made a mistake when typing the second addition table. Upon correcting it, the formula wouldn't work. I changed and triple checked everything, but still it was being a nuisance. In frustration, I opened up TeXnic centre and tested it there. It still didn't work. If previously I was frustrated, I was now on the verge of turning the computer off! I had written, 'begin{array}' instead of '\begin{array}'. :o

8 comments:

steve said...

DId you know that there are long established societies who promote the use of counting in base 12? See Dozenal Society of Great Britain and the Dozenal Society of America sites. The latter has a dozenal clock at the bottom of the page along with the date in base 12. It's not clear if the visitor number is in base 10 or 12.

beans said...

Wow, that's pretty cool! I'm not against it, but if memory of base 10 was wiped out of existence, then 12 is not too bad. (I mean it seems natural in a sense, because eleven and twelve don't end in 'teen').

I would put my money on it being in base 12; and I wouldn't mind a watch in base 12! Maybe then I would actually wear the watch. :p

egm said...

I have a t-shirt that reads "There are 10 kinds of people in the world, those who understand binary, and those who don't.". I got it from Think Geek. They don't seem to have it any more.The first time I saw it, I read it as ten until I got to the binary part and I realised my mistake. I had to get that t-shirt at all cost! Tis sad they don't have it any more.

beans said...

Actually they do have it. :D (I'll content myself with saving the picture on my computer!)

They also have another cool gadget: a binary watch! I guess it's never too early to hint for presents. :p

Do a search for binary, and lots of other cool t-shirts are available as well.

Gitonga said...

Guess what. I have that watch. Yes. That's how much of a geek I am! But the t-shirt that they didn't have at the time I bought the first one that I just have to get is this one. When I first saw it, I didn't get it. But after thinking about it for a while, it came to me and I was so mad at myself for not getting it initially! Too bad I'm not stateside any more to easily get them, but I can always order and have someone coming this way to bring it with them.

beans said...

Hi Gitonga,

That's brilliant! I best see if I can find the watch available in the UK, (we know what my first loan installment is going to be spent on.) :o

I don't know much about hexadecimals, so it will take a while longer for me to understand it! (I guess that will be a really long while indeed).

On the site it says that they deliver abroad, so you might still be able to get it (but it'll probably be more expensive).

Anonymous said...

the lower-right-hand entry
in the addition table
should be 1A (not "A").
vlorbik

beans said...

Hi Vlorbik,

Thank you - I will correct it in two ticks. :)