Question: % 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
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
