- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
Let $f_1(x,y)=x+y$, $f_2(x,y)=xy$.
I want to find a Turing machine that computes $f_1$ and describe one that computes $f_2$.A Turing machine can:
View attachment 6383The numbers are in binary form. We have to add the last element of $x$ to the last element of $y$ , then delete the last elements, and then we continue with the next-to-last elements and so on, following the rules of the binary addition.
I have thought the following:
We place the head of the Turing machine at the first element left to [m]B[/m], and set the value of this cell to some variable , let s.
Then we place the head $|x|+1$ position to the left, read the number of this cell and add it to s.
We take an empty string and add s at its last position.
We delete the two numbers that we added, and continue with the same procedure with the the next-to-last elements. The new result of s will be placed at the next-to-last position of the string.
Is my idea right?
Let $f_1(x,y)=x+y$, $f_2(x,y)=xy$.
I want to find a Turing machine that computes $f_1$ and describe one that computes $f_2$.A Turing machine can:
- read
- delete
- write
View attachment 6383The numbers are in binary form. We have to add the last element of $x$ to the last element of $y$ , then delete the last elements, and then we continue with the next-to-last elements and so on, following the rules of the binary addition.
I have thought the following:
We place the head of the Turing machine at the first element left to [m]B[/m], and set the value of this cell to some variable , let s.
Then we place the head $|x|+1$ position to the left, read the number of this cell and add it to s.
We take an empty string and add s at its last position.
We delete the two numbers that we added, and continue with the same procedure with the the next-to-last elements. The new result of s will be placed at the next-to-last position of the string.
Is my idea right?