Describe an algorithm (not a Turing machine but rather explain in words). We wan
ID: 3690000 • Letter: D
Question
Describe an algorithm (not a Turing machine but rather explain in words). We want to build a description of a Turing machine that accepts {0 2 n | n 0}. For example 0 is in the language for n = 0. also 00 for n = 1. For n = 2 we get that 0000 is in the language. Also 00000000 for n = 3.
Hint: Go over the string and remove every second 0. And then return left. You have to check if the size of the string is not odd.
Let me be clear: You should write an algorithm that says: Go over the list from left to right and remove every second 0, etc. Namely explain in words not build a Turing machine. You should note that if you understand the algorithm, making in a program for a Turing machine is a purely technical matter.
Explanation / Answer
Turning Machine:
A turning machine is a hypothetical machine thought of by the mathemetics Alan.Despite its simplicity,the machine can simulate ANY computeer algorithm,no matter how complicated it is.
It accepts 0^2n|n>=0
for n=0 0^2n|n>=0 => 0
n=0
n=1
n = 2
At any time the machine has a head which is positioned over one of the squares on the tape.with this head the machine can perform three very basic operations:
1.Read the symbol on the square under head
2.Edit symbolby writing a new symbol or erasing it
3.Move the tape left or right by one square so that the machine can read and edit symbol on a neighbour square
n = 3
A trival example let try printing "000"
first write 0 on square under head
Next move tape left by one square
now write 0 on new square under head:
nqw move to left by one square again:
finally write 0 that's it
A simple program
Symbol read Write instruction Move instruction
Blank None None
0 Write 1 move to the right
1 Write 0 move to right
The machine will first read the symbol under head.
The current symbol is 0
Finally a blank symbol is read so the machine does nothing apart from blank symbol continuosly since we have instructed it to repeat the read-write-move sequence withput stopping.
0 0Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.