Originally published on 2008
In fact, most of the content below is the same for all learning. Only recently in the Zheng-er-meridian Geoscience algorithm, the latter is not a good bite of the bone, so the usual thinking summed up naturally than other things to learn more.
Question: Almost all algorithmic books are explained in Euclidean, waterfall, top-down, and every deduction step is the direct target of precision guidance. From the cause to the fruit, definition, lemma, theorem, proof as many, neat and tidy a bit of no fat meat. In fact, this completely turns the human brain into the process of inventing inventions. It looks like a sunlit path, actually the car is not a horse.
For the reader, this is tantamount to telling you the answer & practice , and then letting you verify that the answer & approach is feasible & established. And how the answer & approach came about, from the question to the answer between the thinking process. But few books can be interpreted well. My limited reading (algorithmic) book experience, in addition to Polya's "How to solve the problem" is also qualified (not the most ideal), other (including the famous "Introduction to the algorithm", "How to Solve: modern heuristic Method", "Algorithms", "Programming Zhu Ji Nanxiong", even taocp-- It is fair to say that because Gaoro is very transparent about the history of the algorithm domain, many places can tell a question from the original context, such as an impressive explanation of the tree-to-heap, a few pages of the nature of the data structure, and a few famous books like the one just listed. In the narrative of thinking is not qualified (of course, not that these books are worthless, as informative reference books, they will be the knowledge of the system structure, greatly facilitated the mastery of knowledge, as "What is Mathematics" work), why I say so, Because I found that often need to find an explanation of an algorithm, open these books, always directly see the description of the algorithm logic, but do not see the whole idea of the process behind the birth of the algorithm.
What we want is not relativity, but the brain that is the birth of relativity. What we want is not the golden egg, but the chicken with the golden egg.
Update (2008-7-24): received a lot of criticism from the students, to think that the beginning of the tone of some works is too heavy. In fact, note that I do not deny the value of these works, I am also reading them to learn the algorithm, and have a lot of gains . This article is more than a suggestion to do in addition to reading these works . In addition, the criticism of this kind of knowledge (Euclid) in the West (especially in the field of mathematics) has long been, as far back as Euler and Poincaré, they both placed great emphasis on the teaching of thinking, Euler believes that if you can not teach thinking, mathematics teaching is meaningless. And Poincaré himself is a great interest in mathematical thinking and research ( I was in the discussion group also reproduced a Poincaré of the famous speech, that is, see here ). I'm just saying that the current algorithm book does not do the level of thinking to tell, so suggest reading these books should look for the original source of the algorithm, should be inquisitive, do some homework, know how the algorithm is born, and I explain why should know why, what benefits (see below), I also gave some examples such as the red and black tree author, who spoke the red and black trees, g9 the suffix tree, and Knuth the heap. Alas, in fact, quite orthodox views, to give people to fish, regardless of the east and West have similar old proverbs. And I just added a little explanation from the perspective of cognitive science, which windstorm called "Explanatory text." Only. Unfortunately, the tone of the beginning of the blow, forget, both hair and will not change.
There is a reason why this is so.
We have two forms of thinking in the process of thinking about a problem:
- Lenovo : This kind of thinking can be said to some extent as "chaotic" (albeit from a more fundamental level), the so-called chaos refers to a lot of times is not sure whether the idea of the eventual feasibility, these associations may only be based on a word in the topic, Grammatical structure, a slice of the problem, some scattered information. The process is tentative. In the end, a large part of it may prove unworkable. Most of the time we use this kind of thinking to solve problems, in short, we first enumerate all the things you have learned about the problem and then put it all on the back to see if you can solve the problem at hand. This way of thinking is limited by the limitations of the human brain's associative ability itself. I mentioned a few examples in "solving problems with Polya". Lenovo itself needs the clues of memory extraction, so the constraints of the memory extraction clues, if the clues are insufficient, then how can not be associative. and the establishment of the extraction clues depends on the original memory of the processing method ("Look for the Lost self" in the elaboration), at the same time, in the face of a problem, you can extract from the association clues and depending on your understanding of the problem layer/abstract depth, shallow clues are likely to be irrelevant, leading to invalid association & Trial and Error ("Psychology of Problem Solving"). In short, Lenovo's process is fraught with false possibilities.
- deductive & Induction : Deduction & Induction is another form of thinking. They are far more based than Lenovo. Where deduction is strict and inevitable. Induction is also a certain basis. In the face of a problem, we consciously or unconsciously to the problem of the various conditions of interpretation; For example, Sherlock Holmes's famous "dog called" reasoning-dog + stranger and Bark & last night the dog did not call "=" The person is an acquaintance. is a typical deductive reasoning process for the various conditions of the problem. There is also a number of special forms of observation to the induction, trying to summarize the law of the problem. Unfortunately, however, in the face of complex problems, deductive & inductive does not always "go straight" to the solution of the problem. After all, people's thinking can only see a limited number of logical conclusions, a logical deductive path is straight to the answer, not to the end is often not known, as long as the answer has not appeared, our brains of the logical deduction of the end of the tree is always hidden in the dark. And when the final answer comes, we will find that many of the branches of this deductive tree do not actually lead to the answer. Therefore, although deduction & induction is a kind of "inevitable" reasoning, but does not "necessarily" lead to the conclusion of the problem, it is also trial and error, but more reliable than Lenovo.
Now that we realize that the two main ways of thinking about solving a problem are actually a lot of trial and error ("Exploring"), it is not difficult to realize that the process of thinking about a problem is actually quite intricate and full of invalid branches - In the process of thinking we will continue to evaluate the branch and do appropriate pruning-so when we find the solution to the problem, the long and complicated process of thinking has faded in the brain almost , only those who lead to the final conclusion of the process will be added "highlighting"- In the process of thinking we will constantly abandon the invalid ideas, leaving only the most promising ideas. In short, some of the ideas that proved useless in the end or that we had not hoped for earlier were thrown away from working memory. Secondly, the process of thinking is our air and water, and "fish is the last to feel the water", we do not feel the existence of the law of thought itself, we just unconsciously use it. Sunline, because our goal is the solution of the problem, the solution is the thing that we are excited and ecstatic about, not the process of solving, the process is only the process , the purpose is the goal.
It is like a treasure-seeker who, after a long and tortuous quest for treasure, will be ecstatic about the treasure when he finds it (remember Archimedes's "Found!"). "?" And can't wait to show it, and the long thinking itself is a footnote. We are purposeful animals, the purpose is achieved, the other is relatively less important. Finally, for those who impart knowledge, perhaps there are four: it is irrelevant to introduce the thinking process, after all, the thinking process is not the solution of the algorithm problem, the solution of the algorithm problem is the solution of the algorithm problem. Unfortunately, ignoring the process of reaching the solution has actually turned into a trifles. What we see is a few lines of ingenious algorithms, and then to the back of the sigh of the thought can not come out AH. Why not think about it, because you do not know that the short number of lines behind the algorithm is how long the process of thinking, if the problem solver is a detective novel, then the algorithm is only the end, and the thinking process is the plot .
That being the case, it is no wonder that the algorithm cows through the ages, but not a few can really in the time to restore their own thinking process (the "fishing" word), hands-on teaching students to go through the idea of reasoning, you can let students get the training of thinking process. Jin Takeo in the "like layman's thinking, like experts in practice," said the paper should be written like a detective novel , I agree. Euclid's Introduction, in addition to providing dull knowledge, does not provide anything to help people gain knowledge-thinking (the criticism of the Euclidean notation of mathematical books has long been a long-standing one, and several other teaching methods have been called for). in this respect, some of the "biblical" books that we respect are not as good as detective stories in preaching, while the former are a lot of knowledge, while the latter is the process of acquiring knowledge--inference & Association.
However, we are all human beings, people should have a form of thinking, we do not have it. So what is the thinking itself that needs to be taught over and over again?
Not so.
There are several extremely important values for telling the thinking process rather than the outcome:
- implicit : The law of Thought is also knowledge (but it is meta-knowledge-it is the knowledge that helps us acquire new knowledge); It is implicit memory. We are not aware of the role of the law of thought in the process of thinking, but they are actually behind the scenes of our thinking trajectory. To be implicit in the way of thinking, you need to practice constantly, just as you need to practice constantly to be able to ride a bike in an unconscious state.
- cross-Situation application : the principle of thinking is also the knowledge memory, is the problem-solving strategy. Since it is a memory, it is constrained by the extraction of clues, which is why when Polya told you to "pay attention to the unknown" after you still can not really in all need you "attention unknown" place to remind yourself "attention unknown". Many times the unknown is very covert, the unknown is not always on the top of a hat said "I am unknown." So there is often a lack of "reminders" for this strategy, which is why you have learned to " pay attention to the unknown" when solving mathematical problems , but not necessarily in solving real-life problems . (Is your light on?) This is the value of the whole book, because it's not the same as solving problems in your life, and different environmental cues that inspire memory in your brain. Even in problem solving, the subtle differences between different problems can lead to a big difference in thinking, and sometimes your attention is drawn away by a Lenovo that does not inspire you, forgetting important rules such as "pay attention to your unknowns." And a book from the perspective of the problem solver can be over and over again put you in different problem scenarios and then remind you of the time to remind you, let you wake up to " Oh, this time should also think of this Ah. "To do this kind of thinking exercises you will gradually learn from a certain commonality, and some of the habits of thinking to be strengthened, and finally can be used in a strategy when the time can be remembered."
- More memory extraction threads for problem Solutions : We usually learn the algorithm almost only to "understand", others put a solution in front of you, you go to verify, the heart said, "Oh, yes, this really can work." And then it's gone. A little bit simpler algorithm Fortunately, the complexity of the memory of the burden is very large, which is why sometimes we see a wonderful solution, the solution does not seem to know where to come from, but after our understanding, but found to be right, we sigh, really ingenious, results some days later, others ask this question, We said, " Alas, what an ingenious algorithm ah, but I only remember it ingenious, but do not remember how it is." "Why?" Because the algorithm is just a bunch of discrete mechanical steps, without the support of the thought behind it, there is no essential-level association between these steps (as the prophet Aristotle has long pointed out: learning is joining). So it's not much different from the history book. However, knows how the algorithm is deduced step by step, and we have a lot of memory extraction clues: the memory of any key step in the algorithm discovery process (especially the essence) may enable us to deduce the remainder of the content ourselves . For example you know how the heap is evolved from a simple decision tree, and it's about solving problems that you can deduce yourself even if you forget the specifics. For example you know that the essence of the KMP algorithm is to eliminate backtracking, and how to eliminate backtracking is not so difficult to deduce, so even if you forget it can be reproduced with the help of the logical deductive ability of the brain. For example you know that the Tarjan algorithm is actually only two optimizations from the post-order traversal (in which the use of the survey set is only an optimization--to be able to quickly determine who the ancestor node is-not the algorithm nature-of course, The main task of algorithm design is to "eliminate redundant computation" and "avoid unnecessary calculation" by the knowledge contained in the problem condition, so you can also say that the use of the survey set is of the essence, but, knowing why we need to introduce and survey the set, will feel strongly that everything is logical. The name of the algorithm is not so difficult to understand and memory. For example you know the nature of the sort, you can have a deep understanding of what is the optimal sort and why it is the optimal sort. Four or two.
- contains much more knowledge : Remember an algorithm, there is only one algorithm . A radish a pit. It's like a back . The multiplication table only solves the multiplication problem . And the thought behind it helps to solve a kind of problem . The abstract level of thought is often lower than the algorithm itself that realizes the detail, the lower the abstraction level, the more the essence, the more extensive coverage. The development of mathematics itself embodies this process, and abstract algebra is a very good example. The idea of the birth of the algorithm often contains much more essential knowledge than the actual algorithm, the actual algorithm and even the implementation of a particular language of the algorithm contains too many surfaces of irrelevant knowledge, they will hinder the understanding of the essence.
- The analysis of reasoning, not association : After learning a lot of algorithms and data structures, a side effect is that after seeing a problem, the brain immediately regardless of the 3,721 out of a bunch of potentially coherent data structures and algorithms. Lenovo is a powerful way of thinking, at any time will seize the brain's working memory, you can not control-for example, I asked you "How to find the maximum interval," the first to enter your consciousness is the learning algorithm, and even the implementation of the algorithm has jumped out of the details, Perhaps the first to jump out of the algorithm implementation of one of the most easily mistaken boundary details, or some of the more tricky implementation skills! However, these do not really reflect the nature of an algorithm, and the result is to always stay on the surface of the problem. On the other hand, the re-teaching of thinking can make people develop from the nature of the problem, gradually analyze the habit of reasoning, rather than direct mechanically. of course, it is absolutely undeniable that Lenovo itself is an extremely important way of thinking, even the most important of human thinking feature . Many times we do not know what the nature of the problem, we need to rely on association, analogy to lead the exploration. However, it is absolutely advantageous to develop a good habit that takes precedence from the nature of the problem and examines it.
So what kind of a person to be a fish? Polya's "How to solve the problem" is definitely a book, his "Discovery of mathematics" is also worth a look. Specific to the algorithm book, that is not the light to see text books is enough, in order to understand the context of an algorithm, from an algorithm to comprehend as deep as possible things, you need to do three things:
- find the original source of the algorithm : TAOCP as a database is absolutely excellent, the basic algorithm as long as you can think of, almost can find the original source. After checking the original source (such as a paper), you can go to the Internet search to see. Because the original author is often the most familiar with the birth process of a program. For example, the red-black tree in the classic data structure is one of the puzzling structures, but its author Sedgewick a PPT, which gives you a good introduction, and is more than a few times stronger than the theory of arithmetic.
- in fact, the original source is not necessarily the same as you speak so in place : said before, the algorithm design comes out after people almost do not review the whole process of thinking details, only the target of those things written out. The result is a Euclid-style article. So you get lost in a lot of "definition", "lemma", "theorem". This article seems to be well-organized, in fact, the whole process of the invention is reversed, I have always thought that if the author can write the whole process of thinking, even if the text more than 10 times times, I will definitely than see that a bunch of definitions of the theorem to understand much easier. What do you say, anyway? You can go to the Internet to find, cattle people may not be more than the classic textbook on the difference. If you can't find a good introduction, you can only figure it out for yourself. the importance of figuring out how to say is not too much. Some of the guiding questions to figure out are: why this (why is it good)? Why not? (Is there any other way?) Is there a better way to do it? )? Is this the best thing to do? Why Can you prove it? Does this approach have an essential connection with any other practice? What's the difference between this and this? What is the nature of the problem ? What is the nature of this practice ? What is essentially what has led to this practice so ...? Are there any other questions that are similar to this question? (Does the same or similar practice apply?) And so on
- not only to learn the ideas of others, to organize their own ideas is also extremely important : see "With Polya learn problem solving" of "4." A good habit "and" 7. Summary of the meaning ".
http://kb.cnblogs.com/page/549631/
Know why (take algorithmic learning as an example)