Radix economy

Last updated

The radix economy of a number in a particular base (or radix) 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 is one of various proposals that have been made to quantify the relative costs of using different radices in representing numbers, especially in computer systems.

Contents

Radix economy also has implications for organizational structure, networking, and other fields.

Definition

The radix economyE(b,N) for any particular number N in a given base b is defined as

where we use the floor function and the base-b logarithm .

If both b and N are positive integers, then the radix economy is equal to the number of digits needed to express the number N in base b, multiplied by base b. [1] The radix economy 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 radix economy is therefore, in some senses, more efficient than a base with a higher average radix economy.

For example, 100 in decimal has three digits, so its radix economy is 10×3 = 30; its binary representation has seven digits (11001002) so it has radix economy 2×7 = 14 in base 2; in base 3 its representation has five digits (102013) with a radix economy of 3×5 = 15; in base 36 (2S36) its radix economy is 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 and having wheels, then the radix economy is the total number of digit faces needed to inclusively represent any integer from 0 to N.

Asymptotic behavior

The radix economy for large N can be approximated as follows:

The asymptotically best radix economy is obtained for base 3, since attains a minimum for in the positive integers:

For base 10, we have:

Comparing different bases

The radix economy of bases b1 and b2 may be compared for a large value of N:

Choosing e for b2 gives the economy relative to that of e by the function:

The average radix economies 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 radix economies relative to that of e. Note that the radix economy of any number in base 1 is that number, making it the most economical for the first few integers, but as N climbs to infinity so does its relative economy.

Base bAvg. E(b,N)

N = 1 to 6

Avg. E(b,N)

N = 1 to 43

Avg. E(b,N)

N = 1 to 182

Avg. E(b,N)

N = 1 to 5329

Relative size of
E(b)/E(e)
1 3.522.091.52,665.0
2 4.79.313.322.91.06151.0615
 
e 4.59.012.922.11.00001
 
3 5.09.513.122.21.00461.0046
 
4 6.010.314.223.91.06151.0615
 
5 6.711.715.826.31.14291.1429
 
6 7.012.416.728.31.23191.2319
 
7 7.013.018.931.31.32341.3234
 
8 8.014.720.933.01.41531.4153
 
9 9.016.322.634.61.50691.5069
 
10 10.017.924.137.91.59771.5977
 
12 12.020.925.843.81.77651.7765
 
15 15.025.128.849.82.03772.0377
 
16 16.026.430.750.92.12302.123
 
20 20.031.237.958.42.45602.456
 
30 30.039.855.284.83.24493.2449
 
4040.043.771.4107.73.98913.9891
 
60 60.060.0100.5138.85.39105.391
 

Ternary tree efficiency

One result of the relative economy of base 3 is that ternary search trees offer an efficient strategy for retrieving elements of a database. [2] 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. [1]

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 triodes. Whether vacuum tubes or thyratrons, the triodes were the most expensive part of a counter. For small radices r less than about 7, a single digit required r triodes. [3] (Larger radices required 2r triodes arranged as r flip-flops, as in ENIAC's decimal counters.) [4]

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:

Radix rTubes N = rn
239.20
338.24
439.20
542.90
1060.00

The authors conclude,

Under these assumptions, the radix 3, on the average, is the most economical choice, closely followed by radices 2 and 4. These assumptions are, of course, only approximately valid, and the choice of 2 as a radix is frequently justified on more complete analysis. Even with the optimistic assumption that 10 triodes will yield a decimal ring, radix 10 leads to about one and one-half times the complexity of radix 2, 3, or 4. This is probably significant despite the shallow nature of the argument used here. [5]

Other criteria

In another application, the authors of High-Speed Computing Devices consider the speed with which an encoded number may be sent as a series of high-frequency voltage pulses. For this application the compactness of the representation is more important than in the above storage example. They conclude, "A saving of 58 per cent can be gained in going from a binary to a ternary system. A smaller percentage gain is realized in going from a radix 3 to a radix 4 system." [6]

Binary encoding has a notable advantage over all other systems: greater noise immunity. Random voltage fluctuations are less likely to generate an erroneous signal, and circuits may be built with wider voltage tolerances and still represent unambiguous values accurately.

See also

Related Research Articles

<span class="mw-page-title-main">Binary search algorithm</span> Search algorithm finding the position of a target value within a sorted array

In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array.

In mathematics and computer programming, exponentiating by squaring is a general method for fast computation of large positive integer powers of a number, or more generally of an element of a semigroup, like a polynomial or a square matrix. Some variants are commonly referred to as square-and-multiply algorithms or binary exponentiation. These can be of quite general use, for example in modular arithmetic or powering of matrices. For semigroups for which additive notation is commonly used, like elliptic curves used in cryptography, this method is also referred to as double-and-add.

<span class="mw-page-title-main">Rounding</span> Replacing a number with a simpler value

Rounding or rounding off means replacing a number with an approximate value that has a shorter, simpler, or more explicit representation. For example, replacing $23.4476 with $23.45, the fraction 312/937 with 1/3, or the expression √2 with 1.414.

In computer science, the Akra–Bazzi method, or Akra–Bazzi theorem, is used to analyze the asymptotic behavior of the mathematical recurrences that appear in the analysis of divide and conquer algorithms where the sub-problems have substantially different sizes. It is a generalization of the master theorem for divide-and-conquer recurrences, which assumes that the sub-problems have equal size. It is named after mathematicians Mohamad Akra and Louay Bazzi.

<span class="mw-page-title-main">Binary logarithm</span> Exponent of a power of two

In mathematics, the binary logarithm is the power to which the number 2 must be raised to obtain the value n. That is, for any real number x,

Toom–Cook, sometimes known as Toom-3, named after Andrei Toom, who introduced the new algorithm with its low complexity, and Stephen Cook, who cleaned the description of it, is a multiplication algorithm for large integers.

Balanced ternary is a ternary numeral system that uses a balanced signed-digit representation of the integers in which the digits have the values −1, 0, and 1. This stands in contrast to the standard (unbalanced) ternary system, in which digits have values 0, 1 and 2. The balanced ternary system can represent all integers without using a separate minus sign; the value of the leading non-zero digit of a number has the sign of the number itself. The balanced ternary system is an example of a non-standard positional numeral system. It was used in some early computers and has also been used to solve balance puzzles.

In mathematics a polydivisible number is a number in a given number base with digits abcde... that has the following properties:

  1. Its first digit a is not 0.
  2. The number formed by its first two digits ab is a multiple of 2.
  3. The number formed by its first three digits abc is a multiple of 3.
  4. The number formed by its first four digits abcd is a multiple of 4.
  5. etc.
<span class="mw-page-title-main">Fractional part</span> Excess of a non-negative real number beyond its integer part

The fractional part or decimal part of a non‐negative real number is the excess beyond that number's integer part. The latter is defined as the largest integer not greater than x, called floor of x or . Then, the fractional part can be formulated as a difference:

In number theory, a formula for primes is a formula generating the prime numbers, exactly and without exception. Formulas for calculating primes do exist, however, they are computationally very slow. A number of constraints are known, showing what such a "formula" can and cannot be.

In number theory, the integer square root (isqrt) of a non-negative integer n is the non-negative integer m which is the greatest integer less than or equal to the square root of n,

Elias ω coding or Elias omega coding is a universal code encoding the positive integers developed by Peter Elias. Like Elias gamma coding and Elias delta coding, it works by prefixing the positive integer with a representation of its order of magnitude in a universal code. Unlike those other two codes, however, Elias omega recursively encodes that prefix; thus, they are sometimes known as recursive Elias codes.

In number theory, Mills' constant is defined as the smallest positive real number A such that the floor function of the double exponential function

<span class="mw-page-title-main">Comparison sort</span> Type of sorting algorithm that works by comparing pairs of elements

A comparison sort is a type of sorting algorithm that only reads the list elements through a single abstract comparison operation that determines which of two elements should occur first in the final sorted list. The only requirement is that the operator forms a total preorder over the data, with:

  1. if ab and bc then ac (transitivity)
  2. for all a and b, ab or ba (connexity).

A division algorithm is an algorithm which, given two integers N and D, computes their quotient and/or remainder, the result of Euclidean division. Some are applied by hand, while others are employed by digital circuit designs and software.

Non-standard positional numeral systems here designates numeral systems that may loosely be described as positional systems, but that do not entirely comply with the following description of standard positional systems:

A non-integer representation uses non-integer numbers as the radix, or base, of a positional numeral system. For a non-integer radix β > 1, the value of

In mathematics, trailing zeros are a sequence of 0 in the decimal representation of a number, after which no other digits follow.

In computer science, multiply-with-carry (MWC) is a method invented by George Marsaglia for generating sequences of random integers based on an initial set from two to many thousands of randomly chosen seed values. The main advantages of the MWC method are that it invokes simple computer integer arithmetic and leads to very fast generation of sequences of random numbers with immense periods, ranging from around to .

In mathematics, Legendre's formula gives an expression for the exponent of the largest power of a prime p that divides the factorial n!. It is named after Adrien-Marie Legendre. It is also sometimes known as de Polignac's formula, after Alphonse de Polignac.

References

  1. 1 2 Brian Hayes (2001). "Third Base". American Scientist . 89 (6): 490. doi:10.1511/2001.40.3268. Archived from the original on 2014-01-11. Retrieved 2013-07-28.
  2. Bentley, Jon; Sedgewick, Bob (1998-04-01). "Ternary Search Trees". Dr. Dobb's Journal. UBM Tech. Retrieved 2013-07-28.
  3. Engineering Research Associates Staff (1950). "3-6 The r-triode Counter, Modulo r". High-Speed Computing Devices. McGraw-Hill. pp. 22–23. Retrieved 2008-08-27.
  4. Engineering Research Associates Staff (1950). "3-7 The 2r-triode Counter, Modulo r". High-Speed Computing Devices. McGraw-Hill. pp. 23–25. Retrieved 2008-08-27.
  5. Engineering Research Associates Staff (1950). "6-7 Economy Attained by Radix Choice". High-Speed Computing Devices. McGraw-Hill. pp. 84–87. Retrieved 2008-08-27.
  6. Engineering Research Associates Staff (1950). "16-2 New Techniques". High-Speed Computing Devices. McGraw-Hill. pp. 419–421. Retrieved 2008-08-27.

Further reading