Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
