Created
May 9, 2021 23:32
-
-
Save tzdanows/545657fc1e6376bce86984c6e8009265 to your computer and use it in GitHub Desktop.
TM1 from turingmachine.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input: '00111010' | |
blank: ' ' | |
# Problem TM1. Using the Turing machine simulator at turingmachine.io, write a TM program | |
# that accepts the language L = {w | w is a binary string with an even number of zeroes and | |
# an even number of ones}. | |
start state: state0 | |
table: | |
state0: | |
0: {R: state1} | |
1: {R: state2} | |
# Base case: empty string. | |
' ': {R: accept} | |
state1: | |
0: {R: state0} | |
1: {R: state3} | |
state2: | |
0: {R: state3} | |
1: {R: state0} | |
state3: | |
0: {R: state2} | |
1: {R: state1} | |
accept: | |
### Inputs tried: ### | |
# '00111010' ACCEPTED | |
# ' ' ACCEPTED | |
# '00001111' ACCEPTED | |
# '000111' REJECTED | |
# '1100' ACCEPTED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment