Interesting algorithm world --- Appendix (1)
I have read many netizens' comments; thank you, make me get Yichen shallow. Growing up in everyone's help, it is a happy thing. But because the previous declaration, some problems do not dare to explain. In addition, for netizens I also talk about my opinion.
Persistence on algorithms
This problem is unavoidable. I have a responsibility to tell you what I originally thought.
First of all, in the last school, I've been thinking about whether the teacher (Professor Kang Li Mountain, Teacher, Wu Da, the Director of Hiring the Director of the Department), whether the algorithm can be implemented. Of course, before this, I The education is that the nature of the algorithm is poor. The teacher of the two data structures specially spees the difference between the algorithm and procedures (remember that the class is a point J), I think the undergraduate education is as of this.
Since the teacher likes this, I want to trace it. Why can you, or, why can't you? I have diagnosed many books, and I have all the books are different. We choose the representative.
First, the data structure (C description) of Tsinghua Yin Kun. His algorithm defines five characteristics:
(1) Enter. There must be 0 or more inputs.
(2) Output. One or more outputs.
(3) Determination. Each step should be determined, there is no dismissal.
(4) Poorness. No matter what circumstances, it should be ended after the implementation is.
(5) Validity.
I am a short transcript. Hone other words, regardless of the teacher's data structure, this algorithm is really very feet. This deterministic itself is difficult to understand (what is the algorithm to define? You It is difficult to say that the determinism is satisfied?). And the definition of poorness is the actual implementation of the machine, or the algorithm expressing the language of the language?
In addition, he believes that the operating system is not an algorithm because it is not worthless (4).
Another textbook is the electronic industrial publishing house Clifford A. Shaffer, the << Data Structure and Algorithm Analysis of Zhang Ming is >>, the nature of the algorithm is related to "poor":
(2) Details. Each step must be completed within a limited time.
(4)
(4) (4) Finite. An algorithm must be composed of finite steps, otherwise, "We can't write it, and it is impossible to implement it as a computer program."
(6) (6) Terminal. The algorithm must be terminated, that is, you can't enter the dead cycle.
One concept definition, I think there is two factors, one is in line with intuitive concepts, the second is to facilitate research. Some people say there is a historical issue. In fact, the concept should not be limited to history. If the new situation is allowed, it can break through.
Compared with the two definitions, we don't really find the details of the latter. In fact, I am in << What is the algorithm definition in the algorithm >>, and the source is introduced to the "intelligent calculation of the Kangli Mountain" and its application. Definition:
Algorithm, the method of solving the problem step by step, it has the following characteristics:
(1) It is necessary to represent a limited text;
(2) Every step must be mechanically completed in a limited time.
I like this definition. I still go back to the piercing problem, and then look at the discussion of netizens, mainly divided into:
HAPPYCOCK, Javaboy: Algorithm is different from the program.
VioletBlue: Endless execution will be useless.
As for Dream_soft, it is indeed highly, let me have the most gains, then I will say later. First, the algorithm should be used to solve the problem. Of course, the means is calculated. In addition, we recognize the algorithm Every step must be completed in a limited time. Even if you start from intuitive concept, you will be in the end of the infinite execution, then we will doubt what the so-called "algorithm" is to solve. This "is poor" Sex ", it can be called micro. Our debate is that from macro, can algorithms do not execute?
In the textbook, "Personality" is the "poor step" described, otherwise it will become a problem. This is a taste of a little language and form language. The description of the algorithm, not the algorithm itself. I also agree that I like the definition saying that the algorithm "must be a limited text representation", but this is also the meaning of the algorithm, the algorithm cannot be executed.
Is the endless execution? I don't have this concept in my intuition. When I say Hilbert questions, I have said that the intuition of mathematicians must be in the end of the time, I think it is because he wants to solve the problem (no Whether the equation has an integer solution), it is either, either unprinted, of course, we hope to have an answer as soon as possible. But in the actual problem, many do not rely on "solution" to solve the problem, such as the automatic window, then It is a control of the activity. We don't need to solve it, but the control of this is always doing it. The teacher said the watch, I think it is also this. Of course, the teaching of translation has added one, (6) can be terminated. Sex. But he seems to avoid death cycles, I want to die cycle should also be useful for standard, oh, too powerful? Hey, that algorithm should add a stop condition, but plus stop conditions It is not an endless execution.
Still say that netizens Dream_soft's views, the source is as follows:
"First, the algorithm should be poor, I think this is because the algorithm should be targeted. Everyone knows whether a calculated discriminant criterion is downtown, if it is not stopped, that is, the algorithm is forever If you are not stopped, then it belongs to an uncharacted problem. Because the troubleshooting problem is not calculated, that is, we have no universal algorithm to judge whether a map spirit is downtown. If the algorithm can be infinite Then, it can be said that there is an algorithm for the problem of charting machine, which means that the problem of shutdown is solved, which is not in charge with mathematics. "
Obviously this is a J. First of all, this reason is the most essential, but also the problem of deterministic, and can be calculated. We know that the map spirit can be divided into recognition. Grounds and determinants. The former can solve all the problems of all chatricular recognition, but the graphic recognition is not necessarily determining. For example, the problem is a typical non-judgment problem.
We will raise a problem that is unknovable, and the limited time in the Hilbert issue determines whether the unmete the unmect solution. It has been proven to be unknovable. But such as the following map forever M (the strap is unlimited, the initial value It is all integers, and the order from left to right is the order of the axis) is a solution:
M = "for a given indefinite equation, do
(1) Starting from integer 0, verify that 0 is the solution of an unqualified equation, if yes, turn (4); otherwise
(2) Move a position to the right, assume that n, verify that N is the solution of the unique equation, if yes, turn (4); otherwise move to -N verification, if it is the solution of the equation, turn (4); otherwise
(3) Move to N, turn (2);
(4) Output results, stop. "
Obviously there is an unclear equation that has an integer solution, this figure spirit can find a solution to stop, but if the equation itself has no integer solution, this picture spirit is not stopped.
Can we call it algorithm? I also thought about it for a long time. At the beginning, my idea is that this figure spirit is related to the problem. Some equations are downtime. Some is not. The reason for the before, no Reasons must define algorithms. Of course, from the deterministic departure, the calculation of the formation is the solution to solve problems in poor time, but also acceptable, but a large part of the solution, including those The problem itself is not explained, it is excluded.
Recently, you have comparable. When you talk about the limit of the number, you will first converge to a poored value, the limit is the value of the number, which is listed as a convergence number. But the number of divergence has the limit? • When a class of special divergence numbers are mentioned later, supplementation defines ∞ (infinity), and define the number of extremums. This reality set R must also be expanded, and -∞ and ∞ joined.
Is there a limit of divergence number? Can you negate your intuitive concept? Can you use useless to negate? In fact, you can't negate it. This definition is conducive to the discussion of the problem; just, when needed, we can express it, it is poor limit.
So I like Kang teacher's definition, clean, with inclusive, but not omissive. When studying calculated and calculated complexity, we emphasize the best possible algorithm to be as fast as possible, do not stop. But the broad algorithm makes it a way to solve the problem. As long as you meet our << What is the definition in the algorithm >>.
This is my original point of view. About that operating system is not an algorithm, I have always thought it was to prevent the "flourishing rule". Although the algorithm is one of the nature of computer science, if the operating system, its processor scheduling has an algorithm, Memory management has an algorithm, but the overall stack is not an algorithm. It exceeds the definition of our algorithm, and it is really too inconvenient to study the algorithm.
What needs to be explained is that this is a personal point of view, you can think about it but don't think it is. If you have good objections and evidence, you can also contact me by the letter box:
Percy Lee @ 恶 有 .com or non-leaf@sohu.com