[math-fun] When is base 2 not binary?
When the digits are 0 and 1 and the other two cuberoots of 1. See gosper.org/gaskettalk.pdf pp 11 and 13. E.g., i/√3 = red.cyangreencyangreencyangreen... = cyan.greenmagentagreenmagentagreen... . Presumably we can expect a lot of these multiple representations when the unit patch has a fractal boundary. PUZZLE: Here of dimension what? We need |base|² digits to cover a positive area in the complex plane. The "France fractal" bounds the unit patch of the base 2+i^(2/3) with digits zero and the 6th roots of 1. |2+i^(2/3)| = √7. Base 2+i^(2/3) with three digits moved outward gosper.org/base2+w.bmp has a unit patch with a boundary of large dimension. (PUZZLE: D=?) --rwg
Is there a nice algorithm for adding two complex numbers via their expansions in this base, using some sort of carrying process? Jim Propp On Sunday, April 22, 2018, Bill Gosper <billgosper@gmail.com> wrote:
When the digits are 0 and 1 and the other two cuberoots of 1. See gosper.org/gaskettalk.pdf pp 11 and 13. E.g., i/√3 = red.cyangreencyangreencyangreen... = cyan.greenmagentagreenmagentagreen... . Presumably we can expect a lot of these multiple representations when the unit patch has a fractal boundary. PUZZLE: Here of dimension what? We need |base|² digits to cover a positive area in the complex plane. The "France fractal" bounds the unit patch of the base 2+i^(2/3) with digits zero and the 6th roots of 1. |2+i^(2/3)| = √7. Base 2+i^(2/3) with three digits moved outward gosper.org/base2+w.bmp has a unit patch with a boundary of large dimension. (PUZZLE: D=?) --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
As far as I am aware that is an open question ...apart from special cases where automata have been given (don't recall the papers/authors, J-P Allouche should know more). Usually one first tries to determine how to increment a number. This can already be tricky. Given that such algorithms may lead to more efficient CPUs I am surprised this field isn't much more active. The numeration system corresponding to gosper.org/base2+w.bmp may be a "bad" one: no disc around zero is contained in the (shown approximation of the) fundamental tile. The (essentially unique when requiring rotational symmetry) numeration systems on the Eisenstein grid using three or four digits don't have this problem. On the Gaussian grid the numeration systems with 4-symmetric fundamental tile never have this problem, the smallest one having digit set {0, +1, -1, +i, -i} and basis 2+i. Section 3.3 of https://arxiv.org/abs/1607.02433 mumbles about this and may contain a useful reference. Best regards, jj * James Propp <jamespropp@gmail.com> [Apr 22. 2018 15:47]:
Is there a nice algorithm for adding two complex numbers via their expansions in this base, using some sort of carrying process?
Jim Propp
On Sunday, April 22, 2018, Bill Gosper <billgosper@gmail.com> wrote:
When the digits are 0 and 1 and the other two cuberoots of 1. See gosper.org/gaskettalk.pdf pp 11 and 13. E.g., i/√3 = red.cyangreencyangreencyangreen... = cyan.greenmagentagreenmagentagreen... . Presumably we can expect a lot of these multiple representations when the unit patch has a fractal boundary. PUZZLE: Here of dimension what? We need |base|² digits to cover a positive area in the complex plane. The "France fractal" bounds the unit patch of the base 2+i^(2/3) with digits zero and the 6th roots of 1. |2+i^(2/3)| = √7. Base 2+i^(2/3) with three digits moved outward gosper.org/base2+w.bmp has a unit patch with a boundary of large dimension. (PUZZLE: D=?) --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
* Joerg Arndt <arndt@jjj.de> [Apr 22. 2018 16:18]:
[...]
Usually one first tries to determine how to increment a number. This can already be tricky.
Here are the the first few integers in base = 2 + i and digit set {0, +1, -1, +i, -i} The least significant digit is on the left. 0: [ 0] 1: [+1] 2: [-i, +1] 3: [+i, +i, -i] 4: [-1, -1, +i, -i] 5: [ 0, -1, +i, -i] 6: [+1, -1, +i, -i] 7: [-i, 0, +i, -i] 8: [+i, -i, +i, -i] 9: [-1, +i, 0, -i] 10: [ 0, +i, 0, -i] 11: [+1, +i, 0, -i] 12: [-i, -1, +1, -i] 13: [+i, +1, 0, -i] 14: [-1, -i, +1, -i] 15: [ 0, -i, +1, -i] 16: [+1, -i, +1, -i] 17: [-i, +i, +i, -1, -i] 18: [+i, 0, +i, -1, -i] 19: [-1, +1, +i, -1, -i] 20: [ 0, +1, +i, -1, -i] 21: [+1, +1, +i, -1, -i] 22: [-i, -i, -1, 0, -i] 23: [+i, -1, +1, -1, -i] 24: [-1, 0, +1, -1, -i] 25: [ 0, 0, +1, -1, -i] 26: [+1, 0, +1, -1, -i] 27: [-i, +1, +1, -1, -i] 28: [+i, +i, +i, +1, +1, -1] 29: [-1, -1, -1, -i, -i] 30: [ 0, -1, -1, -i, -i] 31: [+1, -1, -1, -i, -i] 32: [-i, 0, -1, -i, -i] 33: [+i, -i, -1, -i, -i] 34: [-1, +i, +1, +1, +1, -1] 35: [ 0, +i, +1, +1, +1, -1] 36: [+1, +i, +1, +1, +1, -1] 37: [-i, -1, -i, -i, -i] 38: [+i, +1, +1, +1, +1, -1] 39: [-1, -i, -i, -i, -i] 40: [ 0, -i, -i, -i, -i] 41: [+1, -i, -i, -i, -i] 42: [-i, +i, -1, -1, -1, -i] 43: [+i, 0, -1, -1, -1, -i] 44: [-1, +1, -1, -1, -1, -i] 45: [ 0, +1, -1, -1, -1, -i] 46: [+1, +1, -1, -1, -1, -i] 47: [-i, -i, 0, -1, -1, -i] 48: [+i, -1, -i, -1, -1, -i] 49: [-1, 0, -i, -1, -1, -i] 50: [ 0, 0, -i, -1, -1, -i] 51: [+1, 0, -i, -1, -1, -i] 52: [-i, +1, -i, -1, -1, -i] 53: [+i, +i, -1, +1, +i, +1, -1] 54: [-1, -1, 0, +1, +i, +1, -1] 55: [ 0, -1, 0, +1, +i, +1, -1] 56: [+1, -1, 0, +1, +i, +1, -1] 57: [-i, 0, 0, +1, +i, +1, -1] 58: [+i, -i, 0, +1, +i, +1, -1] 59: [-1, +i, -i, +1, +i, +1, -1] 60: [ 0, +i, -i, +1, +i, +1, -1] 61: [+1, +i, -i, +1, +i, +1, -1] Best regards, jj
[...]
Ouch. Julian points out that base 2, digits 1^({0,1,2}/3) covers only ⅔ of the plane! I was inadvertently patching holes with illegal digits 1^({1,3,5}/6) . Switching the base to -2 saves the day, with the patch of pure fractions <http://gosper.org/base-2d.png> simply-connected, but by an infinitude of single points! The rest of this message explores how to convert between "Eisenstein rationals" (A + i √3 B) and strings of "digits" from {0, 1^(1/3), 1^(2/3), 1}, using Julians'a amazing piecewiserecursivefractal function. In fact, for this system, the complex plane is dense with triply representable points, analogously to the real line being dense with points with terminating positional expansions: .yyy000... = .yyx999... Two triply represented points are circled in this lo-res illustration <http://gosper.org/base-2c.png>. Julian designed two functions, basem2 and unbasem2, to convert back and forth between complex rationals and base 4 strings, the latter encoding the sequence of successive "quadrants" as you zoom in on the point in the complex plane. E.g., instead of .10000.., we can write 1/4 in base 4 as .03333...: In[33]:= FromDigits[{{0,{3}},0},4] Out[33]= 1/4 In[35]:= BaseForm[1/4-4^-9,4] Out[35]//BaseForm= Subscript[33333333, 4]/Subscript[1000000000, 4] base2m[1/4] converts this into two quadrant sequences, In[80]:= basem2[1/4] Out[80]= {1/6, 1/4 (1 - I √3)} corresponding to .0333... and.1000... . Are there any other ways to represent these two quantities? In[81]:= unbasem2 /@ % Out[81]= {{1/4, 7/20, 13/20}, {1/4}} Yes, this says that In[20]:= RealDigits[7/20, 4] Out[20]= {{1, {1, 2}}, 0} In[45]:= RealDigits[13/20, 4] Out[45]= {{2, {2, 1}}, 0} Here, the digits 1 and 2 represent 1^(1/3) and 1^(2/3) in the base -2 picture: In[43]:= FromDigits[{I^{4/3, {4/3, 8/3}}, 0}, -2] Out[43]= 1/2 (-(-1)^(2/3) + 1/3 ((-1)^(1/3) + 2 (-1)^(2/3))) In[44]:= Simplify@% Out[44]= 1/6 In[45]:= RealDigits[13/20, 4] Out[45]= {{2, {2, 1}}, 0} In[48]:= FromDigits[{I^(4 {2, {2, 1}}/3), 0}, -2] Out[48]= 1/2 ((-1)^(1/3) + 1/3 (-2 (-1)^(1/3) - (-1)^(2/3))) In[49]:= Simplify@% Out[49]= 1/6 This being a triple point proves that the "neck" at 1/6 +0i is only one point thick. The lower circle designates the triple point -i/2/√3. But mapping back, In[62]:= unbasem2[-I/2/√3] Out[62]= {13/84, 31/84} gives only two preimages, because the third preimage is not a pure fraction. "Zooming in" one complex base 4 digit zooms the preimages by two digits: In[84]:= 16 unbasem2[-I/2/√3/4] Out[84]= {13/84, 31/84, 229/84} Check: In[86]:= 4 basem2 /@ (%84/16) // Simplify Out[86]= {{-(I/(2 Sqrt[3]))}, {-(I/(2 Sqrt[3]))}, {-(I/(2 Sqrt[3]))}} Please feel encouraged to ask questions! Except about piecewiserecursivefractal. For that, ask Julian. He'll patiently explain it. It won't help. Here are basem2 and unbasem2: basem2[t_] := piecewiserecursivefractal[t, Identity, Piecewise[{{{1}, 0 <= # < 1/4}, {{1, 2}, # == 1/4}, {{2}, 1/4 < # < 1/2}, {{2, 3}, # == 1/2}, {{3}, 1/2 < # < 3/4}, {{3, 4}, # == 3/4}, {{4}, 3/4 < # <= 1}}] &, {4*# &, 4*# - 1 &, 4*# - 2 &, 4*# - 3 &}, {-1/2*# &, (1 - Sqrt[-3])/4 - 1/2*# &, (1 + Sqrt[-3])/4 - 1/2*# &, -1/2*# - 1/2 &}] unbasem2[z_] := piecewiserecursivefractal[z, Identity, ##] & @@ MapAt[(ComplexExpand@*Together@*# &) /@ # &, invertfractal[{4*# &, 4*# - 1 &, 4*# - 2 &, 4*# - 3 &}, {-1/2*# &, (1 - Sqrt[-3])/4 - 1/2*# &, (1 + Sqrt[-3])/4 - 1/2*# &, -1/2*# - 1/2 &}, {{-5/6, 2/3}, {-Sqrt[3]/2, Sqrt[3]/2}}], 2] ClearAll[invertfractal]; invertfractal[iters_List, fns_List, bounder_Function, inverter_: InverseFunction] /; Length[iters] == Length[fns] && (And @@ (Head[#] == Function & /@ iters)) && (And @@ (Head[#] == Function & /@ fns)) := Block[{cond, val}, {If[cond, val, {}] & /. {cond -> bounder[#], val -> Range[Length[iters]]}, inverter /@ fns, inverter /@ iters}] (*Inverts a fractal satisfying a bounding condition*) invertfractal[iters_List, fns_List, boundingbox_List, inverter_: InverseFunction] := Block[{b11, b12, b21, b22}, invertfractal[iters, fns, (b11 <= Re[#] <= b12) && (b21 <= Im[#] <= b22) & /. {b11 -> boundingbox[[1, 1]], b12 -> boundingbox[[1, 2]], b21 -> boundingbox[[2, 1]], b22 -> boundingbox[[2, 2]]}, inverter]] (*Invert using a bounding box for a 2D fractal*) And here is Julian's total magic: piecewiserecursivefractal[x_, f_, which_, iters_, fns_] := piecewiserecursivefractal[x, g_, which, iters, fns] = ((piecewiserecursivefractal[x, h_, which, iters, fns] := Block[{y}, y /. Solve[f[y] == h[y], y]]); Union @@ ((fns[[#]] /@piecewiserecursivefractal[iters[[#]][x], Composition[f, fns[[#]]], which, iters, fns]) & /@which[x])); This function is dangerous to quit out of. Ask me or Julian for his bulletproof version. --rwg On Sat, Apr 21, 2018 at 10:25 PM Bill Gosper <billgosper@gmail.com> wrote:
When the digits are 0 and 1 and the other two cuberoots of 1. See gosper.org/gaskettalk.pdf pp 11 and 13. E.g., i/√3 = red.cyangreencyangreencyangreen... = cyan.greenmagentagreenmagentagreen... . Presumably we can expect a lot of these multiple representations when the unit patch has a fractal boundary. PUZZLE: Here of dimension what? We need |base|² digits to cover a positive area in the complex plane. The "France fractal" bounds the unit patch of the base 2+i^(2/3) with digits zero and the 6th roots of 1. |2+i^(2/3)| = √7. Base 2+i^(2/3) with three digits moved outward gosper.org/base2+w.bmp has a unit patch with a boundary of large dimension. (PUZZLE: D=?) --rwg
participants (3)
-
Bill Gosper -
James Propp -
Joerg Arndt