Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Paper turingmachine exercises
1. Symbols on the tape
Add 1 (in unary)
A
if write
move
jumpTo A
if write
move
jumpTo F
Paper Turing Machine
( Andrea Valente
Program www.create.aau.dk/av
of the Turing Machine av@create.aau.dk )
2. Input is 2 in unary: II
A
A
A
A
if write
move
jumpTo A
FINISH
if write
Output is 3 in unary: III
time move
jumpTo F
3. Subtract 1 (in unary)
Fold
Go Erase
if write if write
move move
jumpTo Go jumpTo F
if write
move
jumpTo Erase TASK
Test this machine on
the input 3 (in unary)
4. Invert and
Inv
if write
move
jumpTo Inv
if
write
move
jumpTo Inv
if write
move
jumpTo F
Consider: input = 1101 in binary, output = 0010
5. Is a unary number even?
Input = 3 ---> output = No, not even Input = 2 ---> output = Yes, it is even!
A A
B B
A A
Y
B F
N TASK
Design and test a TM for this
F
problem.
6. Check if this property is true:
“the second symbol is ”
A
...
Y
FINISH
7. Addition in unary
Design a Turing Machine that can add 2 unary numbers.
Test it: on input 2 and 1, the output should be 3.
A
...
FINISH
8. Palindromes | semordnilaP
Design a TM that decides if the tape contains a palindrom sequence.
Test it on input .
A
...
Y
FINISH
9. if write if write if write if write
move move move move
jumpTo jumpTo jumpTo jumpTo
if write if write if write if write
move move move move
jumpTo jumpTo jumpTo jumpTo
if write if write if write if write
move move move move
jumpTo jumpTo jumpTo jumpTo
if write if write if write if write
move move move move
jumpTo jumpTo jumpTo jumpTo
if write if write if write if write
move move move move
jumpTo jumpTo jumpTo jumpTo
if write if write if write if write
move move move move
jumpTo jumpTo jumpTo jumpTo