Is this a possible Turing machine for computing $f_2$?

In summary, a Turing machine can read, delete, and write numbers in binary form. To compute $f_1(x,y)=x+y$, the Turing machine should place the head at the first element left to B, set the value of this cell to some variable s, add the last elements of x and y to s, delete the two numbers, and continue this process until all elements have been added and the final result is placed in the last position of the string. To compute $f_2(x,y)=xy$, a similar process is followed, but instead of adding, the numbers are multiplied and the product is placed in the last position of the string.
  • #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:

  • 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?
 

Attachments

  • addition.png
    addition.png
    2.2 KB · Views: 66
Physics news on Phys.org
  • #2
For computing $f_2$, the Turing machine should follow these steps: We place the head of the Turing machine at the first element left to B, 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 multiply it with the value of s.We take an empty string and add the product at its last position.We delete the two numbers that we multiplied, 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?
 

FAQ: Is this a possible Turing machine for computing $f_2$?

What is a Turing machine?

A Turing machine is a mathematical model of a hypothetical computing device that can manipulate symbols on a tape according to a set of rules. It was proposed by Alan Turing in the 1930s as a way to formalize the notion of an algorithm.

How does a Turing machine work?

A Turing machine has a tape divided into cells, each of which can hold a symbol. It also has a read/write head that can move along the tape and read or write symbols. The machine follows a set of rules, called a transition function, to determine what action to take based on the current symbol on the tape and its internal state. It can perform basic operations such as reading and writing symbols, moving the head, and changing its state.

What is the importance of Turing machines in computer science?

Turing machines are important in computer science because they provide a theoretical foundation for understanding computation and algorithms. They are used to prove theorems about computability and complexity, and serve as a basis for the design of real-world computers and programming languages. The Turing machine model is considered to be equivalent to all other models of computation, meaning that any problem that can be solved by a computer can also be solved by a Turing machine.

How is a Turing machine different from a computer?

While a Turing machine and a computer both have the ability to perform computations, there are some key differences between the two. Turing machines have an infinite tape and operate on symbols, while computers have finite memory and operate on bits. Turing machines also have a single read/write head, while computers often have multiple processors or cores. Additionally, computers have a fixed instruction set, while Turing machines have a variable transition function that can be changed or modified.

Can every problem be solved by a Turing machine?

Turing machines can solve any problem that can be solved by an algorithm. However, there are some problems that cannot be solved by any algorithm, such as the halting problem. This means that there are some problems that cannot be solved by a Turing machine, and therefore cannot be solved by a computer. These types of problems are known as undecidable.

Similar threads

Replies
14
Views
2K
Replies
1
Views
1K
Replies
2
Views
1K
Replies
1
Views
2K
Replies
25
Views
4K
Replies
2
Views
1K
Back
Top