Number Bases

From Compsci.ca Wiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 22:55, 30 March 2009

Number Bases

In math and computer science, numbers are often taken for granted, but understanding them is absolutely essential. The first thing to understand about numbers is how they're written, and for that we have to understand number bases.

Decimal

The base we're all raised on these days is base 10. We all know that in decimal representation "1" is one, "2" is two" and "456" is four hundred and fifty-six, but how does this actually work? How do we know that that "4" being where it indicate four hundred and how does the 5 being where it is indicate fifty?

In the case opf 456, we can see this as follows.

456 broken down
4 x 100 5 x 10 6 x 1

Of course, if you know anything about exponents, you should notice that there's a very simple pattern here.

456 broken down further
4 x 100 5 x 10 6 x 1
4 x 102 5 x 101 6 x 100

We can factor this out further

Factoring out the base
4 x 100 5 x 10 6 x 1
4 x 102 5 x 101 6 x 100
4 x b2 5 x b1 6 x b0
where b = 10

Now we should be able to extrapolate this pattern out to deal with decimal numbers of any length.

Personal tools