Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 5 ( a ) ( 1 7 marks ) Write the transition table for the Turing machine. Organise the transitions by state or by
Qa marks
Write the transition table for the Turing machine. Organise the transitions by state or by the order they're executed Section Use descriptive state names.
Suggestions: Write and test a machine that handles evenlength inputs and then handles oddlength inputs. 'Remove' ie blank out input symbols as you process them.
You should add tests to check your Turing machine, but you won't be awarded any marks for your tests. You don't have to remove your tests before submitting this TMA.
In palindrometests, set the debug parameter toTrueif you want to see the configurations your Turing machine goes through. Make sure youset it back toFalseand run the cell again before submittingyour TMA.
# State 'start', symbol read
start: None RIGHT, 'checkright' # Move to the right to start checking
start: None RIGHT, 'checkright'
# State 'checkright', symbol read
checkright', : None RIGHT, 'checkright' # Continue moving right
checkright', : None RIGHT, 'checkright'
None None: None LEFT, 'checkleft' # Encountered blank, start checking from the left
# State 'checkleft', symbol read
checkleft', : None LEFT, 'compare' # Start comparing from the left
checkleft', : None LEFT, 'compare'
# State 'compare', symbol read
compare: LEFT, 'compare' # Move left
compare: LEFT, 'compare'
None None: None RIGHT, 'halt' # Reached the beginning, halt
run i mutil # both files are in the downloaded TMA zip file
run i mtm
palindrome
palindrometests
# case, TM input tape, debug, output tape
palindrome palindrome, False,
not palindrome', palindrome, False,
even palindrome palindrome, False,
testrunTM palindrometests
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started