# Complex-base system

(Redirected from Complex base systems)

In arithmetic, a complex-base system is a positional numeral system whose radix is an imaginary (proposed by Donald Knuth in 1955[1][2]) or complex number (proposed by S. Khmelnik in 1964[3] and Walter F. Penney in 1965[4][5][6]).

## In general

Let ${\displaystyle D}$ be an integral domain ${\displaystyle \subset \mathbb {C} }$, and ${\displaystyle |\cdot |}$ the (Archimedean) absolute value on it.

A number ${\displaystyle X\in D}$ in a positional number system is represented as an expansion

${\displaystyle X=\pm \sum _{\nu }^{}x_{\nu }\rho ^{\nu },}$

where

 ${\displaystyle \rho }$ is the radix (or base) ${\displaystyle \in D}$ with ${\displaystyle |\rho |>1}$, ${\displaystyle \nu }$ is the exponent (position or place) ${\displaystyle \in \mathbb {Z} }$, ${\displaystyle x_{\nu }}$ are digits from the finite set of digits ${\displaystyle Z\subset D}$, usually with ${\displaystyle |x_{\nu }|<|\rho |.}$

The cardinality ${\displaystyle R:=|Z|}$ is called the level of decomposition.

A positional number system or coding system is a pair

${\displaystyle \left\langle \rho ,Z\right\rangle }$

with radix ${\displaystyle \rho }$ and set of digits ${\displaystyle Z}$, and we write the standard set of digits with ${\displaystyle R}$ digits as

${\displaystyle Z_{R}:=\{0,1,2,\dotsc ,{R-1}\}.}$

Desirable are coding systems with the features:

• Every number in ${\displaystyle D}$, e. g. the integers ${\displaystyle \mathbb {Z} }$, the Gaussian integers ${\displaystyle \mathbb {Z} [\mathrm {i} ]}$ or the integers ${\displaystyle \mathbb {Z} [{\tfrac {-1+\mathrm {i} {\sqrt {7}}}{2}}]}$, is uniquely representable as a finite code, possibly with a sign ±.
• Every number in the field of fractions ${\displaystyle K:={\mathsf {Quot}}(D)}$, which possibly is completed for the metric given by ${\displaystyle |\cdot |}$ yielding ${\displaystyle K:=\mathbb {R} }$ or ${\displaystyle K:=\mathbb {C} }$, is representable as an infinite series ${\displaystyle X}$ which converges under ${\displaystyle |\cdot |}$ for ${\displaystyle \nu \to -\infty }$, and the measure of the set of numbers with more than one representation is 0. The latter requires that the set ${\displaystyle Z}$ be minimal, i. e. ${\displaystyle R=|\rho |}$ for real numbers and ${\displaystyle R=|\rho |^{2}}$ for complex numbers.

## In the real numbers

In this notation our standard decimal coding scheme is denoted by

${\displaystyle \left\langle 10,Z_{10}\right\rangle ,}$

the standard binary system is

${\displaystyle \left\langle 2,Z_{2}\right\rangle ,}$

the negabinary system is

${\displaystyle \left\langle -2,Z_{2}\right\rangle ,}$

and the balanced ternary system[2] is

${\displaystyle \left\langle 3,\{-1,0,1\}\right\rangle .}$

All these coding systems have the mentioned features for ${\displaystyle \mathbb {Z} }$ and ${\displaystyle \mathbb {R} }$, and the last two do not require a sign.

## In the complex numbers

Well-known positional number systems for the complex numbers include the following (${\displaystyle \mathrm {i} }$ being the imaginary unit):

• ${\displaystyle \left\langle {\sqrt {R}},Z_{R}\right\rangle }$, e. g. ${\displaystyle \left\langle \pm \mathrm {i} {\sqrt {2}},Z_{2}\right\rangle }$ [1] and
${\displaystyle \left\langle \pm 2\mathrm {i} ,Z_{4}\right\rangle }$,[2] the quater-imaginary base, proposed by Donald Knuth in 1955.
• ${\displaystyle \left\langle {\sqrt {2}}e^{\pm {\tfrac {\pi }{2}}\mathrm {i} }=\pm \mathrm {i} {\sqrt {2}},Z_{2}\right\rangle }$ and
${\displaystyle \left\langle {\sqrt {2}}e^{\pm {\tfrac {3\pi }{4}}\mathrm {i} }=-1\pm \mathrm {i} ,Z_{2}\right\rangle }$[3][5] (see also the section Base −1±i below).
• ${\displaystyle \left\langle {\sqrt {R}}e^{\mathrm {i} \varphi },Z_{R}\right\rangle }$, where ${\displaystyle \varphi =\pm \arccos {(-\beta /(2{\sqrt {R}}))}}$, ${\displaystyle \beta <\min(R,2{\sqrt {R}})}$ and ${\displaystyle \beta _{}^{}}$ is a positive integer that can take multiple values at a given ${\displaystyle R}$.[7] For ${\displaystyle \beta =1}$ and ${\displaystyle R=2}$ this is the system
${\displaystyle \left\langle {\tfrac {-1+\mathrm {i} {\sqrt {7}}}{2}},Z_{2}\right\rangle .}$
• ${\displaystyle \left\langle 2e^{{\tfrac {\pi }{3}}\mathrm {i} },A_{4}:=\left\{0,1,e^{{\tfrac {2\pi }{3}}\mathrm {i} },e^{-{\tfrac {2\pi }{3}}\mathrm {i} }\right\}\right\rangle }$.[8]
• ${\displaystyle \left\langle -R,A_{R}^{2}\right\rangle }$, where the set ${\displaystyle A_{R}^{2}}$ consists of complex numbers ${\displaystyle r_{\nu }=\alpha _{\nu }^{1}+\alpha _{\nu }^{2}\mathrm {i} }$, and numbers ${\displaystyle \alpha _{\nu }^{}\in Z_{R}}$, e. g.
${\displaystyle \left\langle -2,\{0,1,\mathrm {i} ,1+\mathrm {i} \}\right\rangle .}$[8]
• ${\displaystyle \left\langle \rho =\rho _{2},Z_{2}\right\rangle }$, where ${\displaystyle \rho _{2}={\begin{cases}(-2)^{\tfrac {\nu }{2}}&{\text{if }}\nu {\text{ even,}}\\(-2)^{\tfrac {\nu -1}{2}}\mathrm {i} &{\text{if }}\nu {\text{ odd.}}\end{cases}}}$ [9]

## Binary systems

Binary coding systems of complex numbers, i. e. systems with the digits ${\displaystyle Z_{2}=\{0,1\}}$, are of practical interest.[9] Listed below are some coding systems ${\displaystyle \langle \rho ,Z_{2}\rangle }$ (all are special cases of the systems above) and resp. codes for the (decimal) numbers −1, 2, −2, i. The standard binary (which requires a sign) and the "negabinary" systems are also listed for comparison. They do not have a genuine expansion for i.

Some bases and some representations[10]
Radix –1 ← 2 ← –2 ← i Twins and triplets
i2 101 10100 100 10.101010100…[11] 13+13i2 0.0011 = 11.1100
(–1+i7) ⁄2 111 1010 110 11.110001100…[11] (3+i7) ⁄4 1.011 = 11.101 = 11100.110
ρ2 101 10100 100 10 13+13i 0.0011 = 11.1100
2i 103 2 102 10.2 15+25i 0.0033 = 1.3003 = 10.0330 = 11.3300
–1+i 11101 1100 11100 11 15+35i 0.010 = 11.001 = 1110.100
2 –1 10 –10 i 1 ← 0.1 = 1.0
–2 11 110 10 i 13 0.01 = 1.10

As in all positional number systems with an Archimedean absolute value, there are some numbers with multiple representations. Examples of such numbers are shown in the right column of the table. All of them are repeating fractions with the repetend marked by a horizontal line above it.

If the set of digits is minimal, the set of such numbers has a measure of 0. This is the case with all the mentioned coding systems.

The almost binary quater-imaginary system is listed in the bottom line for comparison purposes. There, real and imaginary part interleave each other, so that the respective 2-digit repetend surrounds foreign digits which are shown as \ resp. /.

## Base −1 ± i

The complex numbers with integer part all zeroes in the base i–1 system

Of particular interest are the quater-imaginary base (base 2 i) and the base −1 ± i systems discussed below, both of which can be used to finitely represent the Gaussian integers without sign.

Base −1 ± i, using digits 0 and 1, was proposed by S. Khmelnik in 1964[3] and Walter F. Penney in 1965.[4][6] The rounding region of an integer – i.e., a set ${\displaystyle S}$ of complex (non-integer) numbers that share the integer part of their representation in this system – has in the complex plane a fractal shape: the twindragon (see figure). This set ${\displaystyle S}$ is, by definition, all points that can be written as ${\displaystyle \textstyle \sum _{k\geq 1}x_{k}(\mathrm {i} -1)^{-k}}$ with ${\displaystyle x_{k}\in Z_{2}}$. ${\displaystyle S}$ can be decomposed into 16 pieces congruent to ${\displaystyle {\tfrac {1}{4}}S}$. Notice that if ${\displaystyle S}$ is rotated counterclockwise by 135°, we obtain two adjacent sets congruent to ${\displaystyle {\tfrac {1}{\sqrt {2}}}S}$, because ${\displaystyle (\mathrm {i} -1)S=S\cup (S+1)}$. The rectangle ${\displaystyle R\subset S}$ in the center intersects the coordinate axes counterclockwise at the following points: ${\displaystyle {\tfrac {2}{15}}\gets 0.{\overline {00001100}}}$, ${\displaystyle {\tfrac {1}{15}}\mathrm {i} \gets 0.{\overline {00000011}}}$, and ${\displaystyle -{\tfrac {8}{15}}\gets 0.{\overline {11000000}}}$, and ${\displaystyle -{\tfrac {4}{15}}\mathrm {i} \gets 0.{\overline {00110000}}}$. Thus, ${\displaystyle S}$ contains all complex numbers with absolute value ≤215.[12]

## References

1. ^ a b Knuth, D.E. (1960). "An Imaginary Number System". Communications of the ACM. 3 (4): 245–247. doi:10.1145/367177.367233.
2. ^ a b c Knuth, Donald (1998). "Positional Number Systems". The art of computer programming. Volume 2 (3rd ed.). Boston: Addison-Wesley. p. 205. ISBN 0-201-89684-2. OCLC 48246681.
3. ^ a b c Khmelnik, S.I. (1964). "Specialized digital computer for operations with complex numbers". Questions of Radio Electronics (in Russian). XII (2).
4. ^ a b W. Penney, A "binary" system for complex numbers, JACM 12 (1965) 247-248.
5. ^ a b Jamil, T. (2002). "The complex binary number system". IEEE Potentials. 20 (5): 39–41. doi:10.1109/45.983342.
6. ^ a b Duda, Jarek (2008-02-24). "Complex base numeral systems". arXiv: [math.DS].
7. ^ Khmelnik, S.I. (1966). "Positional coding of complex numbers". Questions of Radio Electronics (in Russian). XII (9).
8. ^ a b Khmelnik, S.I. (2004). Coding of Complex Numbers and Vectors (in Russian) (PDF). Israel: Mathematics in Computer. ISBN 978-0-557-74692-7.
9. ^ a b Khmelnik, S.I. (2001). Method and system for processing complex numbers. Patent USA, US2003154226 (A1).
10. ^ William J. Gilbert, “Arithmetic in Complex Bases” Mathematics Magazine Vol. 57, No. 2, March 1984
11. ^ a b infinite non-repeating sequence
12. ^ Knuth 1998 p.206