Answered step by step
Verified Expert Solution
Question
1 Approved Answer
% run - i m 2 6 9 _ util # both files are in the downloaded TMA zip file % run - i m
run i mutil # both files are in the downloaded TMA zip file
run i mtm
palindrome
# 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
palindrometests
# case, TM input tape, debug, output tape
palindrome palindrome, False,
not palindrome', palindrome, False,
even palindrome palindrome, False,
even palindrome palindrome, False,
even palindrome palindrome, False,
even palindrome palindrome, False,
odd palindrome palindrome, False,
odd palindrome palindrome, False,
odd palindrome palindrome, False,
not palindrome palindrome, False,
not palindrome palindrome, False,
not palindrome palindrome, False,
not palindrome palindrome, False,
testrunTM palindrometests
palindrome FAILED: instead of
not palindrome FAILED: instead of
even palindrome FAILED: instead of
even palindrome FAILED: instead of
even palindrome FAILED: instead of
even palindrome FAILED: instead of
odd palindrome FAILED: instead of
odd palindrome FAILED: instead of
odd palindrome FAILED: instead of
not palindrome FAILED: instead of
not palindrome FAILED: instead of
not palindrome FAILED: instead of
not palindrome FAILED: instead of
Tests finished.
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