Counter: Difference between revisions
(Added counter page + analysis) |
(Added zoology category) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
* '''R'''<sub>0</sub>: <code>B >0 → A <0</code>, | * '''R'''<sub>0</sub>: <code>B >0 → A <0</code>, | ||
* '''R'''<sub>''n''</sub>: <code>B >1<sup>n</sup> 0 → A <1<sup>n</sup> 0</code>, | * '''R'''<sub>''n''</sub>: <code>B >(1<sup>n</sup>)0 → A <(1<sup>n</sup>)0</code>, | ||
so that, for all ''n'' ≥ 0,<blockquote>A0 '''R'''<sub>''n''</sub> A1: <code>A >0 1<sup>n</sup> 0 → A <1<sup>n+1</sup> 0</code>. </blockquote>This proves that the [[transcript]] of <code>1RB1LA_0LA0RB</code> from the all zeros tape is<blockquote>(A0 '''R'''<sub>''n''</sub> A1)''<sup>n</sup>'' <sup>≥ 0</sup>.</blockquote>Furthermore, |'''R'''<sub>''n''</sub>|, the number of steps taken by '''R'''<sub>''n''</sub>, can be seen to be given by the recurrence<blockquote><math>|\mathbf R_0|= | so that, for all ''n'' ≥ 0,<blockquote>A0 '''R'''<sub>''n''</sub> A1: <code>A >0(1<sup>n</sup>)0 → A <(1<sup>n+1</sup>)0</code>. </blockquote>This proves that the [[transcript]] of <code>1RB1LA_0LA0RB</code> from the all zeros tape is<blockquote>(A0 '''R'''<sub>''n''</sub> A1)''<sup>n</sup>'' <sup>≥ 0</sup>.</blockquote>Furthermore, |'''R'''<sub>''n''</sub>|, the number of steps taken by '''R'''<sub>''n''</sub>, can be seen to be given by the recurrence<blockquote><math>|\mathbf R_0|=1,\ |\mathbf R_n| = 2|\mathbf R_{n-1}| + 3</math>,</blockquote>which has solution <math>|\mathbf R_n| = 2^{n + 2} - 3.</math> | ||
=== Analysis 2 === | === Analysis 2 === | ||
In this analysis, we will show that the counter indeed counts up in binary. More precisely, for a given non-negative integer ''n'', let <code> | In this analysis, we will show that the counter indeed counts up in binary. More precisely, for a given non-negative integer ''n'', let <code>bin(n)</code> denote the number ''n'' in binary. Also, let ''v<sub>2</sub>''(''n'') denote the 2-valuation of ''n'', which is the number of times that ''n'' is divisible by 2. Then we will show:<blockquote><code>B bin(n) >0 →[2v<sub>2</sub>(n+1) + 2] B bin(n+1) >0</code>.</blockquote>To show this, it suffices to show, for all ''k'' ≥ 0,<blockquote><code>B 0(1<sup>k</sup>)>0 →[2k + 2] B 1(0<sup>k</sup>)>0</code>.</blockquote>The sequence B0 A1<sup>''k''</sup> A0 B1<sup>''k''</sup> proves this. Moreover, we can see by the spacetime diagram that <code>B bin(1) >0</code> is reached (on step 1), which completes the analysis. | ||
[[Category: Zoology]] |
Latest revision as of 18:35, 15 November 2024

1RB1LA_0LA0RB
(bbch).A counter is a non-halting Turing machine that, roughly speaking, has a tape that grows logarithmically with time and whose tape counts up in some sort of place-value system. Often, when the place-value system is known, we may call such counters binary counters, ternary counters, and so on.
Example
1RB1LA_0LA0RB
(bbch) is a binary counter with 2 states and 2 symbols, whose spacetime diagram is shown in the image to the right. In fact, it is the only Turing machine with 2 states and symbols, up to permutations, that is a counter. In this section we give two analyses of this counter. The first analysis is coarse-grained in that it only proves non-halting and logarithmic tape growth. The second analysis is more detailed and furthermore explains the counter nature of this machine, as well as the precise step counts from one encoded number to the next.
Analysis 1
Define the macro rule Rn recursively as follows:
- R0 = B0,
- Rn = B1 Rn−1 A0 Rn−1 A1, for n ≥ 1.
Then we find by induction, for all n ≥ 0:
- R0:
B >0 → A <0
, - Rn:
B >(1n)0 → A <(1n)0
,
so that, for all n ≥ 0,
A0 Rn A1:
A >0(1n)0 → A <(1n+1)0
.
This proves that the transcript of 1RB1LA_0LA0RB
from the all zeros tape is
(A0 Rn A1)n ≥ 0.
Furthermore, |Rn|, the number of steps taken by Rn, can be seen to be given by the recurrence
,
which has solution
Analysis 2
In this analysis, we will show that the counter indeed counts up in binary. More precisely, for a given non-negative integer n, let bin(n)
denote the number n in binary. Also, let v2(n) denote the 2-valuation of n, which is the number of times that n is divisible by 2. Then we will show:
B bin(n) >0 →[2v2(n+1) + 2] B bin(n+1) >0
.
To show this, it suffices to show, for all k ≥ 0,
B 0(1k)>0 →[2k + 2] B 1(0k)>0
.
The sequence B0 A1k A0 B1k proves this. Moreover, we can see by the spacetime diagram that B bin(1) >0
is reached (on step 1), which completes the analysis.