turing machine read/write – move left/right bb read/write head 001000 state qi
TRANSCRIPT
![Page 1: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/1.jpg)
Turing MachineRead/Write – Move Left/Right
B B
Read/Write Head
0 0 1 0 0 0
State Qi
![Page 2: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/2.jpg)
State Diagram for Modulus 3shows only the tape input
Q0
Q1
Q2
Start 1
1
00
1
0
Q3 Q4
BB
B
B,0,1
![Page 3: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/3.jpg)
Turing MachineProgram To Compute Values
Modulus 3State, Write, Direction
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
![Page 4: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/4.jpg)
Modulus 353 % 3
B B1 1 0 1 0 1
State Q0
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
New State – Write B
![Page 5: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/5.jpg)
Modulus 353 % 3
B BB 1 0 1 0 1
State Q1
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
![Page 6: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/6.jpg)
Modulus 353 % 3
B BB B 0 1 0 1
State Q0
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
Write B
![Page 7: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/7.jpg)
Modulus 353 % 3
B BB B B 1 0 1
State Q0
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L New State – Write B
![Page 8: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/8.jpg)
Modulus 353 % 3
B BB B B B 0 1
State Q1
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,LNew State – Write B
![Page 9: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/9.jpg)
Modulus 353 % 3
B BB B B B B 1
State Q2
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,LWrite B
![Page 10: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/10.jpg)
Modulus 353 % 3
B BB B B B B B
State Q2
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
New State – Write 0
![Page 11: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/11.jpg)
Modulus 353 % 3
B 0B B B B B B
State Q4
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
New State – Write 1
![Page 12: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/12.jpg)
Modulus 353 % 3
B 0B B B B B 1
Q3 Halt
State B 0 1
Q0 3,0,L, 0,B,R 1,B,R
Q1 3,1,L 2,B,R 0,B,R
Q2 4,0,L 1,B,R 2,B,R
Q3 Halt Halt Halt
Q4 3,1,L 3,1,L 3,1,L
![Page 13: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/13.jpg)
Turing MachineProgram To Add Unary Numbers
State, Write, Direction
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 3,1,Halt Halt 3,1,L
![Page 14: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/14.jpg)
Adding Two Unary Numbers2 + 3 = 5
B B1 1 0 1 1 1
State Q0
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 15: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/15.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 0 1 1 1
State Q0
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 16: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/16.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 0 1 1 1
State Q0 New State – Write B
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 17: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/17.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 1
State Q1
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 18: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/18.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 1
State Q1
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 19: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/19.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 1
State Q1
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 20: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/20.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 1
State Q1New State
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 21: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/21.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 1
State Q2
New State – Write B
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 22: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/22.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 B
State Q3
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 23: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/23.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 B 1 1 B
State Q3
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 24: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/24.jpg)
Adding Two Unary numbers 2 + 3 = 5
B B1 1 1 1 1 B
Q3 HALT HALT – Write 1
State B 0 1
Q0 Halt 1,B,R 0,1,R
Q1 2,B,L Halt 1,1,R
Q2 Halt Halt 3,B,L
Q3 - 1,Halt Halt 3,1,L
![Page 25: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/25.jpg)
Turing MachineProgram To Subtract Unary Numbers
State, Write, Direction
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 26: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/26.jpg)
Turing Machine with Halt State Program To Subtract Unary Numbers
State, Write, Direction
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,4 1,B,4 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,4 3,B,4 0,B,R
Q4 Halt Halt Halt
![Page 27: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/27.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 1
State Q0
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 28: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/28.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 1
State Q0
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
. . .
![Page 29: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/29.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 1
State Q1
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 30: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/30.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 B
State Q2
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 31: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/31.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 B
State Q2
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 32: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/32.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 B
State Q2
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
. . .
![Page 33: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/33.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B B1 1 1 0 1 B
State Q3
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 34: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/34.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB 1 1 0 1 B
State Q0
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 35: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/35.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB 1 1 0 1 B
State Q0
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
. . .
![Page 36: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/36.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB 1 1 0 1 B
State Q1
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 37: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/37.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB 1 1 0 B B
State Q2
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 38: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/38.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB 1 1 0 B B
State Q2
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
. . .
![Page 39: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/39.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB 1 1 0 B B
State Q3
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 40: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/40.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB B 1 0 B B
State Q0
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 41: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/41.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB B 1 0 B B
State Q0
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 2,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
. . .
![Page 42: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/42.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB B 1 0 B B
Q1
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 1,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R
![Page 43: Turing Machine Read/Write – Move Left/Right BB Read/Write Head 001000 State Qi](https://reader035.vdocuments.net/reader035/viewer/2022062409/56649c755503460f9492949a/html5/thumbnails/43.jpg)
Subtracting Two Unary Numbers5 − 2 = 3
B BB B 1 B B B
Q1 Halt Write Blank
1 1
State B 0 1
Q0 1,B,L 0,0,R 0,1,R
Q1 1,B,Halt 1,B,Halt 2,B,L
Q2 3,B,R 2,0,L 1,1,L
Q3 3,B,Halt 3,B,Halt 0,B,R