[CT] Turing Machine

Source: Internet
Author: User
Tags abstract definition

Http://blog.csdn.net/pongba/article/details/621723

 

Turing machine is a theoretical device designed by Turing to study computational problems. You only need to think about the concept of a finite state machine, but the memory of the Turing Machine (paper tape) is infinite (that is, it can be any longer, "Infinite" is the ancient saying ). The image defined by the Turing machine is like an old-fashioned electronic transmitter: A Reading and Writing head, a tape (which may be any longer), reading and writing heads constantly read the symbols on the tape, the current status is converted according to the internal status conversion rules, and some actions are performed at the same time, such as inserting or rewriting the current character, moving the Read and Write headers forward/backward, or keeping them unchanged. The abstract definition is almost the definition of the finite state machine.

This definition of the Turing machine seems to be clear now, but it represents an ideological revolution, a kind of from scratch. The Turing Machine essentially abstracts the core laws of our mechanical computation, so it is equivalent to the mechanical computation performed by "one person + paper and pen + certain rules.

Such a theoretical machine first specifies the possibility of creating a computer. However, this is not enough. If you create a specific Turing Machine for a certain problem, the efficiency will be too low. The most wonderful conclusion of the Turing machine theory is that"Yuan Turing Machine(The Universal Turing-machine should be a general Turing machine or a general Turing Machine. However, the "Yuan Turing Machine" expresses its meaning more accurately ), in fact, the meta-graph machine uses the graph machine as the computing object. Suppose there is a meta-graph machine m, a graph machine P, and P input data d, then (p, d) feed the metachinpu m, and then M can spit out P (D) (that is, the result of P on D ). This is the original model of the computer we are currently using. m is like our computer (metachine), and P is a program (encoded Turing machine ), D is the input data of program p. The existence of the metachine indicates that we can use a single machine to solve all the Turing-computable problems-as long as we feed it the Turing-computable code (Program) that solves the specific problem) as well as the input data of the problem, the metachinpu will simulate the action of the Turing Machine P we fed it, and finally give the result.The existence of the metachinator ignited the birth of a computer.This is the most beautiful discovery in Turing machine theory.

There are two well-known Tuling machines, halting problem and busy beaver problem. However, the former is more famous, but it is not interesting, so I will not talk about it here. You can Google it. These two problems indicate that the Turing machine is not "omnipotent". It can only solve the problem that can be solved mechanically. However, this definition of "mechanically" is too vague and not accurately defined, therefore, it is necessary to precisely define the problems that a spirit machine can solve, in other words, what problems are Turing's Computability.

Here is a very beautiful proof aboutWhich numbers can be computed by Turing?. We say that there are infinite real numbers which are not computable by Turing. First, let's explain what the concept of a number is turing Computability. A number is turing Computability, that is, there is a Turing machine, and an empty tape is provided for it, in the end, it can print the result of the approximate number. Like Pi, natural constant E, and the root of all polynomials are turing Computability (which can be any approximation by mechanical steps), which is well understood, because we can write a program to iterate over them, E is an infinite number of sums. But what about other real numbers? Is there a real number that Turing cannot calculate? To understand this problem, we must first consider the total number of Turing machines (nonsense, of course, there are more than one, but there is also a level problem with "infinite :)), therefore, the Turing machine is first encoded. Because the status of the Turing machine is limited, the Turing machine is encoded into a quintuple (old_state, symbol, new_state, new_symbol, move) the sequence (or more/less are possible, this is a more common encoding method, but in short it must be N-TUPLE, N limited ), so let's consider the total number of possibilities for a n-State (n States) and a m-symbol Turing Machine. Therefore, first, consider the number of 5-tuple corresponding to n-state and M-symbol (as defined above). According to the simple arrangement and combination rules, A total of N * m * n * m * 3 (the last 3 refers to the possibility of moving-static/forward/backward), in other words, it is m, N is a upper-bounded function of the parameter. Okay. Now we want to consider the encoding format of a Turing machine. A Turing machine is actually composed of a set of 5-tuple. So since N-state, the 5-tuple of M-symbol has n * m * 3. In other words, A total of N * m * n * m * 3 elements in this set composed of all possible 5-tuple elements. The number of all sub-sets in this set is n-state, the number of all Turing machines in M-symbol. According to the definition of the idempotent set, this is 2n * m * n * m. Here for the sake of simplicity, we temporarily fixed m for M0, that is, the number of symbol, so the number of all the M0-state is:

21 * M0 * 1 * M0 * 3 + 22 * M0 * 2 * M0 * 3 + 23 * M0 * 3 * M0 * 3 +... =.

Now we can see that every item in this formula is countable, while Z + × Z + is still a column set. Let alone that each item is limited here, so it's easy to create an injective with Z +, in other words, a set of all the M0-state's Turing machines is a column-able set. Well, now let's replace M0 with a variable. Since the graph set of all M0-state is columnable, while m0 is a natural number (column set ), in addition, "a column set can be a column set" is still a column set, so it is easy to come to the conclusion that a set composed of all Turing machines is a column set.

In fact, it turns out that there is a simpler but more clever way to prove the columnability of a set composed of all Turing machines: We know that computer languages are equivalent to Turing, therefore, the discussion of "all Turing machines" is actually equivalent to the discussion of "all computer programs". On the binary level, a computer program can be seen as a sequence of 0 and 1. Based on this representation, the trend of "all computer programs" becoming a collection is coming soon, because "all computer programs" = "all computer programs with a length of 1" + "all computer programs with a length of 2" + "all computer programs with a length of 3" + .... The set of "all computer programs with the length of I" is recorded as Si, and the set of "all computer programs" is recorded as S, which immediately includes:; and. We remember that the J-th element in Si is SI (J), so it is easy to establish the injective function (single shot) between S and Z +. Only F: si (j)-> 2i3j; obviously, F is injective. This proves the column properties of S.

So what is the significance of this conclusion? It is very important. We know that a real number set is not columns, and its potential (or "base") is alefus 1 (while Z, that is, the Integer Set is alefe 0 ), so even if all the Turing machines are used up, there will still be real numbers that are "not listed. To strictly prove this, it is also very easy to use. As long as cantor is used to prove the set theory, it is a simple description:

First, since the set of all Turing machines is a column set, we can use M0, M1, M2 ,... To indicate them. Assume that the real number that Mi can calculate is ai0.ai1ai2ai3 .... Then we construct a new real number B = b0.b1b2b3... so that it can satisfy b1 =a11, B2 =a22, B3 =a33 ,..., BN = Ann. In this way, the constructed real number B can ensure that it is not equal to any AI, and this B is not calculated by any Turing Machine (because the AI sequence has exhausted all the Turing machines ). To some extent, this indicates that the trend of the Turing machine is alivv 0 (although it cannot be called a "trend ").

In addition, all functions in the function space are not Turing Computability. A Turing Computability function actually means that a Turing machine can simulate the function's behavior. This conclusion is well explained through the proof just now: because the function space is alive 2, which is larger than the real number set, how can it be enumerated by the Turing Machine? It's easy to prove. It's also a diagonal line method.

So, as we have already affirmed in principle that some functions cannot be computed, in other words, although you know that some functions are functions, you simply cannot simulate them using a Turing machine, in today's words, it cannot be programmed! This is frustrating because there are functions that cannot be programmed. So can we create such a function to make people look at how it cannot be implemented by programming? This is the so-called busy beaver problem. The busy beaver problem is to construct such a function, which is used to calculate the maximum productivity of any n-state Turing Machine. The definition of productivity is to give a Turing machine an empty tape, in the end, when the Turing Machine halt is used, the number of 1 on the tape is its productivity. The maximum productivity of all N-state Turing machines refers to the producers of all N-state Turing machines. Obviously, this is an n function. As l (n ). So the question is, is this L (n) that Turing can calculate? The answer is no! Using the reverse verification method: Assume that there is such a Turing Machine B that can imitate L (n) behavior, then we connect it to the back of a special N-state Turing machine I (I is used to leave n 1 on the tape as the input of B, it can be proved that, in this way, a new Turing Machine IB is formed. The role of this new Turing machine is to calculate L (n), where N is the number of I states, it is also the output of I, and the input of B. Then we connect B to the backend to obtain an Ibb Turing machine with the effect of L (n )). Now, we consider the number of Ibb states, which is the number of I states (n) + 2 times the number of B states. Assume that the number of B states is B (B is finite ), then the number of Ibb states is n + 2B, so we can imagine that the maximum productivity of the graph machines in the N + 2B state must be greater than or equal to L (n, because there is already a Turing machine whose productivity is L (n), it is Ibb. This inequality is L (n + 2B)> = L (n), so we can introduce N + 2B> = L (n) (L (I)> = L (j) => I> = J. This conclusion is easily proved. Based on N's arbitrariness, we can make it equal to N + 11, so we get n + 11 + 2B> = L (n + 11 ), we know that the 11th status can be used to create a Turing machine that doubles the number of 1 on the tape (try it), so l (n + 11)> = 2n ), then we get n + 11 + 2B> = 2n, so we get 11 + 2B> = n. According to the arbitrariness of N and the limitation of B, this is a contradiction! (In fact, there is another implication here, that is, to implement such a Turing machine, there must be an infinite number of States, that is, B must be any large, and according to the definition of the Turing machine, B is limited ).

Speaking of this, there is also a classic function that Turing cannot calculate. As mentioned above, all the real numbers that can be computed by Turing constitute a set of columns, it is recorded as S = {S | S as Turing's Computability} (this is because all the Turing Machines make up a set of columns). Now we construct such a function f, so that F (J, i) = SJ (I); SJ is the J-based element in S, and SJ (I) is the I-bit value of Sj. We assert that such an F is not computable by Turing. To prove this, we assume that there is a Turing Machine p that satisfies P (J, I) = SJ (I ). The diagonal line method is used to construct a new real number r that does not belong to the set S. The R satisfies the following conditions:

We found that, as long as P exists, R is also the result of Turing's computation, which is in conflict with R's non-S. Therefore, the conclusion "P does not exist" is introduced. (Note: As long as P exists in R, it is also Turing Computability? In this way, we construct a new Turing Machine Q to meet the following requirements:

If a new Turing Machine Q is fed with a subscript I, it will spit out the I-bits of R, so r becomes a Turing computation.

The general idea of the church-Turing thesis is that in all functions that take the natural number as the defined domain, only the recursive functions (here the recursive functions also include the limited-Step Functions) are Turing's Computability. This conclusion defines the computing power of the Turing machine. It is very important. In fact, it is intuitive to think about it. An infinitely endless function naturally requires an infinite number of States for computing. However, the status of a Turing machine is limited. In this finite space, the conversion is definitely in a loop. This is like division of two integers, or division, or infinite round decimal places, the concept of a pigeon cage can be easily proved.

Let's briefly describe the Turing completeness (Turing-complete) of C ++ template, which is more accurate to Turing-equivalent, because Turing-complete generally refers to Turing-computable ). To prove the Turing completeness of a language, in principle, is to prove that it can solve all the problems that Turing can calculate. Or construct a conversion path that converts any solution to the Turing computing problem into a program in this language. But here is a more clever way to implement a universal Turing machine using this language (in fact, it is almost a finite state machine ). C ++ template can do this. In fact, this has already been done. In addition, as long as a language has an if judgment, recursive or cyclic structure, the most basic assignment ability and four arithmetic operations are completely Turing, and C ++ template happens to have these functions, the IF judgment and recursive structure are implemented by the template's special ability. The estimation Language designers did not expect this to have such a big impact on modern c ++ at the beginning :)

In addition, strictly speaking, no computer is actually Turing-equivalent, because their memory is poor. However, the memory of the Turing machine is infinite. But as long as the memory is not used up, it will all be the same :)

The constructive mathematics and intuitive logic mentioned above do not belong to the Turing Machine. If you have time, try again.

P.s Turing Machine reveals the deep Mechanism of Human mechanical calculus. geder's well-known Incompleteness Theorem is equivalent to the shutdown problem of Turing machine. In plain words, it is actually "there is no omnipotent God". Here, God is actually a metaphor for the system of justice under the limitations of the graphic computing model. However, this is another story. Please try again later :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.