Эдуард Ильченко попросил меня выложить перевод книги на английский.
_____________________________ __________
Vladimir Parondzhanov
Best way to create
COMPREHENSIBLE ALGORITHMS
Friendly algorithmic language DRAKON guarantees amazing clarity of algorithmsBURAN spacecraft language DRAKON
provides easy and simple approach
to algorithms development
CONTENTSIntroduction………………………………………………………..
Part 1. Algorithms (Pleasant examples for a first acquaintance)
Chapter 1. Algorithms – it’s very simple!
Chapter 2. Algorithms and procedural knowledge
Part 2. Algorithmic language DRAKON and convenient
drawings of algorithms (drakon-charts)
Chapter 3. DRAKON icons and macroicons
Chapter 4. Algorithmic structure “silhouette”
Chapter 5. Algorithmic structure “primitive”
Chapter 6. Let’s compare silhouette and primitive
Chapter 7. How to improve the comprehensibility
of the algorithms
Chapter 8. Simple cyclic algorithms
Chapter 9. Properties of cyclic algorithms
Chapter 10. Complex cyclic algorithms. Algorithmic
structure “cycle within a cycle”
Chapter 11. Logical formulas used in algorithms.
Chapter 12. What is ergonomic text?
Chapter 13. Real time algorithms
Chapter 14. Parallel algorithms
Chapter 15. Drakon-charts and flowcharts
Chapter 16. Briefly about programming
Part 3. Algorithms used in practical life (examples)
Chapter 17. Algorithms in medicine
Chapter 18. Algorithms in industry
Chapter 19. Algorithms in trade
Chapter 20. Bookkeeping algorithms
Chapter 21. Algorithms in nuclear energetics
Chapter 22. Algorithms in biology
Chapter 23. Algorithms in agriculture
Chapter 24. Algorithms in middle school
Chapter 25. State and municipal management algorithms
Part 4. Mathematical algorithms (examples)
Chapter 26. Simple mathematical algorithms
Chapter 27. Algorithms with arrays
Chapter 28. Data search algorithms
Chapter 29. Recursive algorithms
Part 5. Conclusive recommendations on creating
drakon-charts
Chapter 30. Recommendations on using the algorithmic
structures “silhouette” and “primitive”
Chapter 31. How to improve the comprehensibility
of the trees
Part 6. Constructor of algorithms and formal description
of DRAKON language
Chapter 32. Constructor of algorithms (computer-aided
design of algorithms)
Chapter 33. Graphic syntax of the DRAKON language
Part 7. Theoretical basis of the DRAKON language
Chapter 34. Calculus of icons
Chapter 35. Ashcroft-Manna method and
the algorithmic structure “silhouette”
Chapter 36. Visual structural approach to algorithms
and programs (the skewer-method)
Part 8. What roles do algorithms play in human culture?
Chapter 37. Algorithmic thinking
Chapter 38. Algorithms and improvement of the work
of your mind
Chapter 39. Algorithmic thinking and two groups of people
Chapter 40. How to eliminate algorithmic illiteracy
Chapter 41. Necessity of cultural changes
Algorithms must be comprehensible (instead of conclusion)
Basic bibliography about the DRAKON language (in Russian)
Index
INTRODUCTIONWHAT DO WE KNOW ABOUT ALGORITHMS?
Many people think that only programmers and mathematicians need algorithms. However, that’s not true. Algorithms can be of use to all or almost all people from doctors and agronomists to chief executive officers.
Why? Because we live in a world of algorithms without even knowing it. Modern civilization is a civilization of algorithms. They surround us everywhere.
Unfortunately, the majority of people cannot read, write and understand algorithms. Luckily, this can be corrected. By reading this book, you will receive the necessary knowledge. For the readers’ convenience, there are plenty of attractive algorithmic pictures created on the principle: “One has looked – and has understood at once! One has glanced – and the entire picture has become clear immediately! “
This book presents new ideas. They are new, but has been thoroughly tested over fifteen years. And proven to work in Russian spaceflight experience.
These ideas will help you open the cherished door to the wonderful kingdom of algorithms.
WHAT IS THE PROBLEM?
Many algorithms are very complicated. Such algorithms are difficult to comprehend. But what does it mean, “to comprehend”? Comprehension of algorithms is a work, a real work. Moreover, it’s a very difficult work. The productivity of this work is very low. One has to make a lot of effort and spend tons of time to reach comprehension.
Can we solve the problem? Can we diminish the difficulties of comprehension? Can we make understanding easier?
Sure! The secret is to make algorithms friendly. Because a friendly algorithm is easy to understand. In this case, people will be able to read and write algorithms with pleasure.
It’s necessary to turn algorithm-puzzles into clear and pleasant algorithm-pictures, which will ensure fast and deep comprehension. The depth of understanding complicated problems — is definitely something we all (from students to ministers) are lacking!
Why are algorithms so difficult to understand? The reason is simple. The existing methods of writing algorithms (accepted throughout the world) have become obsolete.
Of course, they are mathematically accurate. The trouble is they do not take into account the science of human factors – ergonomics. These outdated methods do not consider psycho-physiological characteristics of people. Because of this, they complicate and slow down the work with algorithms.
This is one of the reasons for algorithmic illiteracy of the population.
EASY TO UNDERSTAND AND CONVENIENT FOR WORK
According to current requirements, algorithms must be correct. But it’s not enough. So, we posit a new, additional requirement. Algorithms must be not only correct, but also friendly to human.
What does it mean, “friendly”? It means easy to understand and convenient for work.
This is the noble purpose of ergonomic algorithmic languages. They enhance intellectual comfort and increase productivity. With their help, you will learn how to solve difficult problems quickly and easily. You will be able to plan complicated activities and business processes. To formalize your professional knowledge. And to create algorithms yourself, without asking programmers for help.
Algorithms are a very important part of human culture. The ability to write algorithms improves the work of the mind. With some overstating, one can say, “Algorithms are the second literacy!“
FLOWCHARTS OF ALGORITHMS
There are several techniques for writing algorithms. One of them is flowcharts, which were popular a few decades ago. The International Organization for Standardization published a standard for flowcharts ISO 5807—85.
Reputedly, “flowcharts are falling out of use because they do not give a structured view of a program” and of an algorithm [1, p. 3, 4].
Today most of the experts consider flowcharts outdated. For example, the authors of Unified Modeling Language (UML) decided to ignore flowcharts completely and didn’t include them in the UML diagrams set. This decision is justified, since flowcharts have many serious deficiencies and imperfections.
Nevertheless, the question arises. Do flowcharts have any potential for further evolution?
We affirm that such potential exists undoubtedly. Moreover, we believe that flowcharts have a number of amazing advantages, which are left undiscovered. It is no exaggeration to say that flowchart is a priceless diamond that by the will of fate-stepmother was not polished and inserted into a golden rim. Shortly speaking, the enormous potential capacities of flowcharts are virtually not used.
The goal of this book is to propose the NEW STRATEGY of flowcharts evolution. The new generation of flowcharts must comply with the challenge of modern needs. This allows to turn the ancient flowcharts into ergonomic flowcharts “with a human face”. We will show that the new flowcharts will give algorithms new charming force, unprecedented clearness and other useful properties.
DRAKON-CHARTS
To achieve the goal, flowcharts should be changed drastically. They have to become mathematically strict and ergonomically attractive. To avoid confusion, we have named the new flowcharts as drakon-charts.
Drakon-charts differ from traditional flowcharts as heaven from earth. Flowcharts are too casual, unstructured, and cannot represent many of the necessary constructs (building blocks of an algorithm).
Drakon-charts are free of these defects. They make algorithms well structured and very easy to comprehend. When debugging algorithms, drakon-charts are a highly valuable tool for demonstrating how the algorithms ought to work, and tracking down what might be wrong. But not only.
“Today it is desirable that we have one drawing technique that accomplishes both the overview diagramming and the diagramming of detailed [logic]… The overview diagram should be successfully decomposed into the code structure” [1, p. 5].
Drakon-charts accomplish this requirement.
DRAKON LANGUAGE
Drakon-charts allow building a family of friendly algorithmic languages with a common name DRAKON.
DRAKON (ДРАКОН, dragon) is a Russian abbreviation. When translated from Russian, it means “friendly Russian algorithmic language that guarantees clarity.”
Visual algorithmic language DRAKON has unique ergonomic characteristics that allow creating friendly and precise algorithms.
DRAKON is a means of intellectual mutual understanding and intellectual interaction. It is essential for clear thinking and for human communication. DRAKON facilitates creative process significantly, making it accessible to a wide range of people.
_______________________________________
WHO DEVELOPED THE DRAKON LANGUAGE?
DRAKON was developed by a joint effort between the Russian Federal Space Agency (Academician Pilyugin Center, Moscow) and the Russian Academy of Sciences (Keldysh Institute of Applied Mathematics, Moscow).
DRAKON WAS BORN IN A SPACE CRADLE
DRAKON has emerged as a generalization of experience in creating the spacecraft “Buran”. Based on DRAKON, computer-aided algorithms and programs engineering called “Grafit-Floks” was developed. It is used successfully in many major space projects: “Sea Launch”, “Frigate”, “Proton-M”, etc.
ALGORITHMS WITHOUT PROGRAMMERS
We will not deal with programming in this book. And will focus solely on algorithms.
Algorithmization and programming are two different things. Let’s emphasize the main idea.
__________________________________________
The number of people who need to know algorithms is many times higher than the number of people who need to know programming.
_____________________________________________
Here we encounter a paradox. Algorithms and programs are connected to each other like Siamese twins. It seems they cannot be separated. To write a precise algorithm, students and professionals use keywords of basic structures, such as “if, then, else, case, switch, break, while, do, repeat, until, for”, etc. At the end of this process, an algorithm turns into a program.
The question arises: Is it possible to separate “Siamese twins”? Is it possible to create algorithms without creating programs? And, more importantly, without the participation of programmers?
Yes, it is possible. We will show how this can be done. This book contains fundamentals of algorithmization based on the DRAKON language. Algorithmization, but not programming. With our method, anyone can create algorithms without programmers.
James Martin was the first who proposed programming without programmers [2]. In developing his idea (to some extent), we propose a new technique to create algorithms without programming and without programmers.
HOW MANY PEOPLE WANT TO READ AND, PERHAPS,
WRITE ALGORITHMS THEMSELVES,
WITHOUT THE HELP OF PROGRAMMERS?
According to the Microsoft Corporation, there are 24 million programmers (6 million professionals and 18 million amateurs, i.e. nonprofessional programmers) [3].
We suppose, besides the army of programmers, there is another, even more numerous army — tens or, perhaps, hundreds of millions of professionals who don’t need to know programming, but do need to know algorithms.
Until now, the vast majority of these professionals (physicians, pediatricians, financiers, senior managers, business strategists, physicists, geologists, neurologists, pharmacists, agronomists, chemists, biochemists, education advisers, metallurgists, astronomers, corporate planners, management consultants, microbiologists, economists, environmentalists, psychiatrists, social workers, family therapists, epidemiologists, sociologists, investors, researchers, etc.) have been deprived of such an opportunity. They (of course not all, but majority) are not familiar with algorithms and they don’t know how to write and read them.
The reason is that modern algorithmic notations are unsuitable for quick learning and quick work.
Algorithms based on unfriendly notation are too difficult to understand. They require unreasonable efforts.
The mischief of this fact is that algorithms are available only to the “elite” (to mathematicians and computer programmers) and are no good for all others. This fact erects an insurmountable barrier for many employees whose work is connected with the algorithms, but who do not have spare time (reserves of time) to learn how to express their procedural knowledge in a good form of easy-to-read algorithms.
DRAKON allows implementing a revolutionary change and eliminates these difficulties. Thanks to this innovation, algorithms become more clear, transparent and obvious. Drakon-charts are designed not only for IT professionals. They must satisfy the needs of a huge army of employees.
NEW NEEDS
Marketers say it is possible to create new needs. Needs, which never existed in the past. Two hundred years ago, people knew nothing about cars. Therefore, there were no needs for cars. People used horses and were satisfied.
The language DRAKON may be compared with a car. Our world is a world of algorithms. However, many professionals do not notice them although they meet algorithms in every step. They cannot speak the language of algorithms. They cannot use algorithms to increase quality and productivity of their work.
We believe that DRAKON can help tens or, maybe, hundreds of millions of professionals to speak the language of algorithms. The use of algorithms should become as easy, simple, and familiar as the use of cars.
In our opinion, it is time to put an end to algorithmic illiteracy.
WHAT’S INSIDE
The book consists of eight parts.
Part 1 (chapters 1, 2) is introductory and assigned for beginners. Funny examples of algorithms describing everyday human life are given. Relationship is shown between algorithms and procedural knowledges.
Part 2 (chapter 3—16) is about ergonomic algorithmic language DRAKON. It reviews graphic alphabet of the language, algorithmic structures “silhouette” and “primitive”. It introduces simple and obvious mathematical methods that improve comprehensibility of algorithms. It also shows a wide range of visual (graphic) cyclic algorithms, visual logic, systems of real time, and parallel algorithms. Easy and clear diagrams accompany description of the main ideas.
Part 3 (chapters 17—25) contains a large number of algorithms taken from practical life. These examples demonstrate universality of the language DRAKON, show a wide range of its capabilities for diverse industries and subject fields. They include medicine, industry, agriculture, trade and many others.
Part 4 (chapters 26—29) briefly explains mathematical algorithms. Examples demonstrate working with arrays, data search, etc.
Part 5 (chapters 30, 31) gives conclusive recommendations on creating drakon-charts, using algorithmic structures “silhouette” and “primitive”. The technique of trees’ fragmentation is described. This technique improves understanding of a silhouette.
Part 6 (chapters 32, 33) explains the computer program “Constructor of algorithms”, which is a working tool assisting a human in creating and designing algorithms. A formal description of the language DRAKON is given.
Part 7 (chapters 34—36) goes into theoretical basis of the language DRAKON.
Part 8 (chapters 37—41) covers humanitarian and cultural aspects of algorithmization. And gives an answer to the question: “How to eliminate algorithmic illiteracy? “
REFERENCES
1. Martin, James and McClure, Carma. Diagramming Techniques for Analysts and Programmers. Prentice Hall Inc, Englewood Cliffs, NJ, 1985.
2. Martin, James. Application Development Without Programmers. Prentice Hall Inc, Englewood Cliffs, NJ, 1982.
3. LaMonica, Martin. Microsoft Targets Amateur Programmers. CNET News June 29, 2004.
http://news.cnet.com/Microsoft-reaches- ... z1KR7czD8FPart 1
ALGORITHMS
(PLEASANT EXAMPLES FOR A FIRST ACQUAINTANCE)
Chapter 1
ALGORITHMS — IT’S VERY SIMPLE!§1. FIRST FAMILIARITY WITH AN ALGORITHM
Let’s assume a mother says to her son,
“Go to the bakery. Buy a loaf of white bread and a loaf of rye bread.“
The mother’s words are an algorithm shown in fig. 1. This algorithm can’t be called a successful one. It doesn’t answer the question what to do if there is no bread at the shop.
To fix that, we have to write another algorithm that takes into consideration real conditions. Let’s suppose that the bakery always has rye bread, and not always — white. In this case, the mother should say,
“Buy a loaf of white and a loaf of rye. If there is no white, take two loaves of rye.“
Verbal formulation of this algorithm is shown in fig. 2, flowchart — in fig. 3.
The last algorithm can’t be called perfect either. How shall the boy act if there’s no rye bread? To consider all possibilities, the mother has to give more complete instructions.
“Run to the bakery. One loaf of white and one loaf of rye. If they have no white, bring two loaves of rye. And on the contrary. If there’s no bread at all, don’t bother.”
Corresponding flowchart is shown in fig. 4.
Fig. 1, Fig. 2, Fig. 3, Fig. 4.
§2. COMPARISON OF ALGORITHMS
Let’s take a look at the three algorithms shown in fig. 1, 3, 4. Which of them should be considered good, and which — bad?
Rule. Algorithm is good if it functions correctly under all real conditions. Otherwise, algorithm is considered bad.
Let’s apply this rule to our algorithms. It’s easy to see that only one algorithm (fig. 4) will work under any conditions.
In fact, if the bakery has both white and rye bread, the imaginary “runner” will move from the start to the end of the algorithm on the left vertical line.
If there’s white but no rye, the runner will go slightly to the right — through the icon “Buy two loaves of white”.
If they have no white but only rye, the runner will go even further to the right — through the icon “Buy two loaves of rye”.
Finally, if there’s no bread at all, the runner will choose the rightmost path — through the icon “There’s no bread. Go home empty-handed.”
What did we find out? The algorithm, which is shown in fig. 4, is a good algorithm as it works under any conditions. And vice versa, the algorithms in fig. 1 and 3 are bad, “incomplete” algorithms.
One can say it in a different way. The algorithm shown in fig. 4 is correct, error-free and able to work. And, on the contrary, the schemes shown in fig. 1 and 3 do not answer the question what to do if there’s no bread at the bakery. Therefore, these algorithms are not able to function; they contain an error. In the fig. 4, the error is corrected.
§3. WHAT IS DRAKON-CHART? WHAT ARE ICONS FOR?
Flowcharts drawn according to the rules of the DRAKON language are called drakon-charts. They consist of simple frames — icons, connected to each other. For example, in fig. 1 there are seven icons. The top one is called “Title”. The one a little lower — “Comment”. The next four — “Action”. The bottom one is called “End”.
§4. ALGORITHM
Every man, while at work, doesn’t behave randomly. Usually he has a clearly defined objective and performs actions necessary for achieving it. Thus, any work (excluding complex creative procedures) can be considered as a well-defined cascade of actions, i. e. an algorithm. It’s easy to notice that algorithms surround us everywhere.
Algorithm is a chain of steps leading to a goal. In other words, it is a sequence of instructions that helps solve the problem.
Instructions of the algorithm can be written in different ways, for example:
• in a form of drakon-chart;
• in a form of text.
To verify this, take a look at fig. 5.
Fig. 5
§5. EVERY INSTRUCTION OF THE ALGORITHM SHOULD BE EXECUTED PRECISELY AND UNIQUELY
Let’s review the algorithm shown in fig. 6. And assume that this algorithm is performed by a robot.
A robot is a typical verbalist. Usually people don't like pedants and verbalists. But the world of algorithms has its own laws. Pedants are in great honor over there. In order for a robot to understand the algorithm, every instruction has to be written in a “verbalistic” manner. That is precisely and uniquely.
Algorithm in fig. 6 is written exactly this way — precisely and unambiguously. It clearly says what has to be bought — a kilo of potatoes and a head of cabbage. This means that all other purchases are forbidden.
And what do we see in fig. 7? Quite a different story. The instruction “Buy groceries” is bad, inaccurate. It can’t be performed. Because it’s nowhere mentioned, what groceries namely should be bought.
Such defaults are unacceptable in algorithms. They are considered as errors.
Fig. 6, Fig. 7, Fig. 8
§6. THE “QUESTION” ICON
In the upper part of fig. 9 one can see the “question” icon. It is called so because it contains a “yes-no” question. That is a question which can only be answered as “yes” or “no“. All other answers are forbidden.
Here are some examples of yes-no questions: Is the iron broken? Have John bought some bread? Is the door open? Was the criminal arrested? Has aunt arrived? Did “Yankees” win? Is this pool bigger than that one? Is the temperature outside above zero?
The “question” icon has one input from the top and two outputs: down and to the right. Output to the left is forbidden and is never used.
There are cases when one needs to choose one action out of two. In this case, it’s convenient to use the “question” icon. When the answer is yes, one action is performed, when no — a different one. The “question” icon is used to make a fork in the algorithm. This is illustrated in fig. 9.
Sometimes, more than one fork is required in the algorithm. Then several “question” icons are used (fig. 4).
§7. CONCLUSIONS
1. Ability to express your thought in a form of algorithm has a lot of advantages. This ability will be helpful to almost everyone as it makes the mind more precise, flexible and effective.
2. Algorithms play a very important role in the life of society. They have an appreciable influence on the efficiency of economics, standard of living and mental development of our civilization.
____________________________________________________
Это самое начало книги. Показываю то, что есть