Number systems

One use of strings is to represent integers in a positional number system. In this context, symbols are called digits, a string of digits is called a numeral, and the size of the alphabet — the number of available digits — is the system’s base. Every nonnegative integer is represented by a unique numeral in which a digit’s contribution depends on its position in the numeral. Specifically, where positions in a numeral are assigned right-to-left starting with 0, the digit d in position p contributes d\times b^p in a base b system whose digits are ordered 0, \ldots, d,\ldots, b-1. A numeral’s value is the sum of its digits’ contributions. Some examples:1

347_{10} = 3\times 10^2 + 4\times 10^1 + 7\times 10^0 = 3\times100 + 4\times10 + 7 = 300+40+7
3047_{10} = 3\times 10^3 + 0\times10^2 + 4\times 10^1 + 7\times 10^0=3000+0+40+7
1101_2 = 1\times 2^3 + 1\times 2^2 + 0\times 2^1 + 1\times2^0 = 8 + 4 + 0+ 1 = 13
2302_4 = 2\times 4^3 + 3\times 4^2 + 0\times 4^1 + 2\times4^0 = 128 + 48 + 0 + 2 = 178
203_8 = 2\times 8^2 + 0\times 8^1 + 3\times 8^0 = 128 + 0+3 = 131

We augment some of the previous models to represent each string’s numeric value. The ‘keyboard lengthened’ model represents each digit’s contribution by block length (in the x dimension), whereas the various ‘lofted’ models do this by means of each object’s height in the vertical y dimension.

Positional notation

  1. Subscripts on the left side of these equations indicate the base, and expressions on the right side are expressed in decimal (base 10).