Skip to content

Instantly share code, notes, and snippets.

@Frank-Buss
Created November 23, 2025 14:55
Show Gist options
  • Select an option

  • Save Frank-Buss/a319afcf9ebdbdf773c39e84baa840f5 to your computer and use it in GitHub Desktop.

Select an option

Save Frank-Buss/a319afcf9ebdbdf773c39e84baa840f5 to your computer and use it in GitHub Desktop.
Starting Turing machine
Name: Binary Number Copier
Description: Copies a binary number with just 2 symbols, beside blank
Author: Frank Buss
Date: 2025
(blank='#', initial='start', position=0)
Step      0  State=start    Pos=0     Tape=010
Step      1  State=end0-0   Pos=1     Tape=#10
Step      2  State=end0-0   Pos=2     Tape=#10
Step      3  State=end0-0   Pos=3     Tape=#10#
Step      4  State=seq1-0   Pos=4     Tape=#10##
Step      5  State=first0-0 Pos=5     Tape=#10###
Step      6  State=first1-0 Pos=4     Tape=#10###
Step      7  State=first2-0 Pos=5     Tape=#10#0#
Step      8  State=first3-0 Pos=6     Tape=#10#0##
Step      9  State=back0    Pos=7     Tape=#10#0#0#
Step     10  State=back1    Pos=6     Tape=#10#0#0#
Step     11  State=back1    Pos=5     Tape=#10#0#0#
Step     12  State=back2    Pos=4     Tape=#10#0#0#
Step     13  State=back2    Pos=3     Tape=#10#0#0#
Step     14  State=back3    Pos=2     Tape=#10#0#0#
Step     15  State=back3    Pos=1     Tape=#10#0#0#
Step     16  State=back3    Pos=0     Tape=#10#0#0#
Step     17  State=start    Pos=1     Tape=#10#0#0#
Step     18  State=end0-1   Pos=2     Tape=##0#0#0#
Step     19  State=end0-1   Pos=3     Tape=##0#0#0#
Step     20  State=seq1-1   Pos=4     Tape=##0#0#0#
Step     21  State=seq2-1   Pos=5     Tape=##0#0#0#
Step     22  State=seq3-1   Pos=6     Tape=##0#010#
Step     23  State=seq4-0-1 Pos=7     Tape=##0#01##
Step     24  State=seq5-1   Pos=8     Tape=##0#01#0#
Step     25  State=back0    Pos=9     Tape=##0#01#01#
Step     26  State=back1    Pos=8     Tape=##0#01#01#
Step     27  State=back1    Pos=7     Tape=##0#01#01#
Step     28  State=back1    Pos=6     Tape=##0#01#01#
Step     29  State=back2    Pos=5     Tape=##0#01#01#
Step     30  State=back2    Pos=4     Tape=##0#01#01#
Step     31  State=back2    Pos=3     Tape=##0#01#01#
Step     32  State=back3    Pos=2     Tape=##0#01#01#
Step     33  State=back3    Pos=1     Tape=##0#01#01#
Step     34  State=start    Pos=2     Tape=##0#01#01#
Step     35  State=end0-0   Pos=3     Tape=####01#01#
Step     36  State=seq1-0   Pos=4     Tape=####01#01#
Step     37  State=seq2-0   Pos=5     Tape=####01#01#
Step     38  State=seq2-0   Pos=6     Tape=####01#01#
Step     39  State=seq3-0   Pos=7     Tape=####01001#
Step     40  State=seq4-0-0 Pos=8     Tape=####010#1#
Step     41  State=seq4-1-0 Pos=9     Tape=####010#0#
Step     42  State=seq5-0   Pos=10    Tape=####010#01#
Step     43  State=back0    Pos=11    Tape=####010#010#
Step     44  State=back1    Pos=10    Tape=####010#010#
Step     45  State=back1    Pos=9     Tape=####010#010#
Step     46  State=back1    Pos=8     Tape=####010#010#
Step     47  State=back1    Pos=7     Tape=####010#010#
Step     48  State=back2    Pos=6     Tape=####010#010#
Step     49  State=back2    Pos=5     Tape=####010#010#
Step     50  State=back2    Pos=4     Tape=####010#010#
Step     51  State=back2    Pos=3     Tape=####010#010#
Step     52  State=back3    Pos=2     Tape=####010#010#
Step     53  State=start    Pos=3     Tape=####010#010#
Step     54  State=halt     Pos=4     Tape=####010#010#
Halted: no rule for state=halt and symbol='0'
Initial tape: 010
Final tape: 010#010
Steps: 54
Number of transitions: 51
Histogram:
 symbol: #, count: 6
 symbol: 1, count: 2
 symbol: 0, count: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment