Skip to content

Instantly share code, notes, and snippets.

@gungorbudak
Created May 26, 2018 12:32
Show Gist options
  • Save gungorbudak/5feb44487c071f14758625433d4b65f9 to your computer and use it in GitHub Desktop.
Save gungorbudak/5feb44487c071f14758625433d4b65f9 to your computer and use it in GitHub Desktop.
Turing machine for a^nb^2nc^3n for n >= 0
name: a^nb^2nc^3n
source code: |
input: 'aabbbbcccccc'
blank: '_'
start state: start
table:
start:
a: {write: x, R: q1}
y: {R: start}
z: {R: start}
_: {R: accept}
accept:
q1:
a: {R: q1}
b: {write: y, R: q2}
y: {R: q1}
q2:
b: {write: y, R: q3}
q3:
b: {R: q3}
c: {write: z, R: q4}
z: {R: q3}
q4:
c: {write: z, R: q5}
q5:
c: {write: z, L: q6}
q6:
a: {L: q6}
b: {L: q6}
x: {R: start}
y: {L: q6}
z: {L: q6}
positions:
start: {x: 53.36, y: 136.44}
accept: {x: 53.59, y: 329.97}
q1: {x: 192.35, y: 132.48}
q2: {x: 321.72, y: 132.27}
q3: {x: 443.12, y: 132.57}
q4: {x: 581.65, y: 131.09}
q5: {x: 711.27, y: 130.95}
q6: {x: 525.96, y: 318.25}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment