|MadSci Network: Computer Science|
Anything that can be stored in the memory of a computer can be represented as a number --- and, many would argue, is.
Specifically, anything stored in the memory of a (digital) computer is a bunch of bits, each bit having the value 0 or 1. An example of a simple way to represent any bunch of bits (of some given length) as a number is as follows. First, assign some order to the bits, for example by defining the least-significant bit of the lowest-addressed byte to be the "first" bit, and the most-significant bit of the highest-addressed byte to be the "last" bit. Next, assign a "weight" to each bit in the following way: the first bit gets weight 1, the second bit weight 2, and each succeeding bit twice the weight of its predecessor. Finally, add the weights of the bits whose values are 1. The result will be an integer (possibly very large) that uniquely represents the bunch of bits from which you built it.
Try the links in the MadSci Library for more information on Computer Science.