Halloween = Christmas?!
Since you were in preschool, you were taught your numbers, 0 through 9. Have you ever wondered why there are exactly 10 digits? Why doesn’t the number 10 have its own symbol?
Every number is just a set of digits; the number of digits available to be placed in each spot is determined by the base system we’re using. As a rule, if you have a base system with x digits, the first value (counting from the right) is the digit multiplied by x^0, or 1. Similarly, the next value is the digit multiplied by x^1, and so on.
Let’s apply this to something we’re all similar with, the denary system (or base 10) , we use it in everyday life, it has 10 digits, (hence denary or decimal), if we have a number like 1467 (one thousand four hundred and sixty-seven), the first value, 7, is just the digit 7 itself multiplied by 10^0, or just 1. The second value is 6 multiplied by 10^1 and third is 4 multiplied by 10^2, fourth i 1 multiplied by 10^3. Putting this all together we essentially have 1000+400+60+7, (notice that the 0 in each number are the subsequent powers of 10 multiplied by 0).
In computer science, 2 base systems are used the most, those are: binary and hexadecimal. Binary, which you probably have heard of, only has 2 digits (hence bi), 0 and 1. For example, 0110 is 6 (0 * 2^3 + 1 * 2^2. + 1 * 2^1 + 1 * 2^0). This is useful because in computers, all decisions and processes are governed by whether or not the output is a 0 or 1. Let’s say we have a transistor, which acts as a way to convert physical inputs, electrons, into an output, hence the binary system is used as it incorporates the 2 states in which the transistor can be found in, under high voltage, a 0, or low voltage, a 1. These chains of 0s and 1s allow your apps and games to run. A single digit, 0 or 1, is called a bit; 8 of these are called a byte. Wouldn’t it be useful to have a way to represent such big numbers faster and easier?
This brings us to the hexadecimal system, 16 digits. 0-F. Yes, they ran out of numbers, so they started using letters. There is a variety of uses for this, most notably in networking, particularly in ipv6. For example, 3F is 63 (3 * 16^1 + 15 * 16^0).
Therefore, 25 in Decimal (25 Dec) is 25 (2 * 10^1 + 5 * 10^0), and 31 in Octal (31 Oct) is 25 (3 * 8^1 + 1 * 8^0). And so, to conclude, why do programmers get Christmas and Halloween mixed up, why does Halloween = Christmas in the techy world of computer science? Because 25 Dec = 31 Oct....
- Wiktor Podlewski