You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return the binary expansions of nonnegative ``n`` and ``k``. If algo=max then pad the resulting int arrays with 0 to make them equally long. For example
Copy file name to clipboardExpand all lines: src/CantorMachines.jl
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ end
40
40
41
41
"""
42
42
43
-
The Cantor enumeration of N X N where N = {0, 1, 2, ...}. If (x, y) and (x', y') are adjacent points on the trajectory of the map then max(|x - x'|, |y - y'|) can become arbitrarily large. In this sense Cantor's enumeration is not continous.
43
+
The Cantor enumeration of ℕ X ℕ where ℕ ``= {0, 1, 2, ...}``. If ``(x, y)`` and ``(x', y')`` are adjacent points on the trajectory of the map then max``(|x - x'|, |y - y'|)`` can become arbitrarily large. In this sense Cantor's enumeration is not continous.
44
44
"""
45
45
functionCantorEnumeration(len)
46
46
x, y, state =0, 0, false
@@ -53,7 +53,7 @@ end
53
53
54
54
"""
55
55
56
-
The inverse function of the Cantor enumeration (the pairing function), computes n for given (x, y) and returns (x + y)*(x + y + 1)/2 + p where p = x if x - y is odd and y otherwise.
56
+
The inverse function of the Cantor enumeration (the pairing function), computes n for given ``(x, y)`` and returns ``(x + y)(x + y + 1)/2 + p`` where ``p = x`` if ``x - y`` is odd and ``y`` otherwise.
57
57
"""
58
58
functionCantorPairing(x, y)
59
59
p =isodd(x - y) ? x : y
@@ -74,7 +74,7 @@ end
74
74
75
75
"""
76
76
77
-
# The boustrophedonic Cantor enumeration of N X N where N = {0, 1, 2, ...}. If (x, y) and (x', y') are adjacent points on the trajectory of the map then max(|x - x'|, |y - y'|) is always 1 whereas for the Cantor enumeration this quantity can become arbitrarily large. In this sense the boustrophedonic variant is continuous whereas Cantor's realization is not.
77
+
The boustrophedonic Cantor enumeration of ℕ X ℕ where ``ℕ = {0, 1, 2, ...}``. If ``(x, y)`` and ``(x', y')`` are adjacent points on the trajectory of the map then max``(|x - x'|, |y - y'|)`` is always 1 whereas for the Cantor enumeration this quantity can become arbitrarily large. In this sense the boustrophedonic variant is continuous whereas Cantor's realization is not.
78
78
"""
79
79
functionCantorBoustrophedonicEnumeration(len)
80
80
x, y =0, 0
@@ -87,7 +87,7 @@ end
87
87
88
88
"""
89
89
90
-
The inverse function of the boustrophedonic Cantor enumeration (the pairing function), computes n for given (x, y) and returns (x + y)*(x + y + 1)/2 + m where m = abs(x - y) - (x > y ? 1 : 0).
90
+
The inverse function of the boustrophedonic Cantor enumeration (the pairing function), computes n for given ``(x, y)`` and returns ``(x + y)(x + y + 1)/2 + m`` where ``m = abs(x - y) - (x > y ? 1 : 0)``.
91
91
"""
92
92
functionCantorBoustrophedonicPairing(x, y)
93
93
m =abs(x - y) - (x > y ?1:0)
@@ -113,7 +113,7 @@ end
113
113
114
114
"""
115
115
116
-
The boustrophedonic Rosenberg-Strong enumeration of N X N where N = {0, 1, 2, ...}. If (x, y) and (x', y') are adjacent points on the trajectory of the map then max(|x - x'|, |y - y'|) is always 1 whereas the Rosenberg-Strong realization is not.
116
+
The boustrophedonic Rosenberg-Strong enumeration of ℕ X ℕ where ℕ ``= {0, 1, 2, ...}``. If ``(x, y)`` and ``(x', y')`` are adjacent points on the trajectory of the map then max``(|x - x'|, |y - y'|)`` is always 1 whereas the Rosenberg-Strong realization is not.
0 commit comments