We live in a decimal world, meaning we live in a base 10 world. In our number system, there are ten digits, 0-9. Once we reach the maximum value (9) in a column, we roll it over to the start (0), and increment the next column to the left.
_8, _9, 10, 11,...,18, 19, 20, ...
The decimal number system, like all number systems, has place values. Place values are the standard unit value for each column in a number. Place value increase from right to left. The place values are determined by the powers of the base, starting at 0. The number 123,456 can be represented with place values as follows:
1 | 2 | 3 | 4 | 5 | 6 |
100000 | 10000 | 1000 | 100 | 10 | 1 |
105 | 104 | 103 | 102 | 101 | 100 |
By examining how our number system works, we can then find how other number systems work as well. So, if we were to talk about base 8(octal), then there would be 8 digits, 0-7. The place values, from right to left, are 8
0, 8
1, 8
3...
The common bases in computer science are as follows:
Base | Name | Digits | Columns |
2 | Binary | 0-1 | ...16, 8, 4, 2, 1 |
8 | Octal | 0-7 | ...512, 64, 8, 1 |
10 | Decimal | 0-9 | ...1000, 100, 10, 1 |
16 | Hexadecimal | 0-F | ...4096, 256, 16, 1 |
Competition problems in Number Systems usually deal in:
- Converting Numbers between bases
- Performing Arithmetic on bases (+, -, *, /)
- Performing Arithmetic on Mixed bases