Mathwords logoMathwords

Quater-imaginary Base — Definition, Formula & Example

Quater-imaginary base is a place-value system that uses the imaginary number 2i2i as its base and only the digits 0, 1, 2, and 3. A single string of these digits can name any complex number without a minus sign or a separate imaginary part.

The quater-imaginary system, introduced by Donald Knuth in 1960, writes a complex number as z=∑kdk(2i)kz = \sum_k d_k (2i)^k with each digit dk∈{0,1,2,3}d_k \in \{0, 1, 2, 3\}. Every complex number has such an expansion. Every Gaussian integer needs at most one digit after the radix point, whose place value is (2i)−1=−i2(2i)^{-1} = -\tfrac{i}{2}. For example, i=10.22ii = 10.2_{2i}. Even-numbered positions carry the powers (−4)m(-4)^m, which are real, and odd-numbered positions carry purely imaginary place values.

Key Formula

z=∑kdk (2i)k,dk∈{0,1,2,3}z = \sum_{k} d_k\,(2i)^k, \qquad d_k \in \{0, 1, 2, 3\}
Where:
  • zz = The complex number the numeral represents
  • dkd_k = The digit in position k, always 0, 1, 2, or 3
  • kk = The position index: 0 for the ones place, increasing to the left and negative after the radix point
  • 2i2i = The base, where i is the imaginary unit with i squared equal to -1

Worked Example

Problem: Convert the quater-imaginary numeral 113012i11301_{2i} to the standard form a+bia + bi.
Step 1: Find the place values. Moving right to left, they are (2i)0(2i)^0 through (2i)4(2i)^4. Their signs follow a 4-step cycle because i2=−1i^2 = -1.
(2i)0=1,(2i)1=2i,(2i)2=−4,(2i)3=−8i,(2i)4=16(2i)^0 = 1,\quad (2i)^1 = 2i,\quad (2i)^2 = -4,\quad (2i)^3 = -8i,\quad (2i)^4 = 16
Step 2: Multiply each digit by its place value. The digits from left to right are 1, 1, 3, 0, 1.
1(16)+1(−8i)+3(−4)+0(2i)+1(1)=16−8i−12+0+11(16) + 1(-8i) + 3(-4) + 0(2i) + 1(1) = 16 - 8i - 12 + 0 + 1
Step 3: Group the real terms and the imaginary terms. The real terms come from the even positions, and the imaginary terms come from the odd positions.
(16−12+1)+(−8i)=5−8i(16 - 12 + 1) + (-8i) = 5 - 8i
Answer: 113012i=5−8i11301_{2i} = 5 - 8i

Why It Matters

Knuth proposed this system in a 1960 paper, and later discussed it in The Art of Computer Programming, as a way for a computer to store a complex number as one digit string. The machine then needs no sign bit and no separate real and imaginary registers. Addition and multiplication can be done digit by digit, although carries behave differently than in base 10. The system also appears in courses on number systems and in the study of Gaussian integers.

Common Mistakes

Mistake: Treating (2i)2(2i)^2 as 44 or (2i)3(2i)^3 as 8i8i, as if the base behaved like a positive real number.
Correction: Because i2=−1i^2 = -1, the place values cycle through the signs +,+i,−,−i+, +i, -, -i. So (2i)2=−4(2i)^2 = -4 and (2i)3=−8i(2i)^3 = -8i. Write out each power before you multiply.

Related Terms