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:
ASCSC1PP629W1:hw6 raj$ python3 TM.py div.tm saaaaaaadaaa= Initial Tape: saaaaaaadaaa=1^ Final Tape: saaaaaaadaaa=aa h ^ ACCEPT ASCSC1PP629W1:hw6 raj$ python3 TM.py div.tm saaaaaaadaaaa= Initial Tape: saaaaaaadaaaa=1^ Final Tape: saaaaaaadaaaa=a h ^ ACCEPT ASCSC1PP629W1:hw6 raj$ python3 TM.py div.tm saadaaaa= Initial Tape: saadaaaa=1^ Final Tape: saadaaaa=# h ^ ACCEPT ASCSC1PP629W1:hw6 raj$ 1. Design a TM that performs the "div" operation on "unary" numbers and test it under the TM Simulator. Here are some sample runs:
```
ASCSC1PP629W1:hw6 raj$ python3 TM.py div.tm saaaaaaadaaa=
Initial Tape:
saaaaaaadaaa=1
Final Tape:
saaaaaaadaaa=aa h
```
ACCEPT
```
ASCSC1PP629W1:hw6 raj$ python3 TM.py div.tm saaaaaaadaaaa=
Initial Tape:
saaaaaaadaaaa=1
Final Tape:
saaaaaaadaaaa=a h
```
ACCEPT
ASCSC1PP629W1:hw6 raj\$ python3 TM.py div.tm saadaaaa=
Initial Tape:
saadaaaa=1
Final Tape:
saadaaaa=\# h
ACCEPT
ASCSC1PP629W1:hw6 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 a's and b's
%% with equal number of a's and b's
1,1,b,b,r
1,1,x,x,r
1,2,a,x,l
1,5,#,#,l
2,2,x,x,l
2,2,b,b,l
2,3,#,#,r
3,3,a,a,r
3,3,x,x,r
3,4,b,x,l
4,4,a,a,l
4,4,x,x,l
4,1,#,#,r
5,5,x,x,l
5,h,#,#,r.........MAKE 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!