Question: Design and code a TM that performs the div operation on unary numbers and test it under the TM Simulator. Here are some sample runs:
Design and code a TM that performs the "div" operation on "unary" numbers and test it under the TM Simulator. Here are some sample runs:
ASCSCPPW:hw raj$ python TMpy div.tm saaaaaaadaaa Initial Tape: saaaaaaadaaa Final Tape: saaaaaaadaaaaa h ACCEPT ASCSCPPW:hw raj$ python TMpy div.tm saaaaaaadaaaa Initial Tape: saaaaaaadaaaa Final Tape: saaaaaaadaaaaa h ACCEPT ASCSCPPW:hw raj$ python TMpy div.tm saadaaaa Initial Tape: saadaaaa Final Tape: saadaaaa# h ACCEPT ASCSCPPW:hw raj$ Design a TM that performs the "div" operation on "unary" numbers and test it under the TM Simulator. Here are some sample runs:
ASCSCPPW:hw raj$ python TMpy div.tm saaaaaaadaaa
Initial Tape:
saaaaaaadaaa
Final Tape:
saaaaaaadaaaaa h
ACCEPT
ASCSCPPW:hw raj$ python TMpy div.tm saaaaaaadaaaa
Initial Tape:
saaaaaaadaaaa
Final Tape:
saaaaaaadaaaaa h
ACCEPT
ASCSCPPW:hw raj$ python TMpy div.tm saadaaaa
Initial Tape:
saadaaaa
Final Tape:
saadaaaa# h
ACCEPT
ASCSCPPW:hw raj$ Similar to this format where h is the hald state and # if a cell is not occupied, a blank cell. This TM accepts strings made up of as and bs
with equal number of as and bs
bbr
xxr
axl
##l
xxl
bbl
##r
aar
xxr
bxl
aal
xxl
##r
xxl
h##rMAKE THE ENTIRE TM AND do it in the format of current state, next state, read, write, move. with # representing blank cells, and h as the halt state.
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
