September 22, 2025
lastTtoA
machineTrace of lastTtoA
on input CTCGTA:
Step 1: q₀: [C] T C G T A (start, head at position 0)
Step 2: q₀: C [T] C G T A (read C, write C, move right)
Step 3: q₀: C T [C] G T A (read T, write T, move right)
Step 4: q₀: C T C [G] T A (read C, write C, move right)
Step 5: q₀: C T C G [T] A (read G, write G, move right)
Step 6: q₀: C T C G T [A] (read T, write T, move right)
Step 7: q₀: C T C G T A [⊔] (read A, write A, move right)
Step 8: q₁: C T C G T [A] ⊔ (read ⊔, write ⊔, move left)
Step 9: q₁: C T C G [T] A ⊔ (read A, write A, move left)
Step 10: qₕₐₗₜ: C T C G [A] A ⊔ (read T, write A, stay, halt)
(state, symbol)
to (new_state, new_symbol, direction)
lastTtoA
machine halts under these assumptions:
containsGAGA
acceptor machinecontainsGAGA
statesState meanings for containsGAGA
:
containsGAGA
diagramState diagram for the containsGAGA
Turing machine.
lastTtoA
changes CTCGTA to CTCGAAcontainsGAGA
accepts/rejects DNA stringscontainsGAGA
in PythoncontainsGAGA
acceptor Turing machinemoreCsThanGs
acceptor machinemoreCsThanGs
in Pythonq0->q1: x;R
q1->q1: zTA;R
q1->q2: G;z,R
q1->q3: C;z,R
q1->qR: x;S
q2->q2: zTAG;R
q2->q4: C;z,L
q2->qR: x;S
q3->q3: zTAC;R
q3->q4: G;z,L
q3->qA: x;S
q4->q1: x;R
q4->q4: !x;L
moreCsThanGs.tm
filemoreCsThanGs.tm
zTA
intuitively means “any symbol from {z, T, A}”zTAC
intuitively means “any symbol from {z, T, A, C}”zTAG
intuitively means “any symbol from {z, T, A, G}”z
= marker for processed symbolsT
, A
= input symbols to skip overC
, G
= target symbols for counting/cancellingInsight: A single, fixed Turing machine can compute anything that any Turing machine can compute! This is the theoretical foundation of general-purpose computers.
Proofgrammers