import polycount from from-wordpress
This commit is contained in:
parent
5d0da50e47
commit
bf3b2976bd
341
polycount/1.qmd
Normal file
341
polycount/1.qmd
Normal file
@ -0,0 +1,341 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
Polynomial Counting: A primer
|
||||
=============================
|
||||
|
||||
The single most common method of representing numbers in the modern world is in *positional numeral system*. Despite being taught in early grade school, it is the result of millennia of mathematical thought.
|
||||
|
||||
The decimal system we use today assigns integers to *expansions* consisting several symbols called *numerals* next to each other. Each numeral is positioned at a *place value*, which has a value ten times greater than its neighbor to the right and a tenth as much of its neighbor to the left. Due to place values sharing a constant ratio of ten, the system is called *decimal*.
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\scriptsize 10^2 && \scriptsize 10^1 && \scriptsize 10^0 && \scriptsize 10^{-1} &
|
||||
\quad \} \quad \text{Place values} \\
|
||||
4 && 3 && 2 .&& 1 &
|
||||
\quad \} \quad \text {Numerals: 1, 2, 3, 4} \\
|
||||
\hline
|
||||
\end{align*} \\
|
||||
\text{Four hundred, thirty-two, and one tenth}
|
||||
$$
|
||||
|
||||
It is difficult to write about the way we represent numbers without inadvertently reverting to the default of decimal. I will take care to write out each number explicitly in English when I mean that number. Conversely, when I want to refer to the symbols themselves, I will enclose them in quotes; for example, "0" refers to the symbol 0.
|
||||
|
||||
|
||||
A Brief History
|
||||
---------------
|
||||
|
||||
As I mentioned, this practice is millenia old. Before proceeding, I would like to discuss its history.
|
||||
|
||||
Arguably, this practice began with the Babylonians (circa eighteenth century BC), who instead used a sexagesimal (base sixty) system. It lacked a "decimal point" (more properly a sexagesimal point, *fractional separator*, or *radix point*), meaning that a representation could equally as well refer to thirty (30) or one-half (1/2), or one hundred and eight thousand (108000), since all these numbers differ by a power of sixty (60). This system lacked a "0" symbol to represent an empty place value, opting instead to simply skip them. Thus, the onus was on the arithmetician to properly align digits, maintain spacing, and correctly interpret results. Despite these limitations, it was robust enough to develop basic trigonometry and [approximate the square root of 2](https://en.wikipedia.org/wiki/YBC_7289).
|
||||
|
||||
Later, Indian mathematics developed its own place value system -- this time in the familiar base ten -- at least by the time of Aryabhata (4th century AD). It introduced the empty "0" symbol that the Babylonian system lacked. Eventually, this system made its way to Europe by means of the Arabs. The 16th century Dutch engineer Simon Stevin was one of the first individuals to introduce a "decimal point". Though modern notation differs slightly from his, it introduced (or perhaps re-introduced) a simple means of adding and multiplying fractions. Needless to say, this has become so popular as to become one of the most predominant ways to express integers and nonintegers alike.
|
||||
|
||||
Later thought realized bases other than ten were possible; for example, [binary](https://en.wikipedia.org/wiki/Binary_number) (base two) due in part to Leibniz. The strangest are non-integral bases, for example the complex base $2i$ due to Knuth. However, I find bases which rely on *irrational* numbers to be the most interesting.
|
||||
|
||||
Staying Golden
|
||||
--------------
|
||||
|
||||
The [golden ratio](https://en.wikipedia.org/wiki/Golden_ratio), a number with many apocryphal attributions, was the favorite of many Greek mathematicians. As such, it was originally recognized in the context of geometry, long before the development of algebra. It is constructed by dividing a line segment such that the ratio between the longer and shorter sub-segments is the same as the ratio between original segment and the longer one.
|
||||
|
||||
Phrased in modern algebraic language, the golden ratio $\phi$ is the unique positive root of the polynomial $x^2 - x - 1$, expressed as $\frac{1 + \sqrt 5}{2} \approx 1.618…$. Despite its name, this number is ir**ratio**nal, since it cannot be represented as a **ratio** of integers. Furthermore, raising it to any integral power does not produce an integer.
|
||||
|
||||
It might seem inconceivable that one may obtain an integer (other than zero or one) by summing powers of $\phi$. However, base $\phi$, also called phinary, does in fact exist. Here is a list of (canonical) expansions up to 10
|
||||
|
||||
```{}
|
||||
0 0
|
||||
1 1
|
||||
2 10.01
|
||||
3 100.01
|
||||
4 101.01
|
||||
5 1000.1001
|
||||
6 1010.0001
|
||||
7 10000.0001
|
||||
8 10001.0001
|
||||
9 10010.0101
|
||||
10 10100.0101
|
||||
```
|
||||
|
||||
We can obtain the entries on this list in two ways: generally and imprecisely, or directly and complexly.
|
||||
|
||||
|
||||
### The General Approach
|
||||
|
||||
In the most general sense, an expansion is just a sequence of integers, or digits. We can recover the value by summing the products of the integers by their place values. For example, a decimal number has the form
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
x &= ({a_n a_{n-1}... a_1 a_0})_{10} \\
|
||||
&= a_0 \cdot 10^0 + a_1 \cdot 10^1 + ... + a_{n-1} \cdot 10^{n-1} + a_n \cdot 10^{n}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Of course, negative indices may also be used, but these have been omitted for horizontal space.
|
||||
|
||||
This equivalence means that we can convert to and from a particular base. Naively, we might use the following "greedy" algorithm to derive the base *b* expansion (also called a [$\beta$-expansion](https://en.wikipedia.org/wiki/Non-integer_base_of_numeration)) of a number x
|
||||
|
||||
$$
|
||||
\small
|
||||
\begin{align*}
|
||||
&x_0 = x \\
|
||||
&\text{while}\ x_i > \epsilon &&
|
||||
\textcolor{blue}{\scriptsize \text{While we're not precise enough}}\\
|
||||
&\qquad p = \lfloor log_b {~x_i} \rfloor &&
|
||||
\textcolor{blue}{\scriptsize \text{Get the place value $p$}} \\
|
||||
&\qquad a_p = \left \lfloor \frac {n_i} {b^p} \right \rfloor &&
|
||||
\textcolor{blue}{\scriptsize \text{Place the correct digit in the $p^\text{th}$ place value}} \\
|
||||
&\qquad x_{i+1} = x_i -\ a_p \cdot b^l &&
|
||||
\textcolor{blue}{\scriptsize \text{Subtract out the value we just added to the expansion}} \\
|
||||
&\text{end}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
There are three problems with this.
|
||||
|
||||
1. It is inexact. The $x_i$ get smaller, but we can only ever approximate the result. For numbers smaller than the tolerance $\epsilon$, it is outright wrong.
|
||||
2. If *p* goes negative, a naive computation requires floating point arithmetic.
|
||||
- Algebraic extensions may be used, but this requires additional complexity.
|
||||
3. It relies on a transcendental function, the logarithm. One may approximate it by repeated division, but in general, it is practical to use the floating point operation.
|
||||
|
||||
Modern FPUs are fairly good at handling the latter two operations, but they are necessarily approximate. Fortunately for phinary, there is a direct method which remedies all these issues and produces exact results without floating point operations.
|
||||
|
||||
|
||||
### Deriving Expansions
|
||||
|
||||
Take another look at the representations above. Much like binary, phinary only requires the digits 0 and 1. Another slightly less obvious fact is that the string "11" does not occur in the expansion. This is because we can rewrite the polynomial as the following
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
x - 2 = 0 \implies
|
||||
\left. \begin{align*}
|
||||
x &= 2 \\
|
||||
10_x &= 02
|
||||
\end{align*} \right\} & \text{Binary}
|
||||
\\ \\
|
||||
\phi^2 - \phi - 1 = 0 \implies
|
||||
\left. \begin{align*}
|
||||
\phi^2 &= \phi + 1 \\
|
||||
100_\phi &= 11_\phi
|
||||
\end{align*} \right \} & \text{Phinary}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
This shows a connection between polynomials and positional notation which is not at all obvious. The second lines leverage positional notation in lieu of a symbol; their literal interpretation is the same as the first line.
|
||||
|
||||
When we multiply or divide by ten in decimal (or two in binary), we shift the digits left or right. Likewise, we may multiply or divide by $\phi$ on either side of the equation. Thus, it is also true that
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\left.
|
||||
\begin{align*}
|
||||
2^2 &= 2\cdot 2 &&\iff&
|
||||
100_2 &= 20_2 \\
|
||||
1 &= 2\cdot 2^{-1} &&\iff&
|
||||
1_2 &= 0.2_2
|
||||
\end{align*}\right \} & \text{Binary}
|
||||
\\ \\
|
||||
\left.
|
||||
\begin{align*}
|
||||
\phi^3 &= \phi^2 + \phi &&\iff&
|
||||
1000_\phi &= 110_\phi \\
|
||||
\phi &= 1 + \frac 1 \phi &&\iff&
|
||||
10_\phi &= 1.1_\phi
|
||||
\end{align*}\right \} & \text{Phinary}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Since this relationship holds for any adjacent place values, it is analogous to "carrying" in base ten. In decimal, we care if a single place value exceeds ten, and its excess goes into the next place value. In phinary, we care if there are two "1"s in adjacent place values, and do the same.
|
||||
|
||||
More generally, we can look at expansions not restricted to the symbols "0" and "1" and do similarly
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
32_\phi &= 121_\phi \\
|
||||
0.61_\phi &= 1.5_\phi
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Thinking a little more cleverly, we can decompose 2 as
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\textcolor{red}{2} = 1.\textcolor{red}{11}_\phi =
|
||||
\textcolor{blue}{1.1}1_\phi &= \textcolor{blue}{1}0.01_\phi \\
|
||||
2 &= \phi + \phi^{-2}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Using this rule, we can learn how to count in phinary. We count in base ten by incrementing the ones digit (or 0th place value) and carrying tens to higher digits. In phinary, we have two carry rules, which we repeat until we cannot:
|
||||
|
||||
1. Express "011" as "100"
|
||||
2. Express "0200" as "1001"
|
||||
|
||||
Both of these rules hold for larger digits as well, for example:
|
||||
|
||||
$$
|
||||
\stackrel{\text{Carry 033 = 300}}{
|
||||
00\textcolor{red}{043}_\phi =
|
||||
00\textcolor{red}{310}}_\phi =
|
||||
\stackrel{\text{Carry 0200 = 1001}}{
|
||||
0\textcolor{blue}{0310}_\phi =
|
||||
0\textcolor{blue}{1111}}_\phi =
|
||||
0\textcolor{green}{11}\textcolor{orange}{11}_\phi =
|
||||
\textcolor{green}{1}0\textcolor{orange}{1}00_\phi
|
||||
$$
|
||||
|
||||
Aggressively applying these rules results in the same expansion as the greedy algorithm.
|
||||
|
||||
|
||||
### The Other Root
|
||||
|
||||
As a quadratic, the polynomial $x^2 - x - 1$ has two roots: $\phi$ and its conjugate $\phi^* = -\phi^{-1}$. This implies that each phinary string can be interpreted by either root.
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
5 = 1000.1001_{\phi_{\phantom{*}}}
|
||||
&= \phi^3 + \phi^{-1} + \phi^{-4} \\
|
||||
\phantom{5} = 1000.1001_{\phi^*}
|
||||
&= ((-\phi)^{-1})^3 + ((-\phi)^{-1})^{-1} + ((-\phi)^{-1})^{-4} \\
|
||||
&= \phi^{4} -\ \phi -\ \phi^{-3} \\
|
||||
&= 10000_\phi -\ 10.001_\phi
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Since $-\phi^{-1}$ is negative, its powers alternate between positive and negative. Also, since its magnitude is less than 1, place values to the right of the radix point are larger than 1, the inverse of what one is used to with base ten.
|
||||
|
||||
Proceeding onwards,
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
10000_\phi &= 1100_\phi = 1011_\phi = 1010.11_\phi \\
|
||||
&= 1010.1011_\phi \\
|
||||
1000.1001_{\phi^*} &= 10000_\phi -\ 10.001_\phi \\
|
||||
&= 1010.1011_\phi -\ 10.001_\phi \\
|
||||
&= 1000.1001_\phi
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
And we breathe a sigh of relief since these expansions are equal. This is perhaps one of the reasons phinary expansions seem so verbose.
|
||||
|
||||
|
||||
Fibonacci and Zeckendorf
|
||||
------------------------
|
||||
|
||||
Instead of assigning place values to powers of the base, we can instead imagine a situation where the place values correspond to the values of a sequence, in particular the Fibonacci numbers. Phi also turns up when discussing this sequence, or more generally, sequences generated by the recurrence $a_{n+1} = a_n + a_{n-1}$. This bears a startling resemblance the the polynomial mentioned above, with cursory examination by generating functions revealing the connection.
|
||||
|
||||
Fibonacci numbers are all integers, so sums of them can only express integers. This is called the *Zeckendorf expansion*. We assign place values to unique Fibonacci numbers starting with the second 1. Hence, one is "1" and not "10".
|
||||
|
||||
Analogously to the algorithm above, we may derive an expansion for a number by subtracting out the largest Fibonacci number less than it (possibly multiple times) and repeating with the remainder. Expansions of the integers up to 10 are:
|
||||
|
||||
```{}
|
||||
0 0
|
||||
1 1
|
||||
2 10
|
||||
3 100
|
||||
4 101
|
||||
5 1000
|
||||
6 1001
|
||||
7 1010
|
||||
8 10000
|
||||
9 10001
|
||||
10 10010
|
||||
```
|
||||
|
||||
Not only are these representations very similar to the phinary strings above, but they are also all binary strings that do not contain two consecutive 1's ([OEIS A014417](https://oeis.org/A014417)). This representation is exactly as arbitrary as preferring the greedy phinary representation; instead, this is the "greedy series expansion" of an integer in the Fibonacci numbers.
|
||||
|
||||
```{}
|
||||
8 5 3 2 1 | 1 ~
|
||||
2 2
|
||||
1 0 . 0 1
|
||||
1 0
|
||||
4 2 0
|
||||
1 0 0 . 1
|
||||
1 0 1
|
||||
```
|
||||
|
||||
In the expansion of 2, the rightmost "1" seems to underflow. However, in the expansion of 4, we must consider the second "1" in the negative first place value. It acts as a sort of temporary storage which is immediately transferred into the actual place value.
|
||||
|
||||
|
||||
Synthesis: Generalizing Phinary
|
||||
-------------------------------
|
||||
|
||||
By starting with the golden ratio base, many natural questions arise. Does this approach work with other quadratic roots? Are there any restrictions on the coefficients (or sequences)? Does it work with any polynomial with positive roots? Are only monic polynomials allowed? What digits are minimally necessary to represent any integer? How "canonical" can "canonical" really be?
|
||||
|
||||
Rather than answering these questions or giving proofs, I think it's best to lay some ground rules. Using the above examples, I have defined two genera of positional number systems:
|
||||
|
||||
- A *fractional* number system is one where the place values are determined by the powers of the root of a polynomial with integer coefficients. The "fraction" in fractional comes allowing negative powers of our base. Therefore, we can represent rational numbers and use a fractional separator.
|
||||
- Naturally, the decimal system currently in use fits in here, corresponding to the polynomial $x - 10$.
|
||||
- Likewise, phinary corresponds to the polynomial $x^2 - x - 1$.
|
||||
|
||||
- An *integral* number system is one where the place values are given by a strictly increasing integral sequence. It can express only integers and there is no fractional separator.
|
||||
|
||||
- As an example, the sequence produced from powers of an integer (e.g.: 1, 2, 4, 8, …), correspond to a "normal" system without support for fractions.
|
||||
|
||||
- The already-discussed the Fibonacci base fits here as well. In fact, since linear recurrence relations correspond to polynomials, this extends to a correspondence between an integral system and a fractional one.
|
||||
|
||||
- Other sequences are also valid, like the square numbers. In the "square number base" we know the digital root (of canonical expansions) never exceeds 4 due to [Lagrange's four-square theorem](https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem).
|
||||
|
||||
|
||||
### Alphabets
|
||||
|
||||
A positional number system not only has place values, but a *numeral alphabet*. In standard decimal, there are ten distinct symbols including "0": {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. The choice of symbols is arbitrary (it can vary with language), but each has a *weight*, the integer quantity assigned to them. In the modern world, Arabic numerals are standard and distinct from alphabetic characters, so the distinction between "weight" and "symbol" can be ignored by using them conventionally for the first ten whole numbers. Subsets of this alphabet include the binary alphabet, {0, 1}, and the ternary alphabet, {0, 1, 2}.
|
||||
|
||||
A *minimal alphabet* for a number system is an alphabet of the smallest size which can still represent every integer. It is most convenient to consider an alphabet of integers from 0 up to a particular value, even though it may be true that minimal alphabets might exist which "skip" over certain weights.
|
||||
|
||||
It is often useful to be able to borrow a symbol of a certain weight, even if it would not be present in a minimal alphabet (for example, using "2" when it is convenient to do so, as above). In this manner, it is also possible to interpret the representation of a number in one base in another arbitrary base.
|
||||
|
||||
*Balanced alphabets* also exist, which contain negative numeral weights. For example, the balanced ternary alphabet consists of the weights of $\{-1, 0, 1\}$. Powers of 3 always determine the place values in ternary, but expansions change to suit the alphabet. To conserve horizontal space, I'll use the symbols $\bar{1}$ and "T" to signify -1.
|
||||
|
||||
|
||||
### Canonicity
|
||||
|
||||
Finding the *canonical expansion* of a number should be as simple as incrementing the 0th place value and aggressively applying the carry. For fractional systems, this amounts to adding 1 the 1's digit, and for integral ones, adding it to the rightmost. However, note that irrational systems have at least *two* carry rules. In phinary, these are the "011" = "100" rule, and the "0200" = "1001" rule.
|
||||
|
||||
|
||||
### Questions About the Above Rules
|
||||
|
||||
One may take several exceptions with these definitions and the restrictions they impose, to which I will offer a brief dismissal:
|
||||
|
||||
|
||||
#### Why limit alphabet weights to integers?
|
||||
|
||||
Integers and integer arithmetic are fundamental systems with very straightforward addition and multiplication. Adding more complex rules by introducing fractions or polynomial roots creates unnecessary complications.
|
||||
|
||||
#### Why prefer weights of integers from 0 to n (or if balanced, -*n* to *n*)?
|
||||
|
||||
Alphabets are best kept inductive. Either a weight is the largest possible or its successor is also a weight. ?If we start with a negative weight, this includes balanced alphabets.
|
||||
|
||||
Unbounded alphabets have their uses. For example, we might hold off from carrying until necessary, or prefer expansions like $21_\phi = 1 + 2\phi$ to $21_\phi = 1000_\phi = \phi^4$.
|
||||
|
||||
The inductive base case, the binary alphabet, is fairly important for two reasons:
|
||||
|
||||
- Expansions can always be padded with 0s to produce other valid expansions.
|
||||
- If "1" does not exist in the alphabet, it should be derivable in some way from other symbols like "2" and "3".
|
||||
|
||||
|
||||
#### Do we prefer monic polynomials?
|
||||
|
||||
The recurrence relation corresponding to a non-monic polynomials must cycle mod the leading term. The simplest (only?) examples are just geometric series, in other words normal integral systems.
|
||||
|
||||
For example, the powers of 3 satisfy $2a_{n+1} = 5a_n + 3a_{n-1}$. But the RHS simplifies:
|
||||
|
||||
$$
|
||||
2a_{n+1} = 5a_n + 3a_{n-1} = 5a_n + a_n = 6a_n \\
|
||||
a_{n+1} = 3a_n
|
||||
$$
|
||||
|
||||
Incidentally, 3 is a root of $2x^2 - 5x - 3$. Fermat's little theorem is likely a component in proving this generally.
|
||||
|
||||
|
||||
#### Why exclude transcendentals from fractional systems?
|
||||
|
||||
Convergent series like $\exp{x}$ require coefficients which shrink quickly, far below a magnitude of 1. This conflicts with our expectation of counting polynomials to be integral polynomials. This is disappointing, since relatively simple (in terms of continued fractions, combinatorics, etc) transcendental like e relies on a series in rationals.
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
With these restrictions in mind, I wrote a simple Haskell library to help explore these systems (found [here](https://github.com/queue-miscreant/GenBase)). The [next post]() will discuss quadratic polynomials with larger coefficients than 1, and problems not discussed with higher expansions.
|
||||
242
polycount/2.qmd
Normal file
242
polycount/2.qmd
Normal file
@ -0,0 +1,242 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
Polynomial Counting: Binary and beyond
|
||||
======================================
|
||||
|
||||
This post assumes you have read [the one prior](), which introduces generalized polynomial counting.
|
||||
|
||||
Before I start, I'd like to introduce some shorthand. Since we prefer (monic) polynomials which may correspond to linear recurrences, it is useful to use an ordered tuple of their coefficients.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
x^{n+1} - a_0 x^n - a_1 x^{n-1} + ... - a_{n-1} x - a_n \\
|
||||
\iff \\
|
||||
\langle a_0, a_1, a_2, ..., a_{n-1}, a_n |
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
I choose this notation because the left angle bracket points in the direction of the carry. For example, the Fibonacci numbers satisfy the recurrence $\langle 1, 1|$. Equally, $\phi$ is the unique positive root of $\langle 1, 1|$. In the future, I'll refer to these tuples as "carries" for simplicity.
|
||||
|
||||
|
||||
The Silver Ratio
|
||||
----------------
|
||||
|
||||
The golden ratio is actually the first member of a sequence of *metallic ratios*. They are the roots of the polynomials $x^2 - nx - 1$ or $\langle n, 1|$ in the newly introduced notation. The next member (*n* = 2) is termed the *silver ratio*. It value is $\delta_s = 1 + \sqrt 2 \approx 2.414...$.
|
||||
|
||||
Like the the golden ratio corresponds to the Fibonacci numbers, the silver ratio corresponds to the *Pell numbers* ([OEIS A000129](http://oeis.org/A000129)). The Pell numbers begin $0, 1$ like the Fibonacci numbers, but instead have the recurrence $a_{n+1} = 2a_n + a_{n-1}$, and the sequence continues as $2, 5, 12, 29...$
|
||||
|
||||
With this relationship in mind, we can construct the (fractional) silver ratio system and the (integral) Pell number system. $\delta_s$ is bounded above by the integer 3, which is also strictly greater than the coefficients in $\langle 2 1|$. Therefore, it would make sense to derive the expansion of 3 in the same way as the golden ratio expansion of 2
|
||||
|
||||
$$
|
||||
\textcolor{red}{3} = 2.\textcolor{red}{21} = \textcolor{blue}{2.2}1 = \textcolor{blue}{1}0.11
|
||||
$$
|
||||
|
||||
Consequently, the expansions for the integers up to 10 are as follows:
|
||||
|
||||
```{}
|
||||
Silver Ratio Pell Numbers
|
||||
__
|
||||
210 12 5 2 1
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 2 1 0
|
||||
3 10.11 1 1
|
||||
4 11.11 2 0
|
||||
5 20.01 1 0 0
|
||||
6 100.01 1 0 1
|
||||
7 101.01 1 1 0
|
||||
8 102.01 1 1 1
|
||||
9 110.12 1 2 0
|
||||
10 111.12 2 0 0
|
||||
```
|
||||
|
||||
|
||||
### Weighing the Silver
|
||||
|
||||
Alternatively, we may choose a balanced alphabet ($\{\bar{1}, 0, 1\}$) to express these expansions. Because the carry is two place values wide, defining a canonical expansion is particularly tricky. Instead of the string "21" being illegal, it could be either of:
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
11_{\delta_s} &= 1\bar{1}0_{\delta_s}
|
||||
&&\iff&
|
||||
\bar{1}\bar{1}_{\delta_s} &= \bar{1}10_{\delta_s} \\
|
||||
10_{\delta_s} &= 1\bar{1}\bar{1}_{\delta_s}
|
||||
&&\iff&
|
||||
\bar{1}0_{\delta_s} &= \bar{1}11_{\delta_s}
|
||||
\end{align}
|
||||
$$
|
||||
|
||||
We prefer expansions to allow (2) rather than (1) since "0"s can be padded to (or removed from) either side indefinitely. Also, a standard conversion of the string "2" results in $10.\bar{1}$, which resembles (2).
|
||||
|
||||
```{}
|
||||
Silver Ratio Pell Numbers
|
||||
___
|
||||
3210 123 12 5 2 1
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 10.T 1 0
|
||||
3 1T0.T 1 T 0
|
||||
4 1T1.T 1 0 T
|
||||
5 10T.01 1 0 0
|
||||
6 100.01 1 0 1
|
||||
7 101.01 1 T 0 0
|
||||
8 1T00.T1 1 T 0 1
|
||||
9 1T01.T1 1 T 1 0
|
||||
10 1T1T.10T 1 0 T 0
|
||||
```
|
||||
|
||||
|
||||
Swapping the 2
|
||||
--------------
|
||||
|
||||
The *Jacbosthal numbers* ([OEIS A001045](http://oeis.org/A001045)) are a similar series to the Pell numbers. They are defined by swapping the Pell number recurrence coefficients, giving $\langle 1, 2|$. The sequence is "seeded" with $0, 1$ as before, producing $1, 3, 5, 11, 21...$. Since the coefficients are still bounded 3, we can try deriving its expansion
|
||||
|
||||
$$
|
||||
\textcolor{red}{3}00 = 2\textcolor{red}{12} =
|
||||
\textcolor{blue}{21}2 = \textcolor{blue}{1}1\bar{1}2
|
||||
$$
|
||||
|
||||
Unfortunately, there's not a clear way to progress. Carrying the rightmost "2" to the left undoes our work, and expanding it to the right just adds another 2. Perhaps the problem is with its expansion
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\textcolor{red}{2}00 = 1\textcolor{red}{0}\bar{1}2 ; \quad
|
||||
0 = 1\bar{2}\bar{1}2 = \bar{1}21\bar{2} \\ \\
|
||||
\begin{align*}
|
||||
2.0000 &= \phantom{+}10.\bar{1}200 \\
|
||||
+ 0.0000
|
||||
&= + \phantom{1}0.1\bar{2}\bar{1}2 \\ \hline
|
||||
\vphantom{2^{2^2}}\phantom{+}2.0000
|
||||
&= \phantom{+} 10.00\bar{1}2
|
||||
\end{align*}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Since the symbol "2" still appears in the expansion we can continue carrying and cancelling. If continued ad infinitum, we get an infinite string of "0"s. When this is chopped off, the final string is "$2 = 10$", which is obviously the same rule as binary.
|
||||
|
||||
Actually, it turns out that the roots of the polynomial $\langle 1, 2|$ are 2 and -1. The whole time, the polynomial was reducible! Moreover, an extended alphabet ended up being ultimately unnecessary. The integral base is not so fortunate, and requires the extra symbol "2":
|
||||
|
||||
```{}
|
||||
Binary Jacobsthal Numbers
|
||||
|
||||
3210 5 3 1
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 10 2
|
||||
3 11 1 0
|
||||
4 100 1 1
|
||||
5 101 1 0 0
|
||||
6 110 1 0 1
|
||||
7 111 1 0 2
|
||||
8 1000 1 1 0
|
||||
9 1001 1 1 1
|
||||
10 1010 2 0 0
|
||||
```
|
||||
|
||||
Numbers which include a 2 in their integral expansion seem to align with the sequence [OEIS 003158](http://oeis.org/A003158).
|
||||
|
||||
|
||||
Adding a Negative
|
||||
-----------------
|
||||
|
||||
Another simple modification to the Pell numbers is the recurrence $\langle 2,\bar{1}|$. The sequence produced from $0, 1$ is $2, 3, 4, 5...$, which are just the natural numbers. Since 2 still bounds (the absolute values of) the numbers in the recurrence, the binary alphabet still makes sense. Consider two expansions of 2 as below:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\textcolor{red}{20} &= 1\textcolor{red}{01} \\
|
||||
\textcolor{red}{2}000 = 1\textcolor{red}{2\bar{1}}0 &=
|
||||
1\textcolor{blue}{2}\bar{1}0 = 11\textcolor{blue}{1\bar{1}} \\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
In all of these expansions, the sum of the digits (or digital root) is 2. This is similar to the degenerate "positional" system unary, where the magnitude of the number is just its length in tally marks. The empty string signifies 0, "1" signifies 1, "11" signifies 2, and so on.
|
||||
|
||||
Looking at the polynomial $\langle 2, -1|$ a little closer, this is clearly the polynomial $x^2 - 2x + 1 = (x - 1)^2$. Expansions in unary and in the naturals are as follows:
|
||||
|
||||
```{}
|
||||
Unary Naturals
|
||||
|
||||
3210 4 3 2 1
|
||||
0 0
|
||||
1 1 1
|
||||
2 11 1 0
|
||||
3 111 1 0 0
|
||||
4 1111 1 0 0 0
|
||||
```
|
||||
|
||||
The lengths of the strings in both expansions match up. However in unary, the place values never grow from 1, while the naturals are unbounded.
|
||||
|
||||
The carry is applied in slightly different ways between the systems. In unary, it keeps the digital root consistent (if one introduces negative tallies), and in the naturals, the relationship $20 = 101$ is equivalent to the expression $2x = (x + 1) + (x - 1)$.
|
||||
|
||||
Our carry can be even worse than this. Consider $\langle 1, \bar{1}|$. The simple string "1" duplicates itself indefinitely in either direction:
|
||||
|
||||
$$
|
||||
0\textcolor{red}{10} = \textcolor{red}{1}01
|
||||
$$
|
||||
|
||||
The roots of $x^2 - x + 1$ are complex and have magnitude 1. While a well-defined counting system can arise from carries with negative numbers, complex numbers clearly require some care.
|
||||
|
||||
|
||||
Conjecture of Validity
|
||||
----------------------
|
||||
|
||||
After the experimentation in this article, I can now make claims about whether or not a polynomial is "valid" for counting.
|
||||
|
||||
|
||||
### Positive Carries
|
||||
|
||||
Systems like those based on the golden and silver ratios ($\langle 2,1|$) have carries with "nice" coefficients. To ensure that situations like the Jacobsthal base ($\langle 1,2|$) do not occur, I prefer carries which are irreducible and of the form
|
||||
|
||||
$$
|
||||
\langle a_n, a_{n-1}, a_{n-2}, ..., a_0| , \quad
|
||||
a_n \geq a_{n-1} \geq a_{n-2} \geq ... \geq a_0 \geq 0
|
||||
$$
|
||||
|
||||
In other words, the numbers which appear in the carry are strictly positive and monotonically decreasing. Since $a_n$ bounds the coefficients, we use the alphabet bounded above by $a_n + 1$.
|
||||
|
||||
While "normal" carries follow this scheme, they only have a single carry rule. Irrational bases typically have a second rule, which as it turns out, is equivalent to multiplying the carry by $(x - 1)$.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
{\small \text{Phinary:}} & (x^2 - x - 1)(x - 1) = x^3 - 2x^2 + 1 = 1\bar{2}01 \\
|
||||
{\small \text{Silver Ratio:}} & (x^2 - 2x - 1)(x - 1) = x^3 - 3x^2 + x + 1 = 1\bar{3}11 \\
|
||||
{\small \text{Jacobsthal:}} & (x^2 - x - 2)(x - 1) = x^3 - 2x^2 - x + 2 = 1\bar{2}\bar{1}2
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
I choose to call these carries *implicit*. Importantly for the valid bases, there is only a single negative term among all the positive terms. It describes the way in which a particular numeral "flows" into adjacent place values.
|
||||
|
||||
Reducible polynomials like the Jacobsthal one must have two integer roots, meaning that expansions have to conform to both bases simultaneously. Quadratic polynomials like this have the form: $(x - m)(x - n) = x^2 - (m+n)x + mn$. The latter term, as a product, grows faster than a sum, so fortunately these kinds of polynomials are rare (with the restriction given).
|
||||
|
||||
|
||||
### Negative Terms
|
||||
|
||||
The (valid) strings produced before by multiplying $x - 1$ into the carry have only one term with opposite sign from the rest. Therefore, we might dream up carries with a single positive term among all of the negatives. Like "2" in phinary, this positive term is the largest weight which can appear in the alphabet.
|
||||
|
||||
One must take special care with the sum of terms in the carry. $\langle 2,\bar{1}|$ is valid, but $\langle 1,\bar{1}|$ is not. The sum of the entries in the former is 1, while sum of the latter's is 0. Both of these are actually off by one due due to the highest term of the monic polynomial. The *true* digital roots are 0 and -1 respectively. The latter implies that the digital root of an expansion is unbounded, and this can be seen with $\langle 1, \bar{1}|$.
|
||||
|
||||
In other words, the single positive term must be at least 1 greater than the negative of the sum of the remaining terms.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\langle a_n, a_{n-1}, a_{n-2}, ..., a_0| ,~
|
||||
\text{ for } \sum_{i = 0}^{n}{a_i} \geq 1 \\
|
||||
\max(a_i) = a_p > 0 \ge a_i, ~ i \neq p
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Since these carries directly describe the rule for expanding the largest numeral, I refer to these carries as *explicit*.
|
||||
|
||||
In fact, the carry polynomials in these systems need not be monic. The only restriction is that all terms but one have the same sign, and that the remaining term dominates the rest (meaning the polynomial has a negative value when evaluated at 1). This is a complicated matter which I will not be delving into.
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
Polynomials with roots with magnitude 1 (but are not equal to 1) are a bit tricky to deal with. Again with regards to $\langle 1,2|$, the expansion for 2 was only achieved after assuming an infinite application of carries converged. Enough has been said about $\langle 1, \bar{1}|$ to disqualify it. This polynomial belongs to a family called [cyclotomic polynomials](https://en.wikipedia.org/wiki/Cyclotomic_polynomial), which have complex roots of 1 as their roots. I'll have more to say about cyclotomic polynomials in the future, but by themselves, they cannot be carries.
|
||||
|
||||
Since higher numbers appearing in carries are somewhat scary, the [next post]() will focus on two more generalizations of the Fibonacci numbers and exceptions to the above rules.
|
||||
484
polycount/3.qmd
Normal file
484
polycount/3.qmd
Normal file
@ -0,0 +1,484 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
Polynomial Counting: The third degree
|
||||
======================================
|
||||
|
||||
This post assumes you have read the [first]() post, which introduces generalized positional counting, and the [second](), which restricts the focus and specifies the general aim.
|
||||
|
||||
Thus far, the systems have been based on quadratic polynomials and two-term linear recurrences, or more directly, carries of width 2. With the complications from numbers larger than 1 addressed in the previous post, let's go back to Fibonacci.
|
||||
|
||||
|
||||
Tribonacci and Beyond
|
||||
---------------------
|
||||
|
||||
The *Tribonacci numbers* ([OEIS A000073](http://oeis.org/A000073)) come from elongating the Fibonacci recurrence to 3 terms. In other words, this is the carry/recurrence $\langle 1,1,1|$. The Tribonacci numbers are seeded with two zeros followed by a single 1; thus, the sequence begins $0, 0, 1, 1, 2, 4, 7, 13,\dots$ The *Tribonacci constant* is the limiting ratio of these numbers (i.e., the positive real root of $x^3 - x^2 - x - 1$) with approximate value $T = 1.8393…$. The value 2 bounds both this number and the terms in the recurrence, so its expansion can be deduced:
|
||||
|
||||
$$
|
||||
\textcolor{red}{2} = 1.\textcolor{red}{111}_T = \textcolor{blue}{1.11}1_T = \textcolor{blue}{1}0.001_T
|
||||
$$
|
||||
|
||||
Naturally, the string "111" will be illegal in both systems. The Tribonacci expansions of the integers are as follows:
|
||||
|
||||
```{}
|
||||
Tribonacci Constant Tribonacci
|
||||
(Base T) Numbers
|
||||
______
|
||||
3210 123456 7 4 2 1
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 10.001 1 0
|
||||
3 11.001 1 1
|
||||
4 100.100011 1 0 0
|
||||
5 101.100011 1 0 1
|
||||
6 110.101011 1 1 0
|
||||
7 1000.101011 1 0 0 0
|
||||
8 1001.101011 1 0 0 1
|
||||
9 1010.110100011 1 0 1 0
|
||||
10 1100.010100011 1 0 1 1
|
||||
```
|
||||
|
||||
Since "111" is a rarer string than "11", the integral base more closely resembles standard binary.
|
||||
|
||||
Extensions of the Fibonacci numbers, which have an *n*-term recurrence (seeded with *n* - 1 zeroes followed by a one) are called *n*-nacci numbers. If we discard the seeding terms, then for larger and larger *n*, this sequence of sequences appears to approach the powers of 2.
|
||||
|
||||
$$
|
||||
\begin{matrix}
|
||||
\text{Fibonacci: } & & & 0,& 1,& 1,& 2,& 3,& 5,& 8\dots \\
|
||||
\text{Tribonacci: }& & 0,& 0,& 1,& 1,& 2,& 4,& 7,& 13\dots \\
|
||||
\text{Tetranacci: } & 0,& 0,& 0,& 1,& 1,& 2,& 4,& 8,& 15\dots \\
|
||||
\vdots \\
|
||||
\text{Binary: } & (\dots,& 0,& 0,& 1,)& 1,& 2,& 4,& 8,& 16\dots
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
In the limit, the rightmost and leftmost "1"s in the carry are infinitely far away. This is similar to binary, in which $2 = 1.1111\dots_2$. This argument is clearer if we directly manipulate the carry as a polynomial:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
p_n &= x^n - x^{n-1} - … - x - 1 \\
|
||||
-p_n &= -x^n + x^{n-1} + … + x + 1 \\
|
||||
x^n - p_n &= x^{n-1} + … + x + 1 \\
|
||||
x - p_n x^{-n+1} &= 1 + x^{-1} + … x^{-n+2} + x^{-n+1} \\
|
||||
\text{Let } n &\rightarrow \infty \\
|
||||
x &= 1 + x^{-1} + x^{-2} + x^{-3} + …
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Since both $\phi$ and $T$ are greater than 1, we can assume that $x > 1$, which causes the $x^{-n+1}$ term to vanish in the limit. Unfortunately, this means $p_n$ should diverge, invalidating the equation. Despite this, it can still be manipulated as an equation in power series:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\frac{1}{1 - x} &= 1 + x + x^2 + x^3 + \dots \\
|
||||
\frac{1}{1 - (1/x)} &= 1 + x^{-1} + x^{-2} + x^{-3} + \dots \\
|
||||
x &= \frac{1}{1- (1/x)} \\
|
||||
x - 1 &= 1 \\
|
||||
x &= 2
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Which is to imply that, in a non-rigorous sense and by partially assuming the conclusion, that the n-nacci constants approach 2.
|
||||
|
||||
|
||||
Golder than Gold
|
||||
----------------
|
||||
|
||||
All carries entirely made up of 1s correspond to the *n*-nacci constants. While this would appear to exhaust every sequence without going to negative numbers, it ignores the potential of carries with a "0".
|
||||
|
||||
Starting simple, Narayana's cows sequence ([OEIS A000930](http://oeis.org/A000930)) corresponds to the recurrence $\langle 1,0,1|$. It may be seeded with either three 1's, or in the same way as above, with a sequence of 0's followed by a 1. The limiting ratio $\psi \approx 1.4656\dots$ is called the supergolden ratio. The introduction of "0"s turns out to have big implications, since the concatenation trick no longer works. However, hope is not lost.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
1\textcolor{red}{1}000_\psi
|
||||
= 10\textcolor{red}{101}_\psi
|
||||
= \textcolor{blue}{101}01_\psi
|
||||
= \textcolor{blue}{1}00001_\psi \\
|
||||
\textcolor{red}{2} = 1.\textcolor{red}{101}_\psi
|
||||
= \textcolor{blue}{1.1}01_\psi
|
||||
= \textcolor{blue}{1}0.001\textcolor{blue}{1}_\psi
|
||||
= 10.00\textcolor{purple}{11}_\psi
|
||||
= 10.0\textcolor{purple}{1}0000\textcolor{purple}{1}_\psi
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The carry contains implicit rules for not only "101", but also "11". This sort of makes sense: since $\psi < \phi$, adjacent place values are "too dense", and therefore we can rewrite the string "11". On the other hand, attempting to manipulate "1001" and "10001" results in circuiting back to the original string.
|
||||
|
||||
$$
|
||||
\begin{split}
|
||||
100\textcolor{red}{1}000000_\psi
|
||||
&= 1000\textcolor{red}{101}000_\psi
|
||||
= 1000\textcolor{orange}{1}01000_\psi
|
||||
= 10000\textcolor{orange}{1}1\textcolor{orange}{1}00_\psi \\
|
||||
&= 10000\textcolor{blue}{11}100_\psi
|
||||
= 1000\textcolor{blue}{1}0010\textcolor{blue}{1}_\psi
|
||||
= 1000100\textcolor{red}{101}_\psi \\
|
||||
&= 100010\textcolor{red}{1}000_\psi
|
||||
= 1000\textcolor{orange}{101}000_\psi
|
||||
= 100\textcolor{orange}1000000_\psi \\ \\
|
||||
\textcolor{red}{1}0001000_\psi
|
||||
&= 0\textcolor{red}{101}1000_\psi
|
||||
= 010\textcolor{blue}{11}000_\psi
|
||||
= 01\textcolor{blue}{1}0000\textcolor{blue}{1}_\psi \\
|
||||
&= 0\textcolor{purple}{11}00001_\psi
|
||||
= \textcolor{purple}{1}0000\textcolor{purple}{1}01_\psi \\
|
||||
&= 10000\textcolor{red}{101}_\psi = 1000\textcolor{red}{1}000_\psi
|
||||
\end{split}
|
||||
$$
|
||||
|
||||
I call these strings of "0"s sandwiched between "1"s *spacings*. The smallest spacing, with a width of 0, is the Fibonacci recurrence. If we forbid both the width-1 and width-0 spacings from appearing in supergolden expansions, we obtain the following list
|
||||
|
||||
```{}
|
||||
Supergolden Ratio
|
||||
__________
|
||||
6543210 123456789A
|
||||
0 0
|
||||
1 1
|
||||
2 10.0100001
|
||||
3 100.0110001
|
||||
3 100.1000100001
|
||||
4 110.0001100001
|
||||
4 1000.1000100001
|
||||
5 1010.0001100001
|
||||
5 10000.0010001
|
||||
6 10001.0010001
|
||||
7 10010.0110002
|
||||
7 10010.1000012
|
||||
7 100000.0001000001
|
||||
8 100001.0001000001
|
||||
9 100100.0000001001
|
||||
10 1000000.0000001001
|
||||
```
|
||||
|
||||
In the above table, some intermediate steps are shown in red, but the last entry for each integer is canonical. Not only does the number of digits grow radically faster than in phinary (or even binary), but there are many more intermediate steps.
|
||||
|
||||
For space reasons, I do not show the integral dual. Slowly-growing sequences, which have largely uninteresting integral systems, dominate the rest of this post. Therefore, the remainder of this post will focus solely on fractional systems.
|
||||
|
||||
|
||||
Radiant Plastic
|
||||
---------------
|
||||
|
||||
A similar degree 3 recurrence is $\langle 0,1,1|$. Its root corresponds to the plastic ratio $\rho\ (\approx 1.3247…)$. A number of sequences share this recurrence; when seeded with $0, 0, 1$ as before, the best match is the Padovan sequence ([OEIS A000931](http://oeis.org/A000931)), which begins with an additional 1.
|
||||
|
||||
Since $\rho < \psi < \phi$, we should expect that spacings of at least width 2 are illegal. The system turns out to be even stricter than that: widths up to and including 3 being expandable.
|
||||
|
||||
$$
|
||||
\begin{array}{c|c}
|
||||
\text{Width} & \textcolor{red}{0} & \textcolor{green}{1} & 2 & \textcolor{blue}{3} \\ \hline
|
||||
& 0\textcolor{red}{011}_\rho
|
||||
& 010\textcolor{red}{1}000_\rho
|
||||
& 0\textcolor{red}{1}00\textcolor{red}{1}00000_\rho
|
||||
& 0\textcolor{red}{1}0001_\rho
|
||||
\\
|
||||
& \textcolor{red}{1}000_\rho
|
||||
& 0100\textcolor{red}{011}_\rho
|
||||
& 00\textcolor{red}{011}\textcolor{red}{011}00_\rho
|
||||
& 00\textcolor{red}{011}1_\rho
|
||||
\\
|
||||
&& 0\textcolor{blue}{10001}1_\rho
|
||||
& 000\textcolor{blue}{11011}00_\rho
|
||||
& 000\textcolor{orange}{111}_\rho
|
||||
\\
|
||||
&& \textcolor{blue}{1}000001_\rho
|
||||
& 00\textcolor{blue}{1}0101000_\rho
|
||||
& 00\textcolor{orange}{1}100_\rho
|
||||
\\
|
||||
&&
|
||||
& 0010\textcolor{green}{101}000_\rho
|
||||
& 0\textcolor{red}{011}00_\rho
|
||||
\\
|
||||
&&
|
||||
& 001\textcolor{green}{1000001}_\rho
|
||||
& \textcolor{red}{1}00000_\rho
|
||||
\\
|
||||
&&
|
||||
& 0\textcolor{red}{011}000001_\rho
|
||||
\\
|
||||
&&
|
||||
& \textcolor{red}{1}000000001_\rho
|
||||
\\\\
|
||||
\hline
|
||||
& s_0 = \rho^2
|
||||
& s_1 = \rho s_{5}
|
||||
& s_2 = \rho s_{8}
|
||||
& s_3 = \rho
|
||||
\end{array}
|
||||
$$
|
||||
|
||||
With these spacings, we can write a canonical expansion expansion for 2:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\textcolor{red}{2}
|
||||
&= 1.\textcolor{red}{011}
|
||||
= \textcolor{blue}{1.011}
|
||||
= \textcolor{blue}{1}\overbrace{0.0100000}^{8 \text{ digits}}\textcolor{blue}{1} \\
|
||||
&= \textcolor{purple}{10.01}000001
|
||||
= \textcolor{purple}{1}00.000000\textcolor{purple}{1}1 \\
|
||||
&= 100.00000\textcolor{red}{011}
|
||||
= 100.0000\textcolor{red}{1}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Since $\rho < \sqrt 2$, the largest place value in the expansion of 2 is $\rho^2$, distinguishing it from previous systems.
|
||||
|
||||
Similarly to how the width-2 and width-3 spacings are allowed in the supergolden ratio base, we realize that the width-4 spacing cannot be expanded further in the plastic ratio base:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\textcolor{red}{1}0000\textcolor{red}{1}000
|
||||
&= 0\textcolor{red}{011}00\textcolor{red}{011}
|
||||
= 001\textcolor{blue}{10001}1
|
||||
= 00\textcolor{blue}{2}000001 \\
|
||||
&= \textcolor{blue}{1}000000\textcolor{blue}{1}1
|
||||
= 100001000
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
With these implicit rules about width-3 spacings and below, the plastic expansions of the integers up to 10 are as follows:
|
||||
|
||||
```{}
|
||||
Plastic Ratio
|
||||
__________________
|
||||
76543210 123456789ABCDEFGHI
|
||||
0 0
|
||||
1 1
|
||||
2 100.00001
|
||||
3 101.00001
|
||||
3 1000.00101
|
||||
3 1000.01000001
|
||||
4 10000.0101000000001
|
||||
4 10000.1000001000001
|
||||
5 10100.0000001000001
|
||||
5 100000.1000001000001
|
||||
6 100001.1000001000001
|
||||
6 100100.0000001000001
|
||||
6 1000000.0010001000001
|
||||
6 1000000.0100000000001
|
||||
7 1000001.0100000000001
|
||||
7 1000010.0000100000001
|
||||
8 1001000.0000100000001
|
||||
8 10000000.0100100000001
|
||||
8 10000000.1000000001001
|
||||
8 10000000.100000001000000001
|
||||
9 10000100.000000001000000001
|
||||
10 10001000.001000001000000001
|
||||
```
|
||||
|
||||
Clearly, this base is incredibly sensitive. A number as small as 8 has a fractional part as small as $\rho^{-18}$ in its expansion.
|
||||
|
||||
|
||||
Skipped Spacings
|
||||
----------------
|
||||
|
||||
When discussing the expandable spacings in the supergolden and plastic bases, they jumped from width 1 to width 3, implying we forgot width 2. The strings "1001" and "10001" are associated to the carries $\langle 1, 0, 0, 1|$ and $\langle 1, 0, 0, 0, 1|$.
|
||||
|
||||
| Spacing Width | Carry | Integral Sequence | Root |
|
||||
|---------------|-------|-------------------|------|
|
||||
| 0 | $\langle 1,1|$ | Fibonacci numbers, Lucas numbers | Golden Ratio, $\phi$ |
|
||||
| 1 | $\langle 1,0,1|$ | Narayana's cows sequence | Supergolden Ratio, $\psi$ |
|
||||
| 2 | $\langle 1,0,0,1|$ | | Unnamed $(\upsilon?)$ |
|
||||
| 3 | $\langle 1,0,0,0,1| = \langle 0,1,1|$ | Padovan sequence, Perrin sequence | Plastic Ratio, $\rho$ |
|
||||
|
||||
The symbol $\upsilon$ comes from the second half of the Greek alphabet, like the others. There do not appear to be any sequences in the OEIS with this recurrence signature. While the width-2 spacing is a irreducible polynomial like its predecessors, the width-3 one can be factored
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\langle 1,0,0,0, 1| = x^5 - x^4 - 1 &= (x^2 - x + 1)(x^3 - x - 1) \\
|
||||
&= \Phi_6 \langle 0, 1, 1|
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
The right polynomial is familiar from the previous post as the one with only complex roots. It happens to be the sixth cyclotomic polynomial, and allows the width-3 spacing to be equivalent to the simpler plastic ratio carry. This also means that despite $\rho$ and $\psi$ being cubic roots, $\upsilon$ is irreducibly a quartic root, despite being between them in terms of spacing width.
|
||||
|
||||
As previously stated, the cyclotomic polynomials cause big trouble for carries. Other than factoring, there appears to be no way to derive $\langle 0,1,1|$ from $\langle 1,0,0,0,1|$. At best, we can observe the following:
|
||||
|
||||
$$
|
||||
\begin{matrix}
|
||||
\langle 1,0,0,0,1| && \langle 0,1,1| \\ \hline
|
||||
11111 &\iff& 11111 \\
|
||||
101110 && 1000111 \\
|
||||
1001100 &\iff& 1001100 \\
|
||||
10001000 && 1100000 \\
|
||||
100000000 &\iff& 100000000 \\
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
|
||||
### Chopped Circles
|
||||
|
||||
The appearance of a cyclotomic factor is not unique to the width-3 spacing. Each of the smaller-width rules in the supergolden and plastic bases can be reexamined as polynomials. After converting and factoring, their cyclotomic factors become clear:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
11000_\psi = 100001_\psi \\
|
||||
1\bar{1}\bar{1}001_\psi = 0 \\
|
||||
\psi^5 - \psi^4 - \psi^3 + 1 \\
|
||||
(\psi - 1)(\psi + 1)(\psi^3 - \psi^2 - 1) \\
|
||||
\Phi_1 \Phi_2 \langle 1,0,1|
|
||||
\\ \\
|
||||
\begin{gather*}
|
||||
101000_\rho = 1000001_\rho &
|
||||
100100000_\rho = 1000000001_\rho \\
|
||||
1\bar{1}0\bar{1}001_\rho = 0 &
|
||||
1\bar{1}00\bar{1}00001_\rho = 0 \\
|
||||
\rho^6 - \rho^5 - \rho^3 + 1 &
|
||||
\rho^9 - \rho^8 - \rho^5 + 1 \\
|
||||
(\rho - 1)(\rho^2 + 1)(\rho^3 - \rho - 1) &
|
||||
\dots(\rho^2 - \rho + 1)(\rho^3 - \rho - 1) \\
|
||||
\Phi_1 \Phi_4 \langle 0,1,1| &
|
||||
\Phi_1 \Phi_2 \Phi_4 \Phi_6 \langle 0,1,1|
|
||||
\end{gather*}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Though I am uncertain without a proof, it seems that cyclotomic polynomials play a role in "spacing out 1's". This is to say that spacings have a "fundamental" irreducible polynomial. By multiplying certain cyclotomic polynomials by the fundamental, (all?) smaller spacings can produce spacings the size of the fundamental or less.
|
||||
|
||||
Naturally, I attempted to write a program to compute lesser spacings from an implicit rule. Generally, this entailed assembling all lesser spacings, then expanding the rightmost 1 if unable to find any spacing, else replacing and continuing. Unfortunately, since it operates in lockstep, it gets stuck easily, and I had little success. My Haskell code can be found [here]().
|
||||
|
||||
|
||||
### Inherently Factorable Spacings
|
||||
|
||||
The width-3 spacing is not fundamental, since it can be factored. Using [WolframAlpha](https://www.wolframalpha.com/input/?i=Table%5B+IrreduciblePolynomialQ%5B+x%5En+-+x%5E%28n-1%29+-+1%5D%2C+%7Bn%2C+1%2C+20%7D+%5D), I was able to collect reducible spacings into a table. In the range given, it appears to repeat every six terms.
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
x^5 - x^4 - 1 &= (x^2 - x + 1)(x^3 - x - 1) \\
|
||||
&= 1\bar{1}1_x * 10\bar{1}\bar{1}_x \\
|
||||
x^{11} - x^{10} - 1 &= (x^2 - x + 1)
|
||||
(x^9 - x^7 - x^6 + x^4 + x^3 - x - 1) \\
|
||||
&= 1\bar{1}1_x * 10\bar{1}\bar{1}0110\bar{1}\bar{1}_x
|
||||
\\
|
||||
x^{17} - x^{16} - 1 &= (x^2 - x + 1)
|
||||
(x^{15} - x^{13} - \dots + x^4 + x^3 - x - 1) \\
|
||||
&= 1\bar{1}1_x * 10\bar{1}\bar{1}0110\bar{1}\bar{1}0110\bar{1}\bar{1}_x \\
|
||||
5, 11, 17, \dots &= 6n + 5
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Each of these polynomials has $\Phi_6$ as a common factor. The other factor appears to be a truncation of the repeating string "$\underline{0110\bar{1}\bar{1}}$". Note: since I already use the overbar for negative digits, I gather repeating terms using an underline as a vinculum. Interpreted as a power series, this is the reciprocal of $-\Phi_6$. As the carry approaches infinite width, the higher terms go to 0 for $x < 1$:
|
||||
|
||||
|
||||
Repeating Expansions
|
||||
--------------------
|
||||
|
||||
Let's not get too eager here and return to base $\upsilon$. It should be possible to expand the strings "11" and "101", since it is the fundamental spacing of width 2. However, we immediately run into an issue:
|
||||
|
||||
$$
|
||||
\begin{array}{c|c}
|
||||
\text{Width} & \textcolor{green}{0} & \textcolor{blue}{1} & \textcolor{red}{2} \\ \hline
|
||||
& 01\textcolor{red}{1}00000_\upsilon
|
||||
& 010\textcolor{red}{1}0000_\upsilon
|
||||
& 0\textcolor{red}{1001}_\upsilon
|
||||
\\
|
||||
& 010\textcolor{red}{1001}0_\upsilon
|
||||
& 0100\textcolor{red}{1001}_\upsilon
|
||||
& \textcolor{red}{1}0000_\upsilon
|
||||
\\
|
||||
& 0\textcolor{blue}{101}0010_\upsilon
|
||||
& 0\textcolor{orange}{1001}001_\upsilon
|
||||
\\
|
||||
& \textcolor{blue}{1}000001\textcolor{blue}{1}_\upsilon
|
||||
& \textcolor{orange}{1}0000001_\upsilon
|
||||
\\
|
||||
& 100000\textcolor{green}{11}_\upsilon \\
|
||||
& \vdots \\ \hline
|
||||
& s_0 = \ ? & s_1 = \rho s_6 & s_2 = \rho
|
||||
\end{array}
|
||||
$$
|
||||
|
||||
The width-0 expansion is recursive. If we continue to apply its rule, we generate the string "100001" repeating. Fortunately, each repeating unit is a width 4 spacing, which is allowed by the carry.
|
||||
|
||||
Repeating expansions imply a representation by geometric series:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
1.\underbrace{\underline{0\dots1}}_{n}{}_x = 1 + x^{-n} + x^{-2n} + x^{-3n} + \dots
|
||||
= \frac{1}{1 - (1/x)^n} = \frac{x^n}{x^n - 1}
|
||||
\\
|
||||
10 = 1.\underbrace{\underline{0\dots1}}_{n}{}_x ~\iff~ x = \frac{x^n}{x^n - 1} \\
|
||||
1 = \frac{x^{n-1}}{x^n - 1} \\ \\
|
||||
x^{n-1} = x^n - 1
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The final expression is just the definition of a carry, so we can immediately write:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
10_\phi &= 1.\underline{01}_\phi & &
|
||||
\text{Carry } \langle 1,1| \\
|
||||
10_\psi &= 1.\underline{001}_\psi & &
|
||||
\text{Carry } \langle 1,0,1| \\
|
||||
10_\upsilon &= 1.\underline{0001}_\upsilon & &
|
||||
\text{Carry } \langle 1,0,0,1| \\
|
||||
10_{\rho} &= 1.\underline{00001}_\rho & &
|
||||
\text{Carry } \langle 1,0,0,0,1| = \langle 0,1,1|
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
But we didn't want "10" as a repeating expansion, we wanted "11". Attempting to justify with the same strategy:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
0.11_\upsilon &= 1.\underline{00001}_\upsilon & \text{Carry } \langle 1,0,0,1|
|
||||
\\
|
||||
\frac{1}{x} + \frac{1}{x^2} &= \frac{x^n}{x^n - 1} \\
|
||||
x + 1 &= \frac{x^{n+2}}{x^n - 1} \\
|
||||
\\
|
||||
x^{n+1} + x^n - x - 1 &= x^{n+2} \\
|
||||
x^{n+2} - x^{n+1} - x^n + x + 1 &= 0 \\
|
||||
(x^n)(x^2 - x - 1) + x + 1 &= 0
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
For *n* = 5, the polynomial has $\langle 1, 0, 0, 1|$. This polynomial has another factor, $\langle 0,1,1|$, which should come as no surprise since we know directly that $0.11_\rho = 10_\rho$. Quickly checking [WolframAlpha](http://Table[ IrreduciblePolynomialQ [x^n(x^2 - x - 1) + x + 1], {n, 1, 20} ]) for *n* from 0 to 20 shows that this is the only *n* in that range whose carry polynomial is reducible. This bestows some level of intrigue upon the repeating expansion of "11". Since repeating expansions are required for base $\upsilon$ I will elect to not show the expansion of the integers.
|
||||
|
||||
|
||||
### Weird Modulus Patterns
|
||||
|
||||
This can be generalized slightly to match any spacing with any repeating spacing:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
0.\underbrace{10\dots01}_m = 1.\underbrace{\underline{0\dots01}}_n
|
||||
~\Leftrightarrow~
|
||||
\frac{1}{x} + \frac{1}{x^m} = \frac{x^n}{x^n - 1}
|
||||
\\
|
||||
x^{m-1} + 1 = \frac{x^{n+m}}{x^n - 1} \\
|
||||
\\
|
||||
x^{n+m-1} + x^n - x^{m-1} - 1 = x^{n+m}\\
|
||||
x^{n+m} - x^{n+m-1} - x^n + x^{m-1} + 1 = 0 \\
|
||||
(x^n)(x^m - x^{m-1} - 1) + x^{m-1} + 1 = 0 \\
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Another [table](https://www.wolframalpha.com/input/?i=Table%5B+IrreduciblePolynomialQ+%5Bx%5En%28x%5Em+-+x%5E%28m-1%29+-+1%29+%2B+x%5E%28m-1%29+%2B+1%5D%2C+%7Bn%2C+1%2C+20%7D%2C+%7Bm%2C+1%2C+20%7D%5D) can be generated by searching for $(m, n)$ for which this polynomial is reducible. If the polynomial has factors, then bases where those factors are carries have repeating expansions of width *n* for a spacing of width *m*. Graphing the tuples of reducible polynomials produces a strange pattern apparently arranged in lines (going from the lower left to the upper right):
|
||||
|
||||
![]()
|
||||
|
||||
The leftmost purple square is the exception, which corresponds to the earlier $(m, n) = (2, 5)$. Every purple square here is a reducible polynomial, the first few of whose factors are:
|
||||
|
||||
|
||||
| $(m, n)$ | Sum | Polynomial Factors
|
||||
|----------|-----|-------------------
|
||||
| (2, 5) | 7 | $(x^3 - x - 1) (x^4 - x^3 - 1)$
|
||||
| (3, 11) | 14 | $(x^4 - x^3 + x^2 - x + 1)$ $(x^{10} - x^8 - x^7 - x^6 - x^5 + x^3 + x^2 + x + 1)$
|
||||
| (7, 7) | | $(x^4 - x^3 + x^2 - x + 1)$ $(x^{10} - x^8 - x^5 + x + 1)$
|
||||
| (13, 1) | | $(x^4 - x^3 + x^2 - x + 1)$ $(x^{10} + x^7 - x^5 - x^2 + 1)$
|
||||
| (7, 17) | 24 | $(x^4 - x^3 + x^2 - x + 1)$ $(x^{20} - x^{18} - x^{15} - x^{12} + x^{10} + x^7 - x^5 + x + 1)$
|
||||
| (13, 11) | | $(x^4 - x^3 + x^2 - x + 1)$ $ $(x^{20} - x^{18} - x^{15} + x^{13} + x^{10} + \dots + x + 1)$
|
||||
| (17, 7) | | $(x^4 - x^3 + x^2 - x + 1)$ $(x^{20} - x^{18} - x^{15} + x^{13} + x^{12} + \dots + x + 1)$
|
||||
| (17, 17) | | $(x^4 - x^3 + x^2 - x + 1)$ $(x^{30} - x^{28} - x^{25} + x^{23} + x^{20} - x^{18} - \dots + x + 1)$
|
||||
|
||||
Only the first entry has factor that is a carry associated to a spacing. Every other entry appears to have $(x^4 - x^3 + x^2 - x + 1)$ as a common factor, which is the 10th cyclotomic polynomial.
|
||||
|
||||
These solutions also have sums which increment in tens, which correspond to the vertical and horizontal lines of purple squares in the image. Both *m* and *n* solutions work in a similar way: the symmetric solution (7, 7) has other similar solutions (7, 17), (17, 7), and (17, 17). This pattern also holds up in the "next" terms (7,27), (17,27), (27,27), (27,17), and (27,7). It appears as though there is a congruence of $m + n\ (\text{mod } mn)$, where m and n come from the exception (2, 5). This pattern is similar to the one in which one in every six spacings can be factored.
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
In summary, the Fibonacci recurrence can be generalized in at least two two different ways. Introducing "0"s into the carry is more touch-and-go than would otherwise seem, though they produce (with much effort) valid bases. The [next post]() will explore a more distant cousin of the Fibonacci numbers, and other strange power series which arise from its discussion.
|
||||
366
polycount/4.qmd
Normal file
366
polycount/4.qmd
Normal file
@ -0,0 +1,366 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
|
||||
Polynomial Counting: Two 2's
|
||||
============================
|
||||
|
||||
This post assumes you have read [the first](), which introduces generalized polynomial counting, and [the second](), which restricts the focus and specifies the general aim.
|
||||
|
||||
|
||||
Gray Silver
|
||||
-----------
|
||||
|
||||
As previously shown, the golden ratio (recurrence $\langle 1, 1|$) can be generalized in several ways. The silver ratio was introduced as the next "metallic mean", a sequence of quadratic roots of the form $\langle n, 1|$, and the limiting ratios of the corresponding recurrences. These roots have a (simple) [*continued fraction*](https://en.wikipedia.org/wiki/Continued_fraction) expansion:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\langle n, 1| ~~\iff~~ x^2 - nx - 1 \\
|
||||
x^2 = nx + 1 ~~\implies~~
|
||||
x = n + \frac{1}{x} \\
|
||||
x = n + \cfrac{1}{n + \cfrac{1}{n + \cfrac{1}{n + \cfrac{1}{\ddots}}}} = [n; \underline{n}]
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Again, the underline denotes repetition, since the overbar has been used for negation. When we examined the Jacobsthal base, we tried flipping n and 1 before seeing that the system was hard to manipulate. However, parametrizing in both terms (recurrence $\langle n, n|$) demonstrates a strange duality with the above continued fraction:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\langle n, n| ~~\Leftrightarrow~~ x^2 - nx - n \\
|
||||
x^2 = nx + n ~~\Rightarrow~~
|
||||
x = n + \frac{n}{x} \\
|
||||
x = n + \cfrac{n}{n + \cfrac{n}{n + \cfrac{n}{n + \cfrac{n}{\ddots}}}} =
|
||||
n + \cfrac{\textcolor{red}{\cancel{n}}}{\textcolor{red}{\cancel{n}} + \cfrac{\textcolor{red}{\cancel{n}}}
|
||||
{n + \cfrac{\textcolor{blue}{\cancel{n}}}{\textcolor{blue}{\cancel{n}} + \cfrac{\textcolor{blue}{\cancel{n}}}{\ddots}}}}
|
||||
\\
|
||||
x = n + \cfrac{1}{1 + \cfrac{1}{n + \cfrac{1}{1 + \cfrac{1}{\ddots}}}} =
|
||||
[n; \underline{1, n}]
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
In other words, the root of $\langle n, 1|$ has continued fraction n repeating, and the root of $\langle n, n|$ has continued fraction $n, 1$ repeating.
|
||||
|
||||
After the golden ratio, the next term in in the latter series is the recurrence $\langle 2,2 |$. It produces the series $0, 1, 2, 6, 16\dots$ ([OEIS A002605](http://oeis.org/A002605)), and the limiting ratio of its successive terms is $1 + \sqrt 3 \approx 2.7321\dots$. This value and the polynomial coefficients are bounded above by 3, so it stands to reason that a ternary alphabet is suitable. The trick for expanding 3 works as before:
|
||||
|
||||
$$
|
||||
\textcolor{red}{3}00 = 2\textcolor{red}{22}
|
||||
= \textcolor{blue}{22}2 = \textcolor{blue}{1}002
|
||||
$$
|
||||
|
||||
```{}
|
||||
Unnamed Unnamed
|
||||
Ratio Sequence
|
||||
____
|
||||
210 1234 6 2 1
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 2 1 0
|
||||
3 10.02 1 1
|
||||
4 11.02 2 0
|
||||
5 12.02 2 1
|
||||
6 20.1102 1 0 0
|
||||
7 21.1102 1 0 1
|
||||
8 100.1102 1 1 0
|
||||
9 101.1102 1 1 1
|
||||
10 102.1102 1 2 0
|
||||
```
|
||||
|
||||
In an homage to heraldry terminology, I choose to call this system cendrée, and the root of the polynomial the ashen ratio (abbreviated $\kappa$). Gold and silver ("or" and "argent") are "metals"; cendrée is a non-standard color referring to an ashen gray, which reflects its relationship to the metallic means.
|
||||
|
||||
|
||||
Ash on the Fulcrum
|
||||
------------------
|
||||
|
||||
Each fractional expansion in the table above appears to end in "2". I've actually checked this for the first 1000 integers and found no expansions which do not terminate in "2" besides 0 and 1. In contrast, the silver ratio expansions end in both 1 and 2. While it isn't a problem with the fractional base on its own, things get complicated when considering a balanced alphabet.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\textcolor{red}{2.0} =
|
||||
\textcolor{red}{1}0.\textcolor{blue}{\bar{2}0} =
|
||||
1\textcolor{blue}{\bar{1}}.0\textcolor{orange}{20} =
|
||||
1\bar{1}.\textcolor{orange}{1}0\bar{2} = \dots =
|
||||
1\bar{1}.\underline{1\bar{1}}
|
||||
\\
|
||||
\textcolor{green}{2} =
|
||||
1\bar{1}.0\textcolor{green}{2} =
|
||||
1\bar{1}.1\bar{1}0\textcolor{green}{2} = \dots =
|
||||
1\bar{1}.\underline{1\bar{1}}\\
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The number 2 happens to have an repeating balanced expansion. The first approach is the iterative application of the carry, while the second notices the recursion induced by the symbol "2". Both of these derivations involve an infinite number of steps, so there might still be a nagging suspicion that this is invalid. In fact, the we can derive the carry polynomial directly from this series (and vice versa) using a geometric series argument:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
1.\underline{\vphantom{\bar{1}}1}_x
|
||||
= 1 + x^{-1} + x^{-2} + x^{-3} + x^{-4} + \dots
|
||||
= \frac{1}{1 - (1/x)} = \frac{x}{x - 1}
|
||||
\\
|
||||
1.\underline{\bar{1}1}_x
|
||||
= 1 -\ x^{-1} + x^{-2} -\ x^{-3} + x^{-4} - \dots
|
||||
= \frac{-x}{-x -\ 1}
|
||||
= \frac{x}{x + 1}
|
||||
\\
|
||||
2 = 1\bar{1}.\underline{1\bar{1}}_x
|
||||
= \frac{x^2}{x + 1}
|
||||
\\
|
||||
x^2 = 2x + 2
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
We assume both series converge, since $\kappa > 1$. Repeating expansions in integral bases are typically strange-looking expressions like $0.\underline{9} = 1$, and their only use is for rational numbers. For example, we can evaluate this expression $\frac{x^2}{x + 1}$ at $x = 3$ to interpret "$1.\underline{\bar{1}1}$" as a ternary (base 3) expansion. I happens to be the rational value $9/4 = 2.25_{10}$. But the irrational base $\kappa$ breaks that rule, and a repeating expansion is necessary to represent an integer.
|
||||
|
||||
|
||||
### Mixing Ashes
|
||||
|
||||
In the balanced silver ratio base, we had the choice of forbidding either of "$11$" or "$10$". This was because when the carry was applied to either string, the negative of the other would appear. In this system, the dilemma is instead whether to forbid "$11$" or its negative, since carrying at one produces the other. I choose to permit positive adjacent 1's since both terms of the carry are positive.
|
||||
|
||||
I suspect that the only repeating string which occurs in the integers is $0.\underline{1\bar{1}}$ and shifts thereof, but have no proof. If we use the digit "2" to represent the repeating string, we can write mixed balanced expansions of integers. However, we must remember to forbid "102", since it would expand to "$11\bar{1}.\underline{1\bar{1}}$", which has two adjacent 1's.
|
||||
|
||||
```{}
|
||||
Mixed Cendree Balanced Cendree
|
||||
______ ____|__
|
||||
3210 123456 3210 1234|56 (repeating)
|
||||
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 2 1T.1T1T 1T...
|
||||
2 1T.02 1T.1T1T 1T...
|
||||
3 10.02 10.1T1T 1T...
|
||||
4 1TT.02 1TT.1T1T 1T...
|
||||
5 1T0.02 1T0.1T1T 1T...
|
||||
6 10T.TT02 10T.TT1T 1T...
|
||||
7 100.TT02 100.TT1T 1T...
|
||||
8 101.TT02 101.TT1T 1T...
|
||||
9 101.1102 101.111T 1T...
|
||||
9 1TTT.0TTT02 1TTT.0TTT 1T...
|
||||
10 1TT0.0TTT02 1TT0.0TTT 1T...
|
||||
```
|
||||
|
||||
Note that at the transition from 8 to 9, instead of incrementing the 1, the string "$0.\bar{1}\bar{1}$" was incremented to "$0.11$". Similar strategies must be used for larger numbers.
|
||||
|
||||
|
||||
Flip it Radix-ways
|
||||
------------------
|
||||
|
||||
Repeating expansions usually come from fractions whose denominator is coprime to the base. It is possible to convert such numbers into the ratio of two integers by using a fairly simple procedure. Here it is applied to both $0.\underline{69}_{10}$ and the string in question, "$0.1\bar{1}$":
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
{0.\underbrace{
|
||||
\underline{\textcolor{blue}{69}}_{10}
|
||||
}_{\text{length } \textcolor{red}{2}}}
|
||||
= \frac{\textcolor{blue}{69}_{10}}{10^{\textcolor{red}{2}} - 1}
|
||||
= \frac{\textcolor{blue}{69}_{10}}{99_{10}}
|
||||
= \frac{23_{10}}{33_{10}}
|
||||
\\
|
||||
0.\underline{
|
||||
\textcolor{blue}{1\bar{1}}}_p
|
||||
= \frac{\textcolor{blue}{1\bar{1}}_p}{p^2 - 1}
|
||||
= \frac{p - 1}{p^2 - 1}
|
||||
= \frac{1}{p + 1}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
These fractions can be used to construct [*p-adic numbers*](https://en.wikipedia.org/wiki/P-adic_number). For our purpose, this essentially places a $p^n - 1$ in the numerator and asserts that that $p^\infty \rightarrow 0$. For a length-2 repeating expansion, n is even, and the following quotients produce truncations:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
&\frac{p^2 - 1}{p+1} = \frac{10\bar{1}}{11}
|
||||
& \substack{
|
||||
\phantom{11}{\underline{\phantom{)1}
|
||||
1\bar{1}}} \\
|
||||
11)10\bar{1} \\
|
||||
\phantom{11)}\underline{11} \phantom{0} \\
|
||||
\phantom{11)1}{\bar{1}\bar{1}} \\
|
||||
\phantom{11)1}{\underline{\bar{1}\bar{1}}} \\
|
||||
\phantom{11)1}00
|
||||
} \\
|
||||
\\
|
||||
&\frac{p^4 - 1}{p+1} = \frac{1000\bar{1}}{11}
|
||||
& \substack{
|
||||
\phantom{11}{\underline{\phantom{)1}
|
||||
1\bar{1}1\bar{1}}} \\
|
||||
11)1000\bar{1} \\
|
||||
\phantom{11)} \underline{11} \phantom{000} \\
|
||||
\phantom{11)1} \bar{1}0 \phantom{00}\\
|
||||
\phantom{11)1} \underline{\bar{1}\bar{1}} \phantom{00} \\
|
||||
\phantom{11)10}10 \phantom{0} \\
|
||||
\phantom{11)10} \underline{11} \phantom{0} \\
|
||||
\phantom{11)100} \bar{1}\bar{1} \\
|
||||
\phantom{11)100} \underline{\bar{1}\bar{1}} \\
|
||||
\phantom{11)100} 00 \\
|
||||
}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
In the limit, the quotient is "$…1\bar{1}1\bar{1}1\bar{1}$", which is actually the negative of ${1 \over p+1}$ due to the negative sign in the numerator. Since we're using a balanced alphabet, negation is simply replacing "$\bar{1}$" with "$1$" and vice versa, producing...
|
||||
|
||||
$$
|
||||
0.1\bar{1}1\bar{1}1\bar{1}\dots\kappa = \dots\bar{1}1\bar{1}1\bar{1}1\bar{1}1_\kappa \\
|
||||
0.\underline{1\bar{1}}_\kappa = \underline{\bar{1}1}\bar{1}1_\kappa
|
||||
$$
|
||||
|
||||
...which is the initial expansion, but flipped about the radix point. The final balanced $\kappa$-adic expansion for 2 can then be acquired through simple addition:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
&\phantom{+} 1\bar{1}.000000\dots\kappa
|
||||
~=~ \dots\bar{1}_\kappa \\
|
||||
&+ \underline{00.1\bar{1}1\bar{1}1\bar{1}\dots\kappa
|
||||
~=~ \dots\bar{1}1\bar{1}1\bar{1}1}_\kappa \\
|
||||
& \phantom{+} 1\bar{1}.1\bar{1}1\bar{1}1\bar{1}\dots\kappa
|
||||
~=~ \dots\bar{1}1\bar{1}100_\kappa \\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Reading these expansions as power series, we can convert them into a rational expression
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
2 = \dots\bar{1}1\bar{1}100_\kappa
|
||||
&=\kappa^2 - \kappa^3 + \kappa^4 - \kappa^5 +\dots \\
|
||||
&= \kappa^2(1 - \kappa + \kappa^2 - \kappa^3 +\dots) \\
|
||||
&= \kappa^2 \cdot \frac{1}{1 - (-\kappa)} \\
|
||||
&= \frac{\kappa^2}{\kappa + 1}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
This is the same as the previous expression for 2. In a roundabout way, by borrowing *p*-adic ideas, we showed another way this is true by using power series manipulations. This also means that the long division above is in fact *polynomial* long division.
|
||||
|
||||
|
||||
Two Plus Two Equals Chaos
|
||||
-------------------------
|
||||
|
||||
*p*-adic expansions are still expressions in the base *p*, so the carry rule still applies. However, since the carry continues to infinity, we must at some point truncate the expansions to keep them within view. When *p* is an integer, the carry is a single digit wide, and we can demarcate a repeating section.
|
||||
|
||||
$\kappa$ is not an integer, and its carry has length 2. While the $\kappa$-adic expansion for 2 can be incremented once to produce a valid one one for 3, problems arise when attempting to construct 4. The most direct method is to start with the symbol "4" and manipulate it:
|
||||
|
||||
$$
|
||||
4 = 2\bar{4}0
|
||||
= \bar{2}600
|
||||
= 3\bar{8}000
|
||||
= \bar{4}\text{B}0000
|
||||
= 5\bar{\text E}10000
|
||||
= \text{J}0\textcolor{red}{1}0000
|
||||
= \dots
|
||||
$$
|
||||
|
||||
(Latin characters used as digits start at A for ten, as in hexadecimal). Even though the most significant digit grows larger, a residual "1" (marked in red) is left behind. We can produce more terms indefinitely, but as shown, the "head digit" where the carry takes place starts to grow.
|
||||
|
||||
|
||||
### Alternative Constructions
|
||||
|
||||
To keep the head small, it would be nice if it were taken mod an integer. Both $\bar{1}$ and $1$ are odd, so one might hope that in between carries, mod 2 can be applied somewhere. Unfortunately, this is not the case. To produce the "3" seen in "$3\bar{8}000$", "6" must be carried appropriately. To capture this difference, we must upgrade the modulus to 8 (as 7 would ruin the parity). But this means that the expansion of 4 is "$30000$", so 8 must also be upgraded. Such upgrades occur ad infinitum, since the carry applies across all higher place values.
|
||||
|
||||
Instead of expanding "4" directly, we have other options available.
|
||||
|
||||
- Add the nonrepeating part of the mixed balanced expansion of 4 with the $\kappa$-adic version of the repeating part (Another direct manipulation)
|
||||
|
||||
- Increment the least significant digit in the expansion of 2 twice (Addition)
|
||||
|
||||
$$
|
||||
4 = 2 + 2 = \frac{x^2}{1 + x} + 2 = \dots\bar{1}1\bar{1}102_x
|
||||
$$
|
||||
|
||||
- Add the expansion of 2 to itself (Multiplication)
|
||||
|
||||
$$
|
||||
4 = 2 \cdot 2 = \frac{2x^2}{1 + x} = \dots\bar{2}2\bar{2}200_x
|
||||
$$
|
||||
|
||||
- Square the power series expansion of 2 (Exponentiation)
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
4 = 2^2 = \left(\frac{x^2}{1 + x}\right)^2 =
|
||||
-x^4 \left(\frac{d}{dx}\frac{1}{1 + x}\right) = \dots\bar{4}3\bar{2}10000_x
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
If all of these series are expansions of 4, then they should produce the same string after applying the carry enough times. Fortunately, this seems to be the case, as this table demonstrates:
|
||||
|
||||
$$
|
||||
\begin{array}{}
|
||||
{x^2 \over 1 + x} + 2 &\phantom{00}&
|
||||
{2x^2 \over 1 + x} &\phantom{00}&
|
||||
\left({x^2 \over 1 + x}\right)^2 \\[10pt] \hline
|
||||
\vphantom{2^{2^{2^2}}}\dots\bar{1}1\bar{1}1\bar{1}102 \\[4pt]
|
||||
\dots\bar{1}1\bar{1}1\bar{1}2\bar{2}0 \\[4pt]
|
||||
\dots\bar{1}1\bar{1}1\bar{2}400 &&
|
||||
\dots\bar{2}2\bar{2}2\bar{2}200 \\[4pt]
|
||||
\dots\bar{1}1\bar{1}3\bar{6}000 &&
|
||||
\dots\bar{2}2\bar{2}3\bar{4}000 \\[4pt]
|
||||
\dots\bar{1}1\bar{4}90000 &&
|
||||
\dots\bar{2}2\bar{4}70000 \\[4pt]
|
||||
\dots\bar{1}5\bar{\text C}10000 &&
|
||||
\dots\bar{1}5\bar{\text A}10000 &&
|
||||
\dots\bar{4}3\bar{2}10000 \\[4pt]
|
||||
\dots\bar{7}{\text H}010000 &&
|
||||
\dots\bar{6}\text F010000 &&
|
||||
\dots\bar{5}5010000 \\[4pt]
|
||||
\dots\bar{\text N}1010000 &&
|
||||
\dots\bar{\text L}1010000 &&
|
||||
\dots\bar{9}1010000 \\[4pt]
|
||||
\textcolor{green}{\dots\bar{1}1010000} &&
|
||||
\textcolor{green}{\dots\bar{1}1010000} &&
|
||||
\textcolor{green}{\dots\bar{1}1010000}
|
||||
\end{array}
|
||||
$$
|
||||
|
||||
The rightmost series is the most resilient to the carry head growth, but this comes at the cost of not operating on a repeating series. In the range shown, all three columns converge to the same digit sequence, which truncated to 20 terms is:
|
||||
|
||||
$$
|
||||
4 = …\bar{1}00000\bar{1}00001\bar{1}1010000_\kappa = \kappa^4 + \kappa^6 -\ \kappa^7 + \dots
|
||||
$$
|
||||
|
||||
Contrary to the sequence used to build it, this expansion appears to be nonrepeating. As of writing, there are [no matches](http://oeis.org/search?q=1%2C0%2C1%2C-1%2C1%2C0%2C0%2C0%2C0%2C-1%2C0%2C0%2C0%2C0%2C0%2C-1&sort=&language=&go=Search) in the OEIS, even if the leading 0's are ignored. The Haskell used to generate each expansion above can be found [here](), and the first 8192 digits be found in a CSV [here]().
|
||||
|
||||
|
||||
### All Positive
|
||||
|
||||
If we are slightly greedier with the carry, we can clear it of all negative digits. The initial terms are the same, but diverge after the first $\bar{1}$ which appears in the sequence.
|
||||
|
||||
$$
|
||||
4 = \dots\kappa = \kappa^4 + \kappa^6 + \kappa^7 + \kappa^8 + \dots
|
||||
$$
|
||||
|
||||
Again, it appears to be possible to achieve this sequence by applying the carry enough times, starting with any of the alternative expansions. A similar CSV containing 8192 terms is available [here]().
|
||||
|
||||
This alternate expansion is somewhat confounding, since $\kappa$ is bounded above by the integer 3 and should therefore require three symbols in its alphabet. I can think of two explanations, and do not know whether either of them are correct:
|
||||
|
||||
- The expansion is related to the conjugate root $\kappa^* = 1 -\ \sqrt 3 \approx -0.73205\dots$. The reciprocal of this number is less than two.
|
||||
- Because infinite precision is required, the minimal alphabet can become (possibly arbitrarily) small.
|
||||
|
||||
|
||||
Four-ier Transforms
|
||||
-------------------
|
||||
|
||||
The [discrete Fourier transform](https://en.wikipedia.org/wiki/Discrete_Fourier_transform) is an operation on regular samples of a function, or more generally, numeric sequences. It converts highly repetitive sequences to sequences with peaks. Since we're dealing with infinite expansions, we'll need to truncate at some point. If the period is very large, so must be the truncation.
|
||||
|
||||
For example, the digits in the decimal expansion of 1/7 form the string "1, 4, 2, 8, 5, 7", repeating. The graph below is the plot of the DFT of the first 256 terms of the sequence. The clear peak between terms 42 and 43 is because the expansion repeats every 6 terms and $\frac{256}{43} < 6 < \frac{256}{42}$.
|
||||
|
||||
![]()
|
||||
|
||||
If the $\kappa$-adic expansion of 4 is nonrepeating, then its DFT should not have any noticeable peaks. The DFT of the first 256 terms shows it to be very noisy.
|
||||
|
||||
![]()
|
||||
|
||||
There is a pronounced spike at the right edge of the graph (the Nyquist frequency), but it has a simple explanation: "1" appears only at even place values and "$\bar{1}$" at odd. At Nyquist, the DFT degenerates into an alternating sum, so its value is simply the number of nonzero digits. If we map the negatives out of the sequence, the peak is destroyed.
|
||||
|
||||
Even in the 8192-term truncation, there are no noticeable spikes in its DFT, lending further credence to its aperiodicity. Though I will not show it here, the same applies to the binary sequence shown previously.
|
||||
|
||||
Much like the expansion of irrational numbers in integral bases, the balanced $\kappa$-adic expansion of 4 is(?) nonrepeating. This is surprising, especially since 4 has a terminating expansion in a non-balanced alphabet and a repeating expansion in a balanced one.
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
This concludes the discussion of $\kappa$-adic numbers. The [next post]() will return to integral sequences, and the patterns produced from their "erroneousness" as an actual base.
|
||||
|
||||
Update: I am unsure whether $\kappa$'s proximity to e produces some of these effects, or if it is somehow more ideal than other roots whose repeating fraction expansion is $[n; \underline{1, n}]$ (for integral n). It is easy to see that repeating expressions like $n = 10.\bar{n} = 1\bar{1}.\underline{1\bar{1}}$ will occur in each of these, but $\kappa$ still bears the distinction of needing only $0.1\bar{1}$ as a repeating element for integers.
|
||||
|
||||
Base *e*, while it lacks an explicit carry, has the lowest [radix economy](https://en.wikipedia.org/wiki/Radix_economy), meaning it takes the fewest digits to express a number with respect to the size of its minimal alphabet. I would be interested to know if other monic polynomials whose root is approximately e share some of $\kappa$'s strange properties.
|
||||
317
polycount/5.qmd
Normal file
317
polycount/5.qmd
Normal file
@ -0,0 +1,317 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
|
||||
Polynomial Counting: Pentamerous multiplication
|
||||
===============================================
|
||||
|
||||
This post assumes you have read [the first](), which introduces generalized polynomial counting.
|
||||
|
||||
|
||||
Arithmetic on Integral Systems
|
||||
------------------------------
|
||||
|
||||
Addition is a fairly simple process for positional systems: align the place values, add each term together, then apply the carry as many times as possible. Without a carry rule, this can be approached formally by treating the place values as a sequence $b_n$ and gathering terms:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\phantom{+~}
|
||||
\overset{b_2}{1}
|
||||
\overset{b_1}{2}
|
||||
\overset{b_0}{3} &
|
||||
\phantom{+~}1b_2 + 2b_1 + 3b_0
|
||||
\\
|
||||
\underline{+\ \smash{
|
||||
\overset{\phantom{b_0}}4
|
||||
\overset{\phantom{b_0}}5
|
||||
\overset{\phantom{b_0}}6
|
||||
}\vphantom,} &
|
||||
\underline{+\
|
||||
4b_2 + 5b_1 + 6b_0
|
||||
\vphantom,} \\
|
||||
\phantom{+~}\smash{
|
||||
\overset{\phantom{b_0}}5
|
||||
\overset{\phantom{b_0}}7
|
||||
\overset{\phantom{b_0}}9} &
|
||||
\phantom{+~}5b_2 + 7b_1 + 9b_0
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Multiplication is somewhat trickier. Its validity follows from the interpretation of an expansion as a polynomial. Polynomial multiplication itself is equivalent to [*discrete convolution*](https://en.wikipedia.org/wiki/Convolution#Discrete_convolution)
|
||||
|
||||
$$
|
||||
\begin{align*}&
|
||||
\begin{matrix}
|
||||
\phantom{\cdot~}
|
||||
111_x \\
|
||||
\underline{\cdot\
|
||||
\phantom{1}21_x\vphantom,} \\
|
||||
\phantom{\cdot \ 0}
|
||||
111_{\phantom{x}} \\
|
||||
\underline{\phantom{\cdot\ }
|
||||
2220_{\phantom{x}} \vphantom,} \\
|
||||
\phantom{\cdot\ }
|
||||
2331_{\phantom{x}}
|
||||
\end{matrix} &\qquad&
|
||||
\begin{gather*}
|
||||
(x^2 + x + 1)(2x + 1) \\ \\
|
||||
= 2x^3 + 2x^2 + 2x \phantom{+ 1}\\
|
||||
\phantom{= 2x^3 } + \phantom{2}x^2 + \phantom{2}x + 1 \\
|
||||
= 2x^3 + 3x^2 + 3x + 1
|
||||
\end{gather*}
|
||||
&\qquad&
|
||||
\begin{gather*}
|
||||
[1,1,1] * [2,1] \\
|
||||
\begin{matrix}
|
||||
\textcolor{blue}0 &\textcolor{red}1 & \textcolor{red}1 & \textcolor{red}1 & \textcolor{blue}0 &\\
|
||||
& & &1 & 2 & =~1\\
|
||||
& & 1 & 2 & &=~3\\
|
||||
& 1 & 2 & & &=~3\\
|
||||
1 & 2 & & & & =~2
|
||||
\end{matrix}
|
||||
\end{gather*}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
The left equation shows familiar multiplication, the middle equation is the same product when expressed as polynomials, and the right equation shows this product obtained by convolution. Note that the string of the second argument (\[2, 1\]) is reversed when performing the convolution.
|
||||
|
||||
Without carrying, multiplication and addition are base-agnostic. When doing arithmetic in a particular base, we should obtain the same result even if we perform the same operations in another base.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
&18 = 10010_2 &&
|
||||
5 = 101_2 \\ \\
|
||||
&
|
||||
\begin{matrix}
|
||||
\phantom{\cdot~}
|
||||
18_{10} \\
|
||||
\underline{\cdot\
|
||||
\phantom{1}5_{10}\vphantom,} \\
|
||||
\phantom{\cdot~}90_{10} \\ \\
|
||||
=~1011010_2
|
||||
\end{matrix}
|
||||
&&
|
||||
\begin{matrix}
|
||||
[1,0,0,1,0] * [1,0,1] \\ \\
|
||||
\begin{matrix}
|
||||
\textcolor{blue}0 & \textcolor{blue}0 &\textcolor{red}1 & \textcolor{red}0 & \textcolor{red}0 & \textcolor{red}1 & \textcolor{red}0 & \textcolor{blue}0 & \textcolor{blue}0 &\\
|
||||
& & & & & &1 & 0 & 1 & =~0\\
|
||||
& & & & &1 & 0 & 1 & & =~1\\
|
||||
& & & &1 & 0 & 1 & & & =~0\\
|
||||
& & &1 & 0 & 1 & & & & =~1\\
|
||||
& &1 & 0 & 1 & & & & & =~1\\
|
||||
& 1 & 0 & 1 & & & & & & =~0\\
|
||||
1 & 0 & 1 & & & & & & & =~1\\
|
||||
\end{matrix}
|
||||
\end{matrix}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
In the example above, we multiply 18 and 5 together to obtain 90 in base ten, then convert it to binary. This is precisely the same as converting 18 and 5 to binary, then convolving the strings of digits. Fortunately in this instance, we don't have to worry about any carries in the result.
|
||||
|
||||
|
||||
Two Times Tables
|
||||
----------------
|
||||
|
||||
The strings "10010" and "101" do not contain adjacent "1"s, so they can also be interpreted as the Zeckendorf expansions (of 10 and 4, respectively). This destroys their correspondence to polynomials, so their product by convolution, as a Zeckendorf expansion (when returned to canonical form) is not the product of 10 and 4.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
[1,0,0,1,0]_{\text{Zeck}} * [1,0,1]_{\text{Zeck}} = 1011010_{\text{Zeck}}
|
||||
= 1100010_{\text{Zeck}} \\
|
||||
= 10000010_{\text{Zeck}} = 36 \\
|
||||
\text{Zeck}(10) * \text{Zeck}(4)
|
||||
= 36 \neq 40 = 10 \cdot 4
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The process of expanding both terms, convolving, and interpreting can be captured by the operator $\odot_\text{Zeck}$. Its definition requires a unique greedy expansion for every integer (which exists), and is defined via convolution (which is commutative), so it is commutative. We can tabulate the results in a times table as follows
|
||||
|
||||
| $\odot_\text{Zeck}$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
|----------------|---|---|---|---|---|---|---|---|---|
|
||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||
| 1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
| 2 | 0 | 2 | 3 | 5 | 7 | 8 | 10 | 11 | 13 |
|
||||
| 3 | 0 | 3 | 5 | 8 | 11 | 13 | 16 | 18 | 21 |
|
||||
| 4 | 0 | 4 | 7 | 11 | 15 | 18 | 22 | 25 | 29 |
|
||||
| 5 | 0 | 5 | 8 | 13 | 18 | 21 | 26 | 29 | 34 |
|
||||
| 6 | 0 | 6 | 10 | 16 | 22 | 26 | 32 | 36 | 42 |
|
||||
| 7 | 0 | 7 | 11 | 18 | 25 | 29 | 36 | 40 | 47 |
|
||||
| 8 | 0 | 8 | 13 | 21 | 29 | 34 | 42 | 47 | 55 |
|
||||
|
||||
The expansions for 0 and 1 are invariably the strings "0" and "1". When a sequence has length 1, convolution degenerates to term-by-term multiplication. Thus, convolution by "0" produces a sequence of 0's, and convolution with the string "1" produces the same sequence. Accordingly, the only "correct" columns and rows that appear in the table are the first two. Ignoring them, this array exists in the OEIS ([A101330](https://oeis.org/A101330)) and is known as Knuth's Fibonacci product.
|
||||
|
||||
|
||||
Correcting for Errors
|
||||
---------------------
|
||||
|
||||
The difference between the actual product and the false product can be interpreted as an error endemic to Zeckendorf expansions. If assigned to the symbol $\oplus_\text{Zeck}$, then the normal product can be recovered as $mn = m \odot_\text{Zeck} n + m \oplus_\text{Zeck} n$. We can then collect errors into table of their own:
|
||||
|
||||
| $\odot_{Zeck}$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
|----------------|---|---|---|---|---|---|---|---|---|
|
||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||
| 2 | 0 | 0 | 1 | 1 | 1 | 2 | 2 | 3 | 3 |
|
||||
| 3 | 0 | 0 | 1 | 1 | 1 | 2 | 2 | 3 | 3 |
|
||||
| 4 | 0 | 0 | 1 | 1 | 1 | 2 | 2 | 3 | 3 |
|
||||
| 5 | 0 | 0 | 2 | 2 | 2 | 4 | 4 | 6 | 6 |
|
||||
| 6 | 0 | 0 | 2 | 2 | 2 | 4 | 4 | 6 | 6 |
|
||||
| 7 | 0 | 0 | 3 | 3 | 3 | 6 | 6 | 9 | 9 |
|
||||
| 8 | 0 | 0 | 3 | 3 | 3 | 6 | 6 | 9 | 9 |
|
||||
|
||||
In this table, unsurprisingly, the first two columns are populated entirely by 0's. The rest of the errors are grouped together in rectangular blocks.
|
||||
|
||||
|
||||
Fibonacci Runs
|
||||
--------------
|
||||
|
||||
A pattern can be observed along any column or row (except the first two) or along the main diagonal (where they squares lie). In each, the number of terms the series "hangs" before progressing (i.e., the [*run lengths*](https://en.wikipedia.org/wiki/Run-length_encoding)) is the same:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
RL(0, 0, 1, 1, 1, 2, 2, 3, 3, ...) = \\
|
||||
RL(0, 0, 2, 2, 2, 4, 4, 6, 6, ...) = \\
|
||||
RL(0, 0, 1, 1, 1, 4, 4, 9, 9, ...) = \\
|
||||
2,3,2,3,3,2,3,2,3,3 ...
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The initial 2 can be ignored since it corresponds to the 0 and 1 rows. If the rest is converted such that $3 \mapsto 0,~ 2 \mapsto 1$, then the sequence becomes (truncated to 30 terms):
|
||||
|
||||
$$
|
||||
0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0...
|
||||
$$
|
||||
|
||||
This matches the *Fibonacci word* ([OEIS A3849](http://oeis.org/A003849)), a sequence obtained in a similar manner to the typical Fibonacci numbers. Rather than operating on integers by addition, it operates on strings by concatenation. Perhaps this is unsurprising, since Zeckendorf expansions are literally expansions in Fibonacci numbers. The run-length transform is the key to this infinite string, which in effect discards the *numbers* in the sequence for information about *discrete chunks* of the sequence.
|
||||
|
||||
|
||||
Visualizing Tables
|
||||
------------------
|
||||
|
||||
While a table is a wonderful thing, it does not lend itself well to visualization. WolframAlpha has a feature that produces the multiplication table for a finite field ([example](https://www.wolframalpha.com/input?i=finite+field+of+order+25)).
|
||||
|
||||
I'd like to reproduce it with color, but there's a slight problem. Since we don't have a finite number of elements, we'll have to take our tables mod an integer. In the HSV color space, colors are cyclic just like the integers mod n. This actually has an additional appealing feature: two colors with similar hues are "near" in a similar way to the underlying numbers. Then, the entry-to-color mapping can just be given as
|
||||
|
||||
$$
|
||||
k \mapsto HSV \left({2\pi k \over n}, 100\%, 100\% \right)
|
||||
$$
|
||||
|
||||
In this mapping, for n = 2, red is 0 and cyan is 1. The following is a 100x100 image of the multiplication table of $\oplus_\text{Zeck}$ from 0 to 99.
|
||||
|
||||
![]()
|
||||
|
||||
Anima Moduli
|
||||
------------
|
||||
|
||||
This table can by animated by gathering various n into an animation and incrementing n every frame. Before applying this technique to an error table, I find it prudent to apply it to standard addition and multiplication tables first.
|
||||
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
Addition
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
Multiplication
|
||||
:::
|
||||
|
||||
|
||||
Both images appear to zoom in as the animation progresses. Unsurprisingly, addition produces diagonal stripes, along which the sum is the same. Multiplication produces a squarish pattern (with somewhat appealing moirés).
|
||||
|
||||
Tables for $\odot_\text{Zeck}$ and $\oplus_\text{Zeck}$ should resemble the table to the right, since their definition relies on it.
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
$\odot_\text{Zeck}$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
$\oplus_\text{Zeck}$
|
||||
:::
|
||||
|
||||
The zooming is still present. At later frames, both tables share the same "square rainbow" pattern, but the error table is closer. Though both tables appear to have a repeating pattern, the blocks in the error table are still irregularly shaped, as in the mod 2 case.
|
||||
|
||||
The error table also demonstrates (for a given modulus) how much the series differs from a geometric series. We know there will always be an error since, while Fibonacci numbers grow on the order of $O(\phi^n)$, the place values is only $\phi$ *in the limit*.
|
||||
|
||||
|
||||
Other Error Tables
|
||||
------------------
|
||||
|
||||
These operations can can also be defined in terms of any other series expansion (i.e., integral system). Rather than showing both of the multiplication and error tables, I will elect to show only the latter. The error table is more fundamental since the table for $\odot$ can be constructed from it and the normal multiplication table.
|
||||
|
||||
The error tables for some of the previously-discussed generalizations of the Fibonacci numbers are presented below.
|
||||
|
||||
|
||||
### Pell, Jacobsthal
|
||||
|
||||
:::{.column width="40%"}
|
||||
Pell
|
||||
$\langle 2,1|$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
Jacobsthal
|
||||
$\langle 1,2|$
|
||||
:::
|
||||
|
||||
Of the two tables, the Pell table looks more similar to the Fibonacci one. Meanwhile, the Jacobsthal table has frames which are significantly redder than the either surrounding it. These occur on frames for which *n* is a power of 2, which is a root of the recurrence polynomial.
|
||||
|
||||
|
||||
### *n*-nacci
|
||||
|
||||
:::{.column width="40%"}
|
||||
Tribonacci
|
||||
$\langle 1,1,1|$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
Tetranacci
|
||||
$\langle 1,1,1,1|$
|
||||
:::
|
||||
|
||||
Compared to the Fibonacci image, the size of the square pattern in the Tribonacci and Tetranacci images is larger. Higher orders of Fibonacci recurrences approach binary, so in the limit, the pattern disappears, as if the slowly-encroaching red corner is all that remains.
|
||||
|
||||
|
||||
### Other
|
||||
|
||||
Of course, integral systems are not limited to linear recurrences, and tables can also be produced that correspond to other integer sequences. For example, the factorials produce distinct patterns at certain frames. The Catalan numbers (which are their own recurrence) mod 2 appear to be constructed from regular blocks of XORs. To prevent the page from getting bloated, these frames are presented in isolation.
|
||||
|
||||
|
||||
:::{.column width="40%"}
|
||||
Factorial Error (mod 8)
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
Catalan Numbers Error (mod 2)
|
||||
:::
|
||||
|
||||
|
||||
Additional tables which I find interesting are:
|
||||
|
||||
- [Triangular Numbers (recurrence $\langle 3, \bar{3}, 1|$)]()
|
||||
- [Square Numbers]()
|
||||
- [Padovan Numbers (recurrence $\langle 0,1,1|$)]()
|
||||
- [$\langle 1, 1, 2|$, based on the first 3 Catalan numbers]()
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
Even if not particularly useful, I enjoy the emergent behavior apparent in the tables. Even for typical multiplication, this visualization technique shows regular patterns which appear to "grow". Meanwhile, the sequence products frequently produce a pattern that either repeats, or is composed of many similar elements.
|
||||
|
||||
My first attempt to map integers to colors was to consider the prime factorization of each integer. The largest number in the factorization was related to the hue, and the number of terms in the factorization was related to the saturation. Results were not great.
|
||||
|
||||
![]()
|
||||
|
||||
While I rendered these animations as GIFs, I also attempted to convert some of them to MP4s in hopes of shrinking the filesize. However, this is a use case where the MP4 is larger than the GIF, at least without compromising on resolution. This is a case when space-compression beats ill-suited time-compression.
|
||||
|
||||
![]()
|
||||
Produced with ffmpeg defaults
|
||||
|
||||
The project that I used to render the images can be found [here](). I didn't put much thought into command line arguments, nor did I build in many features. As an executable, it should be completely serviceable to generate error tables based on recurrence relations; the GHCi REPL can be used for more sophisticated sequences.
|
||||
373
polycount/cell1.qmd
Normal file
373
polycount/cell1.qmd
Normal file
@ -0,0 +1,373 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
|
||||
Counting in 2D: Lines, Leaves, and Sand
|
||||
=======================================
|
||||
|
||||
I have written previously about positional systems and so-called "[polynomial counting]()". Basically, this generalizes familiar integer bases like two and ten into less familiar ones like the golden ratio. However, all systems I presented have something in common: they all use polynomials of a single variable. But does it even make sense to count in two variables?
|
||||
|
||||
|
||||
Typical Restrictions
|
||||
--------------------
|
||||
|
||||
Before proceeding, I will summarize some of the restrictions on which polynomials can be used as carries in positional systems. Carry polynomials must be nonpositive when evaluated at 1 (otherwise the digital root of an expansion is unbounded) and either:
|
||||
|
||||
- All coefficients have the same sign but one, which has a much larger magnitude than the rest (and forces the digital root condition)
|
||||
- These are *explicit* irrational carries
|
||||
- They are monic (have leading coefficient 1) and the remaining coefficients are all negative and monotonically increase toward 0 after the second coefficient (0's are allowed anywhere)
|
||||
- These are *implicit* irrational carries
|
||||
|
||||
Implicit carries must be multiplied, in particular by cylotomic polynomials, to obtain additional rules for larger numbers.
|
||||
|
||||
|
||||
A Game of Chess
|
||||
---------------
|
||||
|
||||
[Conway's checkers](https://en.wikipedia.org/wiki/Conway%27s_Soldiers) is a game played by attempting to advance game pieces to the furthest extent beyond a line. A piece can only be moved by jumping it horizontally or vertically over others, which removes them from play. Squinting hard enough, in one dimension, this is similar to how in phinary, a "1" in an expansion can jump over an adjacent "1" to its left.
|
||||
|
||||
$$
|
||||
\begin{array}{}
|
||||
\bullet \\ \hline \bullet \\ \hline \vphantom{\bullet}
|
||||
\end{array} \huge⤸ \normalsize
|
||||
~\longrightarrow~
|
||||
\begin{array}{}
|
||||
\vphantom{\bullet} \\ \hline \vphantom{\bullet} \\ \hline \bullet
|
||||
\end{array}
|
||||
~~ \iff ~~
|
||||
0\textcolor{red}{11} = \textcolor{red}{1}00
|
||||
$$
|
||||
|
||||
In fact, it is exactly the same. The best solution of the game relies on a geometric series in $\phi$, by placing a power of it in each square of a grid ([video by Numberphile](https://www.youtube.com/watch?v=Or0uWM9bT5w)).
|
||||
|
||||
|
||||
### Pairs of Checkers
|
||||
|
||||
My first intuition for 2D numbers was to replace the standard hop with the movement of a knight in chess. That way, not one, but two sequences of digits are necessary for the expansion of a number:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\begin{array}{c|c}
|
||||
\bullet & \phantom{\bullet} \\
|
||||
\hline \bullet \\ \hline \vphantom{\bullet}
|
||||
\end{array}
|
||||
~\longrightarrow~
|
||||
\begin{array}{c|c}
|
||||
\phantom{\bullet} & \phantom{\bullet} \\
|
||||
\hline \\ \hline & \bullet
|
||||
\end{array}
|
||||
~~ \iff ~~
|
||||
\left . \begin{array}{}
|
||||
0\textcolor{red}{11}_x \\
|
||||
000_y
|
||||
\end{array} \right ] = \left . \begin{array}{}
|
||||
000_x \\
|
||||
\textcolor{red}{1}00_y
|
||||
\end{array} \right ] \\ \\
|
||||
y^2 = x + 1,~ x^2 = y + 1
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
This looks good on the surface, but the polynomials aren't sufficiently intertwined. Each variable is trivially a function of the other, and we can coax them together into a single polynomial:
|
||||
|
||||
$$
|
||||
y = x^2 - 1 \Rightarrow (x^2 - 1)^2 = x + 1 \\
|
||||
x^4 - 2x^2 + 1 = x + 1 \\
|
||||
x^3 - 2x - 1 = 0 \\
|
||||
(x + 1)(x^2 - x - 1) = 0
|
||||
$$
|
||||
|
||||
The same argument applies symmetrically for *y*. Of course, one of the resultant polynomials is the minimal polynomial of $\phi$, reducing the prospective 2D system back to standard phinary.
|
||||
|
||||
There are additional problems with using a pair of digit sequences. For example, the products of (powers of) both variables are ignored, such as xy. Also, both sequences have a ones' place, but agree that $x^0 = y^0 = 1$.
|
||||
|
||||
|
||||
Building the Plane
|
||||
------------------
|
||||
|
||||
If it is the case that both powers of variables should share the ones' digit, then why not join the two at a right angle? Then, each variable has its own "axis" (unrelated to Cartesian coordinates), forming an infinite cross-shaped array of cells. We can arrange expansions in one variable in a line, so to make Euclid happy, those in two variables span a plane. Forms like *xy* align themselves with the cells that correspond to powers of *x* and *y*, occupying a cell off of the cross. Instead of a point-like separator, the radix point is now a pair of rays that share a vertex.
|
||||
|
||||
My inspiration for doing so was Norman Wildberger's variable-free approach to "[bipolynumbers](https://www.youtube.com/watch?v=_9FvrO1JTTI)", which is especially powerful, seen below
|
||||
|
||||
$$
|
||||
\begin{array}{|c}
|
||||
\hline
|
||||
f & d & a \\
|
||||
e & b \\
|
||||
c
|
||||
\end{array}
|
||||
\begin{matrix} ~\equiv~
|
||||
ax^2 + bxy + cy^2 + dx + ey + f, \\
|
||||
\text{the general form of a conic}
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
By aligning the ones' places of two polynomials, it is very simple to compute their sum of, since it is simply pointwise addition. We should expect that expansion of the sum is the sum of the expansions (after applying carry), as is the case with 1D numbers.
|
||||
|
||||
Even in two variables, polynomials obey both scalar multiplication and multiplication by other polynomials. In a single variable, the latter is a somewhat involved 1D convolution; in two, it is naturally 2D convolution, an operation typically encountered in image processing and signal analysis. The intuition for this as it applies to expansions will be detailed momentarily.
|
||||
|
||||
The forward process of multiplication is difficult. Even so, division is harder. In polynomials of a single variable, we can do synthetic (or long) division in the direction the numbers do not extend (i.e., downward). On the face of a page, numbers occupy both dimensions, so they are not quite as "open" to manipulation by an algorithm. Fortunately, symbolic manipulation systems can perform both this and factorization in general reasonably quickly.
|
||||
|
||||
|
||||
1, 2, 3, Takeoff
|
||||
----------------
|
||||
|
||||
Where to start in a world of planar numbers? Well, we want one integer which has extent in both *x* and *y*. The simplest way to do this is by letting $x + y = n$: when the one's place has a magnitude of *n*, it flows into *x* and *y*. If *n* = 1, then the sum of coefficients is skewed toward the RHS, and the digital root is unbounded. We had a similar restriction in one dimension. Therefore, let *n* = 2. The expansions of the powers of 2 are:
|
||||
|
||||
$$
|
||||
\begin{matrix}
|
||||
&&\text{Carry:}&\begin{array}{|c}\hline
|
||||
-2 & 1 \\ 1
|
||||
\end{array}\\
|
||||
1 & 2 & ... & 4 & ... & 8 \\
|
||||
\begin{array}{|c} \hline
|
||||
1
|
||||
\end{array} &
|
||||
\begin{array}{|c} \hline
|
||||
0 & 1 \\ 1
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c} \hline
|
||||
0 & 2 \\ 2
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c} \hline
|
||||
0 & 4 \\ 4
|
||||
\end{array} \\ \\ &&&
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 1 \\ 0 & 0 & 1 \\ 1 & 1
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 2 \\ 0 & 0 & 2 \\ 2 & 2
|
||||
\end{array} \\ \\ &&&&&
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 1 \\
|
||||
0 & 1 & 0 & 1 \\ 1 & 1 & 1
|
||||
\end{array}
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
The final entry of each column is achieved by applying the carry enough times, reducing all digits to "0"s and "1"s. Notice that the typical binary expansion, reversed, is visible along first row and column. This is always the case, since there is no mechanism for the carry to spread either left or up; all expansions contain their binary expansion along those stripes. Additionally, the number of "1"s that appear in the expansion is equal to the number itself. These two properties make it a sort of hybrid between unary and binary. This representation of integers bridges their [Hamming weights](https://en.wikipedia.org/wiki/Hamming_weight) and magnitudes.
|
||||
|
||||
This notation is very heavy, but fortunately, we can visualize them easier. Each integer's expansion is more or less an image, so simply arranging each as frames in a video:
|
||||
|
||||
![]()
|
||||
|
||||
Starting at the expansion of 12, the furthest extent is not in the first column or row. It instead grows faster along the diagonal, along which larger triangles appear when counting to higher and higher integers. Meanwhile, lower degrees (toward the upper left) appear to be slightly less predictable.
|
||||
|
||||
|
||||
### Higher *n*
|
||||
|
||||
By incrementing *n*, the expansions of numbers shrink exponentially, and simply incrementing is not fast enough. Fortunately, we can scalar-multiply base expansions, then assiduously apply the carry. Ascending the powers of *n* in this manner for the carries where *n* = 3 and 4:
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
:::
|
||||
|
||||
Yellow corresponds to the highest allowed numeral, *n* - 1. Along with the boundary being much more rounded, neither appears to have an emergent pattern. Certainly patterns which appear in binary do not necessarily appear in ternary. But in 1D systems, we can group *m* digits in base *b* to convert the expansion to base *b^m*. If such a procedure still exists in 2D, it destroys the pattern that *n* = 2 has, as the quaternary system is still very chaotic.
|
||||
|
||||
|
||||
Carry Curves
|
||||
------------
|
||||
|
||||
Since the carry is a polynomial in both *x* and *y*, it lends itself to interpretation as an algebraic curve. Taking *x* or *y* to higher powers will dilate expansions along that axis.
|
||||
|
||||
Rather than the shape of the curve, the points it passes through are important. In particular, we can interpret the intersections with the *x* and *y* axes as the "base" with respect to a single variable. Likewise, the intersection with the line *x* = *y* is the base with respect to both variables.
|
||||
|
||||
The carry is not the only curve which exists in a system, as each integer is also a polynomial unto itself. Adding a constant term will not change anything unless it causes carries to occur. Starting at the carry digit, some of the curves made by the carry $x + y = 2$ are shown below.
|
||||
|
||||
![]()
|
||||
|
||||
In each of these figures, the line for the carry is present, since we can always factor it out of an expansion. Other shapes like hyperbolae show up and disappear, only to be replaced with higher-order curves. These higher order curves are rather difficult to graph, so they show up as thicker lines.
|
||||
|
||||
It appears as though the reflection of the carry across the origin (the curve $x + y = -2$) "wants" to appear. In fact, looking at the curves for 24 and 64, the entire diamond shape centered at the origin appears to shrink. Perhaps it converges in the limit, but it is difficult to say.
|
||||
|
||||
|
||||
Casting the Line
|
||||
----------------
|
||||
|
||||
Since the carry is always an expression in *x* and *y* equal to 0, if the curve a carry describes contains the point (1, 1), then the sum of its coefficients of the polynomial is 0. Expansions in such a carry have digital root the same as their magnitude.
|
||||
|
||||
Lines of the form $(n - 1)x + y = n$ trivially satisfy this relationship. While the digits along the y column will be expansions of base *n*, those along *x* will not correspond to any base, and expand faster. For example, for *n* = 3
|
||||
|
||||
$$
|
||||
\begin{matrix}
|
||||
&&&\text{Carry:}&
|
||||
\begin{array}{|c}
|
||||
\hline -3 & 2 \\ 1
|
||||
\end{array}\\
|
||||
1 & ... & 3 & ... & 6 & ... & 9 \\
|
||||
\begin{array}{|c}
|
||||
\hline 1
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c}
|
||||
\hline 0 & 2 \\ 1
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c}
|
||||
\hline 0 & 4 \\ 2
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c}
|
||||
\hline 0 & 6 \\ 3
|
||||
\end{array} \\ \\ &&&&
|
||||
\begin{array}{|c}
|
||||
\hline 0 & 1 & 2 \\ 2 & 1
|
||||
\end{array} & ... &
|
||||
\begin{array}{|c}
|
||||
\hline 0 & 3 & 2 \\ 3 & 1
|
||||
\end{array} \\ \\ &&&&&&
|
||||
\begin{array}{|c}
|
||||
\hline 0 & 0 & 1 & 2 \\ 0 & 1 & 0 & 2 \\ 1 & 1 & 1
|
||||
\end{array}
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
Naturally, this works symmetrically considering *y* to have the coefficient instead of *x*, transposing both the carry and the expansion. Cutting to the chase, visually representing this expansion (and the one corresponding to *n* = 4):
|
||||
|
||||
![]()
|
||||
|
||||
The pattern produced is mostly the same as the case when *n* = 2. The triangular pattern no longer grows all at once, but with the bottom leading the top. Meanwhile, the disordered part in the upper left of the expansion appears to grow larger as *n* increases, not to mention that it contains many artifacts from smaller colors.
|
||||
|
||||
The slope of the line appears also as the slope of the pattern. As the coefficient of *x* approaches infinity, the pattern gets thinner and takes longer to show up. This is because the unary system (*x*) grows *arithmetically*, while other positional systems grow *geometrically*, and the former approaches infinity much slower than the latter.
|
||||
|
||||
|
||||
### Incremented Curves
|
||||
|
||||
Below are the incremented curves for *n* = 3. Note that the only quadratic curve shown above is the expansion for 6, as this system grows much more quickly. I find the transition between 12 and 15 to be interesting, since the spike seems to grow to encompass the point at infinity.
|
||||
|
||||
![]()
|
||||
|
||||
|
||||
Leaves in the Mirror
|
||||
--------------------
|
||||
|
||||
Algebraic curves are not my forte. However, I believe it would be a good idea to briefly examine some classical examples.
|
||||
|
||||
All Fermat curves $x^n + y^n = 1$ are not suitable as carries, since their digital root is unbounded. Scaling up the curve, as by $x^n + y^n = 2$ will just degenerate back to the previous examples with lines, but spaced out by zeros between entries.
|
||||
|
||||
The [folium of Descartes](https://en.wikipedia.org/wiki/Folium_of_Descartes) is another classical curve that played a role in the development of calculus, described by the equation:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
x^3 + y^3 - 3axy = 0
|
||||
\\ \\
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 0 & 1 \\
|
||||
0 & -3a \\ 0 & \\ 1
|
||||
\end{array}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The position of the 3*a* term may be confusing. As the negative coefficient, we must place it atop the digit we are carrying, meaning that expansions will propagate toward negative powers of *x* and *y* as well as positive. While the shape of the curve is different from an ordinary line, the coefficients are arranged too similarly; for $a = 2/3$ (so the curve passes through (1, 1)) incrementing appears as:
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
\begin{gather*}
|
||||
2: & \begin{array}{c|cc}
|
||||
& 0 & 0 & 1 \\ \hline
|
||||
0 & 0 \\ 0 & \\ 1
|
||||
\end{array} \\ \\
|
||||
4: & \begin{array}{cc|cc}
|
||||
& & 0 & 0 & 0 & 0 & 1 \\
|
||||
& & 0 & 0 & 0 & 0 & 0 \\ \hline
|
||||
0 & 0 & 0 & 0 & 0 & 1 & 0\\
|
||||
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
|
||||
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
|
||||
0 & 0 & 1 & 0 & 0 & 0 & 0 \\
|
||||
1 & 0 & 0 & 0 & 0 & 0 & 0
|
||||
\end{array}
|
||||
\end{gather*}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
:::
|
||||
|
||||
Clearly, this also tends back toward the $x + y = 2$ example, but with the yellow digits spaced out more.
|
||||
|
||||
|
||||
### Discounting Curves
|
||||
|
||||
The interpretation of the carry as a curve is secondary, so I'd like to disqualify the archetypal incarnations of some quadratic objects.
|
||||
|
||||
- Circle ($x^2 + y^2 - 1 = 0$) and Hyperbola ($\pm x^2 \mp y^2 - 1 = 0$)
|
||||
- The sum of coefficients is positive, which means that expansions are unbounded.
|
||||
- Alternatively, coefficients are of an improper form, since one positive coefficient does not outweigh all remaining negative coefficients.
|
||||
- The curve as a function in *x* and *y* can be written in simpler terms, i.e., $F(x, y) = G(x^2, y^2)$
|
||||
- Hyperbola ($xy \pm 1 = 0$)
|
||||
- The curve is a function of only *xy*, i.e., $F(x, y) = P(xy)$, so the curve degenerates to one-dimensional unary.
|
||||
- Parabolae ($y = \pm x^2,~ x = \pm y^2$)
|
||||
- One coefficient does not outweigh the other.
|
||||
- The fact that either *y* is a polynomial in *x* or vice versa again degenerates the system to a singular dimension.
|
||||
|
||||
While it may be the case that other polynomials in *x* and *y* can produce these curves, this interpretation is still secondary. What matters is that one cell affects relatively close cells in a certain way.
|
||||
|
||||
|
||||
Laplace's Sandstorm
|
||||
-------------------
|
||||
|
||||
As stated previously, polynomials naturally multiply by convolution. In this context, a form which frequently arises is an approximation of the 2D Laplacian. While commonly presented as a matrix, it has very little to do with the machinery of linear algebra which normally empowers matrices.
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
\begin{gather*}
|
||||
\begin{bmatrix}
|
||||
0 & 1 & 0 \\
|
||||
1 & -4 & 1 \\
|
||||
0 & 1 & 0
|
||||
\end{bmatrix} ~\implies~ \begin{array}{c|cc}
|
||||
& 1 & \\ \hline
|
||||
1 & -4 & 1 \\
|
||||
& 1
|
||||
\end{array} \\ \\
|
||||
x + x^{-1} + y + y^{-1} - 4 = 0\\
|
||||
x + xy^2 + y + yx^2 - 4xy = 0
|
||||
\end{gather*}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
:::
|
||||
|
||||
From the above, it is clear that this is a cubic curve. Aside from the trivial solution $x = y = 0$ (which obviously also satisfies *x* = *y*), the curve made by the carry does not intersect either axis. There is an additional isolated point at (1, 1), implying some is in unary-ness this system. If we make it a carry, then the first few powers of 4 are
|
||||
|
||||
$$
|
||||
\begin{matrix}
|
||||
1 & ... & 4 & ... & 16 \\
|
||||
\begin{array}{|c}
|
||||
\hline 1
|
||||
\end{array} & ... &
|
||||
\begin{array}{c|cc}
|
||||
0 & 1 & 0 \\ \hline 1 & 0 & 1 \\ 0 & 1 &
|
||||
\end{array} & ... &
|
||||
\begin{array}{c|cc}
|
||||
0 & 4 & 0 \\ \hline 4 & 0 & 4 \\ 0 & 4 &
|
||||
\end{array} \\ \\ &&&&
|
||||
\begin{array}{cc|cc} & & 1 & & \\ & 2 & 0 & 2 & \\ \hline 1 & 0 & 4 & 0 & 1 \\ & 2 & 0 & 2 \\ & & 1 &
|
||||
\end{array} \\ \\ &&&&
|
||||
\begin{array}{cc|cc} & & 1 & & \\ & 2 & 1 & 2 & \\ \hline 1 & 1 & 0 & 1 & 1 \\ & 2 & 1 & 2 \\ & & 1 &
|
||||
\end{array}
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
As the negative (and largest) term, we carry at the "4" entry, as shown above. Terms progress along lower and higher powers of *x* and *y*. However, rather than just rightward propagation interfering with downward propagation (and vice versa), all directions can interfere with each other.
|
||||
|
||||
This carry can be interpreted more naturally as a [sandpile](https://en.wikipedia.org/wiki/Abelian_sandpile_model). As cellular automata, they are rather popular as a coding challenge ([video by The Coding Train](https://www.youtube.com/watch?v=diGjw5tghYU)), and when the grid is finite, certain subsets of all possible elements form finite groups under addition ([video by Numberphile](https://www.youtube.com/watch?v=1MtEUErz7Gg)). These videos discuss toppling the initial value, but do not show that they are quite analogous to polynomial expansions.
|
||||
|
||||
![]()
|
||||
|
||||
The shapes produced by this pattern are well-known, with larger numbers appearing as fractals. Generally, the expansions are enclosed within a circle, with shrinking triangular looking sections. This is eerily similar to the same shrinking triangles which appear in other carries which encompass (1, 1).
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
All of the 2D carries presented here are explicit carries. Unlike phinary, they have no additional rules hidden in mutliples of the carry. Implicit carries in two variables can be found by selecting a cyclotomic polynomial (in *x*, *y*, and $x + y$) and finding a second polynomial so that the product of the two resembles a explicit carry. Some of my investigations into this topic are available [here]().
|
||||
|
||||
Just as learning to count on polynomials opens up a world of possibilities, learning to count on *bi*polynomials is a perplexing topic that I wish to explore further in the future.
|
||||
416
polycount/cell2.qmd
Normal file
416
polycount/cell2.qmd
Normal file
@ -0,0 +1,416 @@
|
||||
---
|
||||
format:
|
||||
html:
|
||||
html-math-method: katex
|
||||
---
|
||||
|
||||
|
||||
Counting in 2D: Reorienting Polynomials
|
||||
=======================================
|
||||
|
||||
[Previously](), I explored some very basic 2D counting systems, inspired by sandpiles. As the name suggests, these planar numbers require a discrete grid of numbers to contain them. What follows is a deeper investigation into this natural extension of positional systems.
|
||||
|
||||
|
||||
Direction of Propagation
|
||||
------------------------
|
||||
|
||||
Given a carry (expressed as a polynomial in two variables or a grid) and an increasing sequence of integers, the expansions of the sequence will appear to propagate in a certain direction. Consider that from the last post, it is known that $x + y = 2$ and a certain case of the Folium of Descartes will make the same pattern:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
& ~ & \text{Folium}\\
|
||||
2 - x - y & ~ &
|
||||
2xy - x^3 - y^3 \\
|
||||
\begin{array}{|c} \hline
|
||||
2 & \bar{1} \\ \bar{1}
|
||||
\end{array} & ~ &
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 0 & \bar{1} \\
|
||||
0 & 2 \\ 0 \\ \bar{1}
|
||||
\end{array}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
Connecting a vector that extends from the largest digit (hereafter pseudo-base) to every other digit in the carry, it is clear that the carry can extend only in a linear combination of these directions. However, they cannot propagate in the reverse direction, as there is no sense of "backwards".
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\begin{array}{|c} \hline
|
||||
2 & \bar{1} \vphantom{2^{2^2}} \\ \bar{1}
|
||||
\end{array} & ~ &
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 0 & \bar{1} \vphantom{2^{2^2}} \\
|
||||
0 & 2 \\ 0 \\ \bar{1}
|
||||
\end{array} \\
|
||||
\begin{matrix}
|
||||
\langle 1, 0 \rangle \\
|
||||
\langle 0, 1 \rangle
|
||||
\end{matrix}
|
||||
& ~ &
|
||||
\begin{matrix}
|
||||
\langle 2, -1 \rangle \\
|
||||
\langle -1, 2 \rangle
|
||||
\end{matrix}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
|
||||
### Balancing Act
|
||||
|
||||
We can naively "balance" the carry by adding additional carry digits at the additive inverses of these vectors and doubling the pseudo-base. Equivalently, this adds to the original carry the polynomial obtained by reflecting these points in the pseudo-base. If we balance the left carry, it yields the Laplacian. But what about the right? Unsurprisingly, it just stretches the expansions along the different "base" vectors.
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
4 x^{2} y^{2} - x^{4} y - x^{3} - x y^{4} - y^{3} \\
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 0 & \textcolor{red}{\bar{1}} \vphantom{2^{2^2}} \\
|
||||
0 & 0 & 0 & 0 & \textcolor{blue}{\bar{1}} \\
|
||||
0 & 0 & 4 & 0 \\
|
||||
\textcolor{blue}{\bar{1}} & 0 & 0 \\ & \textcolor{red}{\bar{1}}
|
||||
\end{array} \\
|
||||
\text{Added Vectors:} \\
|
||||
\begin{matrix}
|
||||
\textcolor{blue}{
|
||||
\langle -2, 1 \rangle} \\
|
||||
\textcolor{red}{
|
||||
\langle 1, -2 \rangle
|
||||
}
|
||||
\end{matrix}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
![]()
|
||||
:::
|
||||
|
||||
|
||||
### Half-Balanced
|
||||
|
||||
The Laplacian carry is remarkably balanced, but it provokes the question of what the expansions look like if there are only 3 directions to propagate. The intuition from above says that it should span a half-plane, up from the quarter-plane that $x + y = 2$ spans.
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
3 x - xy - x^2 - 1 \\
|
||||
\begin{array}{|c} \hline
|
||||
\textcolor{red}{\bar{1}} \vphantom{2^{2^2}}& 3 & \textcolor{red}{\bar{1}} \\
|
||||
0 & \bar{1} & 0
|
||||
\end{array} \\
|
||||
\text{Added Vector:} \\
|
||||
\begin{matrix}
|
||||
\textcolor{red}{
|
||||
\langle -1, 0 \rangle
|
||||
}
|
||||
\end{matrix}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
:::
|
||||
|
||||
Fortunately, this is the case.
|
||||
|
||||
|
||||
### 2D Carry Types
|
||||
|
||||
Based on the extent of the vectors, in general there appear to be four possibilities:
|
||||
|
||||
1. The degenerate one-dimensional case
|
||||
- The carry is equivalent to the product of a polynomial in a single variable and any power *x* and/or *y*.
|
||||
2. Quarter-planes, like $x + y = 2$
|
||||
- Arises when the inverses of the vectors are inaccessible.
|
||||
3. Half-planes, like the above altered Laplacian
|
||||
- Arises when two vectors are collinear and point in opposite directions, but every other vector is either on one side of this line or are also collinear.
|
||||
4. Full-planes, like the Laplacian
|
||||
- Arises when the inverses of both vectors are accessible.
|
||||
|
||||
Quarter-plane is a bit of a misnomer. Technically, the fraction of the plane spanned is between 0 and 1/2 noninclusive (as these bounds correspond to the previous and next cases respectively). For example, $x + y = 2$ certainly expands to the entire quarter-plane, as the first row/column, which contain binary expansions, are unbounded. However, the Folium encompasses slightly more of the plane, or...
|
||||
|
||||
$$
|
||||
\frac{1}{2\pi}\arccos \left (
|
||||
\frac{\langle 2, -1 \rangle \cdot \langle -1, 2 \rangle}
|
||||
{\| \langle 2, -1 \rangle \| \| \langle -1, 2 \rangle \|} \right)
|
||||
= \frac{1}{2\pi} \arccos \left ( -\frac 4 5 \right )
|
||||
\approx 0.397584
|
||||
$$
|
||||
|
||||
about 40% of the plane. This is still smaller than the half-plane case.
|
||||
|
||||
With these categories in mind, I would now like to shift focus. All systems discussed thus far have been explicit and irreducible, meaning they are not derived from any "simpler" implicit rules. Do such rules exist, and cam we find any?
|
||||
|
||||
|
||||
Hunting for Implicitness
|
||||
------------------------
|
||||
|
||||
I mentioned previously how one might go about producing these carries. The gist is to form an explicit carry from the product of some input polynomial and cyclotomic polynomials in x and y. However, I would like to leverage the visual representation used previously, since working with coefficients is linear, unintuitive, and most importantly, annoying.
|
||||
|
||||
![]()
|
||||
|
||||
Above is my (admittedly low-effort) attempt to ameliorate these shortcomings (downloadable [here]()). The left image is clickable, with the coefficients incrementing with left clicks and decrementing with right. The text box controls the second multiplicand in the center image by selecting a cyclotomic polynomial and evaluating it with a particular expression. The right image is the product.
|
||||
|
||||
It could obviously be improved by showing the coefficients in the picture and using color to only indicate sign. However, there is a benefit to hiding coefficients behind solid colors. For instance, I don't need to recognize numerals to pinpoint what the product should look like.
|
||||
|
||||
|
||||
### Degenerate Expressions
|
||||
|
||||
I have chosen to evaluate the right term (center image) at *x* + *y* for a reason. Choosing *x* or *y* on their own is a poor decision because they change nothing from the one dimensional case. Put another way, when arranged in a grid, the coefficients are all collinear. At first blush, *xy* seems like a decent pick, but it has the exact same problem; the line simply extends along the diagonal instead. The opposite case $\frac x y$ might not make sense, but the denominators can be cleared by multiplying by the appropriate power of *y*. However, this makes the polynomial homogeneous, or in other words, collinear along the anti-diagonals, and has the exact same problem as the product.
|
||||
|
||||
![]()
|
||||
|
||||
It should go without saying that these are all degenerate, and can only span a line. On the other hand, expressions like the sum of *x* and *y* form triangles, 2D shapes from which it is possible to build our goal polynomial. Since *x* + *y* is symmetric in *x* and *y*, it is expected that the products have a similar sense of symmetry.
|
||||
|
||||
|
||||
First Results
|
||||
-------------
|
||||
|
||||
![]()
|
||||
|
||||
The first explicit product I found is above, which is reminiscent of the Folium of Descartes. The implicit carry (the left multiplicand) describes the rearrangement of coefficients in a backwards L-shape to and from a sparser upside-down L-shape. The property of passing through (1, 1) comes from this factor; this also illustrates that unlike polynomials in a single variable, the sum of the coefficients being zero does not imply the existence of a one-variable factor like *x* - 1.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
\text{Folium} & ~ & \text{New carry} \\
|
||||
2xy - x^3 - y^3 & ~ &
|
||||
3xy - x^3 - y^3 - 1 \\
|
||||
\begin{array}{|c} \hline
|
||||
0 & 0 & 0 & \bar{1} \\
|
||||
0 & 2 \\ 0 \\ \bar{1}
|
||||
\end{array} & ~ &
|
||||
\begin{array}{|c} \hline
|
||||
\bar{1} & 0 & 0 & \bar{1} \\
|
||||
0 & 3 \\ 0 \\ \bar{1}
|
||||
\end{array}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
|
||||
### Cousin Systems
|
||||
|
||||
My first thought upon seeing this carry was to see what makes counting in this system different from "neighbors", by which I mean moving the $x^3$ and $y^3$ terms further inward and outward.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
3xy - x - y - 1 &
|
||||
3xy - x^2 - y^2 - 1 \\
|
||||
\begin{array}{|c} \hline
|
||||
\bar{1} & \bar{1} \vphantom{2^{2^2}} \\
|
||||
\bar{1} & 3 \\
|
||||
\end{array} &
|
||||
\begin{array}{|c} \hline
|
||||
\bar{1} & 0 & \bar{1} \vphantom{2^{2^2}} \\
|
||||
0 & 3 \\ \bar{1}
|
||||
\end{array} \\
|
||||
\textcolor{red} {3xy - x^3 - y^3 - 1} &
|
||||
3xy - x^4 - y^4 - 1 \\
|
||||
\textcolor{red} { \begin{array}{|c} \hline
|
||||
\bar{1} & 0 & 0 & \bar{1} \vphantom{2^{2^2}} \\
|
||||
0 & 3 \\ 0 \\ \bar{1}
|
||||
\end{array} } &
|
||||
\begin{array}{|c} \hline
|
||||
\bar{1} & 0 & 0 & 0 & \bar{1} \vphantom{2^{2^2}} \\
|
||||
0 & 3 \\ 0 \\ 0 \\ \bar{1}
|
||||
\end{array}
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
All polynomials besides the one under consideration (highlighted in red) are irreducible. This means that these carries hide no implicit rules, and are as fundamental as the Laplacian or $x + y = 2$.
|
||||
|
||||
Analyzing the carry vectors, it is clear that the pattern produced by each should be different:
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
3xy - x - y - 1 &
|
||||
3xy - x^2 - y^2 - 1 \\
|
||||
\begin{matrix}
|
||||
\langle -1, 0 \rangle \\
|
||||
\langle -1, -1 \rangle \\
|
||||
\langle 0, -1 \rangle
|
||||
\end{matrix} &
|
||||
\begin{matrix}
|
||||
\langle -1, 1 \rangle \\
|
||||
\langle -1, -1 \rangle \\
|
||||
\langle 1, -1 \rangle
|
||||
\end{matrix} \\
|
||||
3xy - x^3 - y^3 - 1 &
|
||||
3xy - x^4 - y^4 - 1 \\
|
||||
\begin{matrix}
|
||||
\langle -1, 2 \rangle \\
|
||||
\langle -1, -1 \rangle \\
|
||||
\langle 2, -1 \rangle
|
||||
\end{matrix} &
|
||||
\begin{matrix}
|
||||
\langle -1, 3 \rangle \\
|
||||
\langle -1, -1 \rangle \\
|
||||
\langle 3, -1 \rangle
|
||||
\end{matrix} \\
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
The top-left tends toward a similar shape as the $x + y = 2$ case, since we can't reach the vector inverses. In the top-right carry, all vectors are equidistant and meet at right (and straight) angles. This means that it is a 45° rotation of the altered Laplacian, which spans a half-plane. The remaining two should both propagate into the full plane. Is this reflected in the counting videos?
|
||||
|
||||
:::{}
|
||||
Counting in each of the $\ldots - x^n - y^n + \ldots$ systems
|
||||
:::
|
||||
|
||||
Indeed it is. The first two propagate toward the upper-left, and the remaining two span the entire plane. However, while the discovered carry remarkably remains centered, the final one tends more toward propagating to the lower right. It has somehow exceeded a threshold that the centered one has not.
|
||||
|
||||
Notably, the L-shapes (which I noted can be interchanged) never turn up, and the "initial rule" is useless. Phinary, the simplest implicit case in one dimension, still requires the initial rule to go from the expansion of 2 (10.01) to 3 (100.01).
|
||||
|
||||
|
||||
Isosceles Rotations
|
||||
-------------------
|
||||
|
||||
Since one of the similar carries produces a rotation of a familiar pattern, it provokes additional questions, such as if we can rotate the centered pattern. If so, is its polynomial also factorable? Naively, the following carry might look similar...
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
\begin{array}{|c} \hline
|
||||
& & \textcolor{red}{\bar{1}} \\
|
||||
& & 3 \\ \textcolor{green}{\bar{1}}
|
||||
&&& & \textcolor{blue}{\bar{1}}
|
||||
\end{array} \\
|
||||
\begin{matrix}
|
||||
\textcolor{red}{\langle 0,1 \rangle} \\
|
||||
\textcolor{green}{\langle -2,-1 \rangle} \\
|
||||
\textcolor{blue}{\langle 2,-1 \rangle} \\
|
||||
\text{Angle to top} \approx 116°
|
||||
\end{matrix}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
:::
|
||||
|
||||
There are only even numbers in the first component, so we can describe the carry more succinctly as...
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
\begin{array}{|c} \hline
|
||||
& \textcolor{red}{\bar{1}} \\
|
||||
& 3 \\ \textcolor{green}{\bar{1}}
|
||||
&& \textcolor{blue}{\bar{1}}
|
||||
\end{array} \\
|
||||
\begin{matrix}
|
||||
\textcolor{red}{\langle 0,1 \rangle} \\
|
||||
\textcolor{green}{\langle -1,-1 \rangle} \\
|
||||
\textcolor{blue}{\langle 1,-1 \rangle} \\
|
||||
\text{Angle to top} = 135°
|
||||
\end{matrix}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
:::
|
||||
|
||||
Though both of these videos are the same, neither are similar to the original. For comparison, the largest angle in the nonrotated triangle is ~108°. In fact, the shape is much closer to the similar orientation with $\ldots - x^4 - y^4 + \ldots$ terms.
|
||||
|
||||
|
||||
### Checking Magnitudes
|
||||
|
||||
Measuring these quantities as angles is a bit of a lie. More fundamentally, two of the vectors have equal magnitude, and the ratio between they and the final vector's magnitude is irrational. This means that the unequal lengths are incommensurable. Importantly though, they way in which they are incommensurable is different for each polynomial.
|
||||
|
||||
$$
|
||||
\textcolor{red}{
|
||||
\frac{m_1}{n_1} =
|
||||
\frac{\| \langle 2, -1 \rangle \|}{\| \langle -1, -1 \rangle \|} =
|
||||
\frac{\sqrt 5}{\sqrt 2} =
|
||||
\frac{\sqrt {10}}{2}
|
||||
}
|
||||
\\
|
||||
\frac{m_2}{n_2} =
|
||||
\frac{\| \langle -2, -1 \rangle \|}{\| \langle 0, -1 \rangle \|} =
|
||||
\frac{\sqrt 5}{1} =
|
||||
\sqrt 5
|
||||
\\
|
||||
\frac{m_3}{n_3} =
|
||||
\frac{\| \langle -1, -1 \rangle \|}{\| \langle 0, -1 \rangle \|} =
|
||||
\frac{\sqrt 2}{1} =
|
||||
\sqrt 2
|
||||
$$
|
||||
|
||||
Obviously, one cannot express $\sqrt 10$ from only one of $\sqrt 2$ or $\sqrt 5$. Fortunately, this suggests the rotation:
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
\begin{array}{|c} \hline
|
||||
& \textcolor{red}{\bar{1}} \\
|
||||
& 3 \\ \textcolor{green}{\bar{1}}
|
||||
&& \textcolor{blue}{\bar{1}}
|
||||
\end{array} \\
|
||||
\begin{matrix}
|
||||
\textcolor{red}{\langle 0,1 \rangle} \\
|
||||
\textcolor{green}{\langle -1,-1 \rangle} \\
|
||||
\textcolor{blue}{\langle 1,-1 \rangle} \\
|
||||
\text{Angle to top} = 135°
|
||||
\end{matrix}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
:::
|
||||
|
||||
The counting video looks very promising, but can the polynomial factorized? Indeed it can, since all the vectors are in least terms and are incommensurable in the same way.
|
||||
|
||||
$$
|
||||
\begin{gather*}
|
||||
3 x^{3} y^{2} - x^{6} y^{3} - x^{3} - y^{3} &=&
|
||||
(- x^{4} y^{2} + x^{3} y + x^{2} y^{2} - x^{2} + x y - y^{2}) \\
|
||||
&& (x^2 y + x + y ) \\
|
||||
\begin{array}{|c} \hline
|
||||
&&& \bar{1} \\ \\
|
||||
&&& 3 \\ \bar{1}
|
||||
&&&&&& \bar{1}
|
||||
\end{array} &=&
|
||||
\begin{array}{|c} \hline
|
||||
& & \bar{1} & \\
|
||||
& 1 & & 1 & \\
|
||||
\bar{1} & & 1 & & \bar{1} \\
|
||||
\end{array} ~~\cdot~~
|
||||
\begin{array}{|c} \hline
|
||||
& 1 & \\ 1 & & 1
|
||||
\end{array} \\
|
||||
&&(x y^{2} + x + y ) = \Phi_2 \left ( \frac{y}{x} + xy \right ) x
|
||||
\end{gather*}
|
||||
$$
|
||||
|
||||
As noted, the the rightmost polynomial can be expressed from $\Phi_2$.
|
||||
|
||||
All powers of *x* in the product are multiples of 3. We can divide these out to produce a similar carry, as we did before. Doing so preserves the shape of counting, but destroys the factorization, as the result is irreducible.
|
||||
|
||||
:::{.column width="40%"}
|
||||
$$
|
||||
\begin{array}{|c} \hline
|
||||
& \textcolor{red}{\bar{1}} & \\ \\
|
||||
& 3 & \\
|
||||
\textcolor{green}{\bar{1}} & & \textcolor{blue}{\bar{1}}
|
||||
\end{array} ~~
|
||||
\begin{matrix}
|
||||
\textcolor{red}{\langle 0,2 \rangle} \\
|
||||
\textcolor{green}{\langle -1,-1 \rangle} \\
|
||||
\textcolor{blue}{\langle 1,-1 \rangle} \\
|
||||
\end{matrix} \\
|
||||
\frac{| \langle -1, -1 \rangle |}{| \langle 0,2 \rangle |}
|
||||
= \frac{\sqrt 2}{2}
|
||||
$$
|
||||
:::
|
||||
|
||||
:::{.column width="40%"}
|
||||
:::
|
||||
|
||||
All of these similar systems is share something in common: the pseudo-base is located at the centroid of the triangle formed by the remaining digits. This is most obvious from the fact that the sum of all three vectors equals $\vec 0$ in all three cases. The "threshold we exceeded" when comparing its neighbors was the centroid transitioning between being closer to the upper point or the lower two points.
|
||||
|
||||
The position of the centroid is unchanged so long as the lower two points have the same midpoint as above. Therefore, all such barycentric carries share this similar pattern.
|
||||
|
||||
|
||||
Closing
|
||||
-------
|
||||
|
||||
Since the pseudo-base will be positioned at the one's place to start, it makes sense to consider the vectors that stretch from it to the "spread" digits. If the carry is reducible, then preserving the ratios of the lengths of the vectors appears to preserve the reducibility of the polynomial (and obviously, the counting system). However, further compacting the counting system by dividing components by a common factor tends to destroy reducibility.
|
||||
|
||||
Two questions that immediately come to mind are:
|
||||
|
||||
- Not all integers can be written as the sum of two squares. Are there any (reducible) polynomials which have no rotation other than by swapping components and orientation?
|
||||
- The [Brahmagupta-Fibonacci](https://en.wikipedia.org/wiki/Brahmagupta%E2%80%93Fibonacci_identity) identity implies that such numbers are closed under multiplication. This means that it is always possible to reorient the triangle in the method shown above.
|
||||
- After compacting the counting system, can reducibility be recovered for other scaling factors than the one started with? What about from an irrational scaling (as by a rotation)?
|
||||
- I am not equipped to answer this.
|
||||
|
||||
It is very pleasing that the exponents of polynomials should correlate so well to the components of vectors. The primary geometrical approach to such objects is to plot all points which (at least approximately) satisfy the root, but basic coordinate geometry exists without needing to define evaluation. All at once, geometry, linear algebra, and polynomial number theory play a role in the story of these bizarre fractal patterns.
|
||||
Loading…
x
Reference in New Issue
Block a user