Simplest self-contained numeral system for complex numbers?

  • I
  • Thread starter cuallito
  • Start date
  • #1
81
1

Summary:

Like balanced ternary for complex numbers.
Anyone know what the simplest possible self-contained numeral system for complex numbers would be, analogous to signed ternary for integers? My guess would be quarter-imaginary base (https://en.wikipedia.org/wiki/Quater-imaginary_base.)
 

Answers and Replies

  • #2
34,955
11,143
Define "simple". You can use a+ib where a and b follow your favorite simple representation of real numbers. I would consider that simpler than the quarter-imaginary base. You can convert between these two relatively easily, as the quarter-imaginary base has purely imaginary and purely real digits that you can separate.
 
  • Like
Likes pbuk and sysprog
  • #3
1,720
985
Here's how it's commonly done in PL/1 (from https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ceea300/ceea30016.htm):

COMPLEX8Short floating-point complex hex number: an 8-byte complex number, whose real and imaginary parts are each 4-byte single-precision floating-point numbersCOMPLEX FLOAT DECIMAL (6)
COMPLEX16Long floating-point complex hex number: a 16-byte complex number, whose real and imaginary parts are each 8-byte double-precision floating-point numbersCOMPLEX FLOAT DECIMAL (16)
COMPLEX32Extended floating-point hex number: a 32-byte complex number, whose real and imaginary parts are each 16-byte extended-precision floating-point numbersCOMPLEX FLOAT DECIMAL (33)
 
  • Like
Likes Delta2
  • #4
pbuk
Science Advisor
Gold Member
1,763
643
Anyone know what the simplest possible self-contained numeral system for complex numbers would be, analogous to signed ternary for integers? My guess would be quarter-imaginary base (https://en.wikipedia.org/wiki/Quater-imaginary_base.)
I assume by signed ternary you are referring to what is more commonly called balanced ternary?
Define "simple".
Indeed. I think it is hard to come up with a definition in which balanced ternary is judged simpler than, say, 2's complement binary.

Quater-imaginary is an interesting curiosity, but again it is difficult to see it as 'simple', and it lacks the desirable feature of compactness that other representation systems (including balanced ternary) have. By compactness for Gaussian integers I mean that the set of all values which can be expressed by a string of ## n ## symbols of a system with ## m ## symbols should lie in a square with sides ## m^{n/2} ## on the Gaussian plane.

In my view, the simplest such system can be achieved by interleaved two's complement binary digits: ## ...b_2a_2b_1a_1b_0a_0 ## where ## z = a +ib ##. In this system we have (using the notation 0bxx to represent 2's complement binary):
Code:
0000 => 0 + 0i = 0
0001 => 1 + 0i = 1
0010 => 0 + 1i = i
0011 => 1 + 1i = 1 + i
0100 => 0b10 + 0i = -2
0101 => 0b11 + 0i = -1
0111 => 0b11 + 1i = -1 + i
...
and so all numbers represented by the 16 possible strings lie in the rectangle with corners at (-2, -2) and (1, 1).
You can convert between these two relatively easily.
## 7_{10} = ?_{2i} ##? (show your workings) :-p
 
Last edited:
  • Like
Likes sysprog
  • #5
34,955
11,143
## 7_{10} = ?_{2i} ##? (show your workings) :-p
The imaginary part is 0 and there is no fractional part, so we already know the result will be ?0?0?. From here on everything is working with real numbers only.
We just need to express 7 in base -4, which is awkward but possible: 16 = 100-4, 8 = 120-4, 7 = 133-4, which means our final result is 103032i. Most of the work went into base 10 -> base -4 conversion, not into anything that would be related to imaginary numbers.
If you know real and imaginary part separately you can keep them separate, and only merge them for the final result. That's similar to the interleaved binary system you showed. A bit more complicated because the imaginary part has an offset (2i and 1/2i digits, no 1i digit).
 
  • Like
Likes sysprog and pbuk
  • #6
pbuk
Science Advisor
Gold Member
1,763
643
I think we have different concepts of 'relatively easy' @mfb :wink:
 
  • Like
Likes sysprog
  • #7
34,955
11,143
It's much easier than base ##1+i## or even more obscure angles like ##1+2i##.
 
  • Like
Likes sysprog
  • #8
jbriggs444
Science Advisor
Homework Helper
2019 Award
9,315
4,016
Define "simple". You can use a+ib where a and b follow your favorite simple representation of real numbers. I would consider that simpler than the quarter-imaginary base. You can convert between these two relatively easily, as the quarter-imaginary base has purely imaginary and purely real digits that you can separate.
If the symmetry of balanced ternary is attractive then one could extend it to the complex numbers by using base 3 with nine complex digits: (-1-i), (-1), (-1+i), (-i), (0), (+i), (1-i), (1), (1+i). This is a bit unsatisfactory since it is obviously just a cheesy way of taking the balanced ternary expansions a and b of (a+bi) and interleaving their digits.

If the economy of digits of base -2 is attractive then one could use base ##i \sqrt 2## with two digits: 0 and 1.
 
  • Like
Likes pbuk
  • #9
pbuk
Science Advisor
Gold Member
1,763
643
If the economy of digits of base -2 is attractive then one could use base ##i \sqrt 2## with two digits: 0 and 1.
Great idea - and to make it really simple you could implement the arithmetic routines in a symbolically economical language like brainf**k :wink:
 
  • Haha
Likes sysprog

Related Threads on Simplest self-contained numeral system for complex numbers?

  • Last Post
Replies
5
Views
1K
Replies
12
Views
1K
Replies
4
Views
2K
  • Last Post
Replies
10
Views
2K
Replies
1
Views
1K
Replies
5
Views
4K
Replies
5
Views
3K
Replies
23
Views
2K
Top