Small Turing Machines almost count in base Pisot
Contents:
If you haven’t seen the previous ones, do so. This is a countinuation.
- Exploratory analysis of Busy Beaver’s machines using Basin. Link
- Growth class analysis of small Turing Machines. Link
# Counters and bases
I hinted at counters before. Let’s talk about it now. From the very beginning when we talked about the t-fit and u-fit we haven’t really seen u-fit machines. Until now!
An example for a counter is 1RB---_0RC---_0RD---_0RE0LD_1LD1RE. This guy’s span touched only 26 cells after $2^24$ steps (a keen eye would catch that I wrote $2^24$ and not $2^22$ even though I said I ran only $2^22$ steps at the very beginning. Well done, but I did an extended run. I’ll talk about it).
So, Basin gives these kinda guys a u-law of course. For example:
- $0.9946 \log(t) + 3.72$: about 1 new cell every time $t$ doubles
- $2.0069 \log(t) − 6.39$: about 2 new cells per doubling
- $3.0176 \log(t) − 6.96$: about 3 new cells per doubling.
A counter is a machine that keeps a number $N$ written on the tape and keeps adding 1 to it. Each “add 1” is one trip of the head over the low end of the number, plus a carry when needed.
Let me build it out okay. We’re going to be working with the expanded binary notation here because that’s how I learnt it from the Emperor’s New Mind by Roger Penrose. Here standard binary digits are expanded so 0 stays 0, 1 becomes 10, and 110 acts as a comma/delimiter.
We can tweak this a little, say that 10 replaces 0, 11 replaces 1 and 00 is the end of the number, if we’re dealing with just 1 number. So, a counter that goes on incrementing a number will follow this table:
| N | binary (normal order) | digits, low first | tape | span |
|---|---|---|---|---|
| 0 | 0 | 0 | [10] | 2 |
| 1 | 1 | 1 | [11] | 2 |
| 2 | 10 | 0 1 | [10][11] | 4 |
| 3 | 11 | 1 1 | [11][11] | 4 |
| 4 | 100 | 0 0 1 | [10][10][11] | 6 |
| 5 | 101 | 1 0 1 | [11][10][11] | 6 |
| 6 | 110 | 0 1 1 | [10][11][11] | 6 |
| 7 | 111 | 1 1 1 | [11][11][11] | 6 |
| 8 | 1000 | 0 0 0 1 | [10][10][10][11] | 8 |
Notice that a new digit is added and span grows by two exactly at N = 2, 4, 8. Each is 2× the last, so the base is $\beta = 2$. This was ofcourse by construction because my example was in base 2.
What gets written on the tape, determines the base.
Confused? Let me give you a table that will make things clearer:
| N | binary (base 2) | ternary (base 3) | Fibonacci (base $\phi$) | base 3/2 (digits, low first) |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 2 |
| 2 | 10 | 2 | 10 | 1 2 |
| 3 | 11 | 10 | 100 | 0 1 2 |
| 4 | 100 | 11 | 101 | 2 1 2 |
| 5 | 101 | 12 | 1000 | 1 0 1 2 |
| 6 | 110 | 20 | 1001 | 0 2 1 2 |
In each case, we’re counting in a different base. The same number $N$ gets different values on the tape for each base. All of these variety of bases can be found within counters that just increment a number by 1!
Isn’t that awesome! Unfortunately, Basin’s equation gives me the slope only. The slope $\alpha = \frac{k}{\log_2(\beta)}$ mixes two unknowns: the base $\beta$ and the cells per digit $k$. So, we’re not able to get the required precision!
So, we measure the timing instead. That is, the exact time when the span increases, and took the ratios between them to get the base. To write $N$ in base $\beta$ you need about $\log_{\beta}(N)$ digits. So a new digit, and with it new tape cells, appears each time $N$ grows by a factor $\beta$. In Fibonacci for example, a new digit appears when $N$ reaches 1, 2, 3, 5, 8, 13, …: each threshold is about $\phi$ times the last. If each digit uses $k$ cells of tape (some machines use 2 or 3 cells to encode one digit), then the span grows by one cell each time $N$ grows by a factor $\beta^(\frac{1}{k})$.