Radix economy
   HOME

TheInfoList



OR:

In mathematics and computer science, optimal radix choice is the problem of choosing the base, or
radix In a positional numeral system, the radix (radices) or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal system (the most common system in use today) the radix is ten, becaus ...
, that is best suited for representing numbers. Various proposals have been made to quantify the relative costs of using different radices in representing numbers, especially in computer systems. One formula is the number of digits needed to express it in that base, multiplied by the base (the number of possible values each digit could have). This expression also arises in questions regarding organizational structure, networking, and other fields.


Definition

The cost of representing a number ''N'' in a given base ''b'' can be defined as : E(b,N) = b \lfloor \log_b (N) +1 \rfloor \, where we use the floor function \lfloor \rfloor and the base-b
logarithm In mathematics, the logarithm of a number is the exponent by which another fixed value, the base, must be raised to produce that number. For example, the logarithm of to base is , because is to the rd power: . More generally, if , the ...
\log_. If both ''b'' and ''N'' are positive integers, then the quantity E(b,N) is equal to the number of digits needed to express the number ''N'' in base ''b'', multiplied by base ''b''. This quantity thus measures the cost of storing or processing the number ''N'' in base ''b'' if the cost of each "digit" is proportional to ''b''. A base with a lower average E(b,N) is therefore, in some senses, more efficient than a base with a higher average value. For example, 100 in
decimal The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of th ...
has three digits, so its cost of representation is 10×3 = 30, while its binary representation has seven digits (11001002), so the analogous calculation gives 2×7 = 14. Likewise, in base 3 its representation has five digits (102013), for a value of 3×5 = 15, and in base 36 (2S36) one finds 36×2 = 72. If the number is imagined to be represented by a combination lock or a tally counter, in which each wheel has ''b'' digit faces, from 0, 1, ..., b-1 and having \lfloor \log_b (N) +1 \rfloor wheels, then E(b,N) is the total number of digit faces needed to inclusively represent any integer from 0 to ''N''.


Asymptotic behavior

The quantity E(b,N) for large ''N'' can be approximated as follows: : E(b,N) = b \lfloor \log_b (N) +1 \rfloor \sim b\ \log_b (N) = \ln(N) . : \sim . The asymptotically best value is obtained for base 3, since b \over \ln(b) attains a minimum for b = 3 in the positive integers: : \approx 2.88539\,, : \approx 2.73072\,, : \approx 2.88539\,. For base 10, we have: : \approx 4.34294\,.


Steiner's problem

The closely related
continuous optimization Continuous optimization is a branch of optimization in applied mathematics. As opposed to discrete optimization, the variables used in the objective function are required to be continuous variables—that is, to be chosen from a set of ...
problem of finding the maximum of the function f(x)=x^, or equivalently, on taking logs and inverting, minimizing \tfrac for continuous rather than integer values of x, was posed and solved by
Jakob Steiner Jakob Steiner (18 March 1796 – 1 April 1863) was a Swiss mathematician who worked primarily in geometry. Life Steiner was born in the village of Utzenstorf, Canton of Bern. At 18, he became a pupil of Heinrich Pestalozzi and afterwards st ...
in 1850. The solution is
Euler's number The number is a mathematical constant approximately equal to 2.71828 that is the base of the natural logarithm and exponential function. It is sometimes called Euler's number, after the Swiss mathematician Leonhard Euler, though this can ...
e\approx 2.71828, the base of the
natural logarithm The natural logarithm of a number is its logarithm to the base of a logarithm, base of the e (mathematical constant), mathematical constant , which is an Irrational number, irrational and Transcendental number, transcendental number approxima ...
, for which \frac=e\approx 2.71828\,. Translating this solution back to Steiner's formulation, e^\approx 1.44467 is the unique maximum of f(x)=x^. This analysis has sometimes been used to argue that, in some sense, "base e is the most economical base for the representation and storage of numbers", despite the difficulty in understanding what that might mean in practice. This topic appears in
Underwood Dudley Underwood Dudley (born January 6, 1937) is an American mathematician and writer. His popular works include several books describing crank mathematics by pseudomathematicians who incorrectly believe they have squared the circle or done other im ...
's '' Mathematical Cranks.'' One of the eccentrics discussed in the book argues that e is the best base, based on a muddled understanding of Steiner's calculus problem, and with a greatly exaggerated sense of how important the choice of radix is.


Comparing different bases

The values of E(b,N) of bases ''b''1 and ''b''2 may be compared for a large value of ''N'': : \approx = = \, . Choosing e for b_2 gives : \approx = \, . The average E(b,N) of various bases up to several arbitrary numbers (avoiding proximity to powers of 2 through 12 and ''e'') are given in the table below. Also shown are the values relative to that of base ''e''. E(1,N) of any number N is just N, making unary the most economical for the first few integers, but this no longer holds as ''N'' climbs to infinity. :


Ternary tree efficiency

One result of the relative economy of base 3 is that
ternary search tree In computer science, a ternary search tree is a type of trie (sometimes called a ''prefix tree'') where nodes are arranged in a manner similar to a binary search tree, but with up to three children rather than the binary tree's limit of two. Li ...
s offer an efficient strategy for retrieving elements of a database. A similar analysis suggests that the optimum design of a large telephone menu system to minimise the number of menu choices that the average customer must listen to (i.e. the product of the number of choices per menu and the number of menu levels) is to have three choices per menu. In a -ary heap, a
priority queue In computer science, a priority queue is an abstract data type similar to a regular queue (abstract data type), queue or stack (abstract data type), stack abstract data type. In a priority queue, each element has an associated ''priority'', which ...
data structure based on -ary trees, the worst-case number of comparisons per operation in a heap containing n elements is d\log_d n (up to lower-order terms), the same formula used above. It has been suggested that choosing d=3 or d=4 may offer optimal performance in practice. Brian Hayes suggests that E(b,N) may be the appropriate measure for the complexity of an
Interactive voice response Interactive voice response (IVR) is a technology that allows telephone users to interact with a computer-operated telephone system through the use of voice and DTMF tones input with a keypad. In telephony, IVR allows customers to interact with a ...
menu: in a tree-structured phone menu with n outcomes and r choices per step, the time to traverse the menu is proportional to the product of r (the time to present the choices at each step) with \log_r n (the number of choices that need to be made to determine the outcome). From this analysis, the optimal number of choices per step in such a menu is three.


Computer hardware efficiencies

The 1950 reference ''High-Speed Computing Devices'' describes a particular situation using contemporary technology. Each digit of a number would be stored as the state of a ring counter composed of several
triode A triode is an electronic amplifier, amplifying vacuum tube (or ''thermionic valve'' in British English) consisting of three electrodes inside an evacuated glass envelope: a heated Electrical filament, filament or cathode, a control grid, grid ...
s. Whether
vacuum tube A vacuum tube, electron tube, thermionic valve (British usage), or tube (North America) is a device that controls electric current flow in a high vacuum between electrodes to which an electric voltage, potential difference has been applied. It ...
s or
thyratron A thyratron is a type of gas-filled tube used as a high-power electrical switch and controlled rectifier. Thyratrons can handle much greater currents than similar hard-vacuum tubes. Electron multiplication occurs when the gas becomes ionized, pro ...
s, the triodes were the most expensive part of a counter. For small radices ''r'' less than about 7, a single digit required ''r'' triodes. (Larger radices required 2''r'' triodes arranged as ''r''
flip-flops Flip-flops are a type of light sandal-like shoe, typically worn as a form of casual footwear. They consist of a flat sole held loosely on the foot by a Y-shaped strap known as a toe thong that passes between the first and second toes and around ...
, as in
ENIAC ENIAC (; Electronic Numerical Integrator and Computer) was the first Computer programming, programmable, Electronics, electronic, general-purpose digital computer, completed in 1945. Other computers had some of these features, but ENIAC was ...
's decimal counters.) So the number of triodes in a numerical register with ''n'' digits was ''rn''. In order to represent numbers up to 106, the following numbers of tubes were needed: : The authors conclude,


See also

*
Ternary computer A ternary computer, also called trinary computer, is one that uses ternary logic (i.e., base 3) instead of the more common binary system (i.e., base 2) in its calculations. Ternary computers use trits, instead of binary bits. Types of states ...
* List of numeral systems


References

{{Reflist


Further reading

*S.L. Hurst, "Multiple-Valued Logic-Its Status and its Future", ''IEEE trans. computers'', Vol. C-33, No 12, pp. 1160–1179, DEC 1984. *J. T. Butler, "Multiple-Valued Logic in VLSI Design, ” IEEE Computer Society Press Technology Series, 1991. *C.M. Allen, D.D. Givone “The Allen-Givone Implementation Oriented Algebra", in ''Computer Science and Multiple-Valued Logic: Theory and Applications'', D.C. Rine, second edition, D.C. Rine, ed., The Elsevier North-Holland, New York, N.Y., 1984. pp. 268–288. *G. Abraham, "Multiple-Valued Negative Resistance Integrated Circuits", in ''Computer Science and Multiple-Valued Logic: Theory and Applications'', D.C. Rine, second edition, D.C. Rine, ed., The Elsevier North-Holland, New York, N.Y., 1984. pp. 394–446. Positional numeral systems Computer arithmetic Ternary computers Information_theory