A property meaning that the algorithm always leads to. Basic properties of the algorithm. What property of the algorithm does the definition refer to?

    Solves the problem of finding the maximum flow in a transport network. The algorithm is not a special case of Ford Fulkerson's algorithm. Implemented without special improvements, the algorithm runs in time. Some more improvements... Wikipedia

    Local search algorithms are a group of algorithms in which the search is carried out only on the basis of the current state, and previously passed states are not taken into account and are not remembered. The main purpose of the search is not to find the optimal path to... ... Wikipedia

    This term has other meanings, see Mars (meanings). MARS Created: 1998 Published: 1998 Key size ... Wikipedia

    This term has other meanings, see Mars (meanings). MARS Created: 1998 ... Wikipedia

    This term has other meanings, see Algorithm (meanings). To improve this article, is it desirable?: Rework the design in accordance with the rules ... Wikipedia

    This article incorporates material from this version of the corresponding English Wikipedia article. Operational Transformation (OT) is a technology to support a range of collaboration functionality in advanced systems... ... Wikipedia

    Graph search algorithms A* B* Bellman Ford's algorithm Bidirectional search Dijkstra's algorithm Johnson's algorithm Breadth-first search Depth-first search Depth-limited search First-best-match search Floyd Warshall's algorithm Search... ... Wikipedia

    This is an algorithm for ordering elements in a list. When a list item has multiple fields, the field that serves as the order criterion is called the sort key. In practice, a number is often used as a key, and in other fields... ... Wikipedia

    BMW (eng. BMW Blue Midnight Wish) is a cryptographic hash function (hf) with an output of n bits, where n=224,256, 384 or 512. Hash functions are designed to create “fingerprints” or “digests” of messages of arbitrary bit length.... ... Wikipedia

    This article should be Wikified. Please format it according to the article formatting rules. This term has other meanings, see TEA (meanings) ... Wikipedia

Books

  • Lukasiewicz logics and prime numbers, A. S. Karpenko, For the first time in world literature, a monographic study establishes a direct connection between logic and prime numbers. Although Lukasiewicz's many-valued logics were the result of a refutation... Category: Logic Publisher: Librocom,
  • Logic in questions and answers. Textbook, Kobzar Vladimir Ivanovich, The textbook is written in accordance with the program of the course of traditional (general, philosophical) formal logic. It examines the basic forms and methods of mental activity, their... Category:

Almost everything in our world is subject to some kind of laws and rules. Modern science does not stand still, thanks to which mankind knows a lot of formulas and algorithms, following which it is possible to calculate and recreate many actions and structures created by nature, and bring to life ideas invented by man.

In this article we will look at the basic concepts of the algorithm.

History of the appearance of algorithms

Algorithm is a concept that appeared in the 12th century. The word “algorithm” itself comes from the Latin interpretation of the name of the famous Middle Eastern mathematician Muhammad al-Khwarizmi, who wrote the book “On Indian Calculus.” This book describes how to correctly write natural numbers using Arabic numerals, and provides a description of the algorithm for working with a column over such numbers.

In the 12th century, the book “On Indian Accounting” was translated into Latin, and it was then that this definition appeared.

Interaction of the algorithm with man and machine

Creating an algorithm requires creativity, so only a living creature can create a new list of sequential actions. But to carry out already existing instructions, you don’t need to have imagination; even soulless technology can handle this.

An excellent example of following instructions exactly is an empty microwave oven that continues to operate despite there being no food inside.

A subject or object that does not need to understand the essence of the algorithm is called a formal executor. A person can also become a formal executor, but if a particular action is unprofitable, a thinking executor can do everything in his own way. Therefore, the main performers are computers, microwave ovens, telephones and other equipment. The concept of algorithm in computer science is of the most importance. Each algorithm is compiled with a specific subject in mind, taking into account acceptable actions. Those objects to which the subject can apply instructions constitute the executor's environment.

Almost everything in our world is subject to some kind of laws and rules. Modern science does not stand still, thanks to which mankind knows a lot of formulas and algorithms, following which it is possible to calculate and recreate many actions and creations of nature and bring to life ideas invented by man. In this article we will look at the basic concepts of the algorithm.

What is an algorithm?

Most of the actions that we perform during our lives require compliance with a number of rules. The quality and result of completing the tasks assigned to him depends on how correct a person has an idea of ​​what, how and in what sequence he should do. Since childhood, parents have been trying to develop an algorithm for their child’s basic actions, for example: waking up, making the bed, washing and brushing teeth, doing exercises, having breakfast, etc., a list that a person carries out all his life in the morning can also be considered a kind of algorithm.

Which method will be used depends on several factors: the complexity of the problem, how detailed the process of solving the problem needs to be, etc.

Graphical version of the algorithm

A graphical algorithm is a concept that implies the decomposition of actions that need to be performed to solve a certain problem into certain geometric shapes.

They are not depicted haphazardly. In order for anyone to understand them, block diagrams and Nussi-Schneiderman structure diagrams are most often used.

Also, block diagrams are depicted in accordance with GOST-19701-90 and GOST-19.003-80.
Graphic figures used in the algorithm are divided into:

    Basic. Basic images are used to indicate the operations needed to process data when solving a problem.

    Auxiliary. Auxiliary images are needed to indicate individual, not the most important, elements of solving a problem.

In a graphical algorithm, the blocks used to represent data are called blocks.

All blocks go in the sequence “from top to bottom” and “from left to right” - this is the correct direction of flow. With the correct sequence, the lines connecting the blocks do not show direction. In other cases, the direction of the lines is indicated using arrows.

A correct algorithm scheme should not have more than one output from processing blocks and less than two outputs from blocks responsible for checking the fulfillment of conditions.

How to build an algorithm correctly?

The structure of the algorithm, as mentioned above, must be built in accordance with GOST, otherwise it will not be understandable and accessible to others.

The general recording methodology includes the following points:

A name that will make it clear what problem can be solved using this scheme.

Each algorithm must have a clearly defined beginning and end.

Algorithms must clearly and clearly describe all data, both input and output.

When compiling an algorithm, you should note the actions that will allow you to perform the actions necessary to solve the problem on the selected data. An example of the algorithm:

  • Schema name.
  • Data.
  • Start.
  • Teams.
  • End.

Correct construction of the circuit will greatly facilitate the calculation of algorithms.

Geometric shapes responsible for various actions in the algorithm

A horizontal oval is the beginning and the end (a sign of completion).

A horizontal rectangle is a calculation or other action (process sign).

Horizontal parallelogram - input or output (data sign).

A horizontally located diamond is a condition check (solution sign).

An elongated, horizontally located hexagon is a modification (a sign of preparation).

The algorithm models are presented in the figure below.

Formula-verbal version of constructing an algorithm.

Formula-verbal algorithms are written in free form, in the professional language of the field to which the problem relates. Description of actions in this way is carried out using words and formulas.

The concept of an algorithm in computer science

In the computer field, everything is based on algorithms. Without clear instructions entered in the form of a special code, not a single technique or program will work. In computer science lessons, students are taught the basic concepts of algorithms, taught how to use them and how to create them themselves.

The creation and use of algorithms in computer science is a more creative process than, for example, following instructions for solving a problem in mathematics.

There is also a special program called “Algorithm”, which helps people who are not familiar with programming to create their own programs. Such a resource can become an indispensable assistant for those who are taking their first steps in computer science and want to create their own games or any other programs.

On the other hand, any program is an algorithm. But if the algorithm contains only actions that need to be performed by inserting your data, then the program already contains ready-made data. Another difference is that a program can be patented and is proprietary, but an algorithm cannot. An algorithm is a broader concept than a program.

Conclusion

In this article, we examined the concept of an algorithm and its types, and learned how to correctly write graphic diagrams.

CONCEPT OF ALGORITHM. PROPERTIES OF THE ALGORITHM. TYPES OF ALGORITHMS. METHODS OF DESCRIBING ALGORITHMS

An algorithm is a precise and understandable instruction to a performer to perform a sequence of actions aimed at solving a given problem. The word “algorithm” comes from the name of the mathematician Al Khorezmi, who formulated the rules for performing arithmetic operations. Initially, an algorithm meant only the rules for performing four arithmetic operations on numbers. Later, this concept began to be used in general to denote the sequence of actions leading to the solution of any given task. When talking about the algorithm of the computational process, it is necessary to understand that the objects to which the algorithm was applied are data. An algorithm for solving a computational problem is a set of rules for converting source data into results.

Main properties algorithms are:

  1. determinism (certainty). It assumes obtaining an unambiguous result of a computational process with given initial data. Due to this property, the process of executing the algorithm is mechanical in nature;
  2. effectiveness. Indicates the presence of such initial data for which the computational process implemented according to a given algorithm must stop after a finite number of steps and produce the desired result;
  3. mass character. This property implies that the algorithm should be suitable for solving all problems of a given type;
  4. discreteness. It means the division of the computational process determined by the algorithm into separate stages, the ability of which to be performed by the performer (computer) is beyond doubt.

The algorithm must be formalized according to certain rules using specific visual means. These include the following methods of writing algorithms: verbal, formula-verbal, graphic, operator scheme language, algorithmic language.

The most widespread, due to its clarity, is the graphical (block diagram) method of recording algorithms.

Block diagram is a graphical representation of the logical structure of an algorithm, in which each stage of the information processing process is represented in the form of geometric symbols (blocks) that have a certain configuration depending on the nature of the operations performed. The list of symbols, their names, the functions they display, shape and dimensions are determined by GOSTs.

With all the variety of algorithms for solving problems, three main types of computational processes can be distinguished:

  • linear;
  • branching;
  • cyclical.

Linear is a computational process in which all stages of solving a problem are performed in the natural order of recording these stages.

Branching is a computational process in which the choice of direction for processing information depends on the initial or intermediate data (on the results of checking the fulfillment of any logical condition).

A cycle is a section of calculations that is repeated many times. A computational process containing one or more cycles is called cyclical . Based on the number of executions, cycles are divided into cycles with a certain (predetermined) number of repetitions and cycles with an indefinite number of repetitions. The number of repetitions of the latter depends on the satisfaction of some condition specifying the need to execute the cycle. In this case, the condition can be checked at the beginning of the cycle - then we are talking about a cycle with a precondition, or at the end - then it is a cycle with a postcondition.

Properties of algorithms

The definition of an algorithm given above cannot be considered strict - it is not entirely clear what an “exact prescription” or “a sequence of actions ensuring the required result” is. Therefore, several general properties of algorithms are usually formulated to distinguish algorithms from other instructions.

These properties are:

Discreteness (discontinuity, separateness) - the algorithm must represent the process of solving a problem as a sequential execution of simple (or previously defined) steps. Each action provided by the algorithm is executed only after the previous one has completed execution.

Certainty - each rule of the algorithm must be clear, unambiguous and leave no room for arbitrariness. Due to this property, the execution of the algorithm is mechanical in nature and does not require any additional instructions or information about the problem being solved.

Efficiency (finiteness) - the algorithm must lead to solving the problem in a finite number of steps.

Mass scale - the algorithm for solving a problem is developed in a general form, that is, it should be applicable for a certain class of problems that differ only in the initial data. In this case, the initial data can be selected from a certain area, which is called the area of ​​applicability of the algorithm.

Rules for performing arithmetic operations or geometric constructions are algorithms. At the same time, the question remains unanswered: how does the concept of an algorithm differ from such concepts as “method”, “method”, “rule”. You can even come across a statement that the words “algorithm”, “method”, “rule” express the same thing (i.e. they are synonyms), although such a statement obviously contradicts the “properties of the algorithm”.

The very expression “properties of the algorithm” is not entirely correct. Objectively existing realities have properties. We can talk, for example, about the properties of a substance. An algorithm is an artificial structure that we construct to achieve our goals. For an algorithm to fulfill its purpose, it must be built according to certain rules. Therefore, we need to talk not about the properties of the algorithm, but about the rules for constructing the algorithm, or about the requirements for the algorithm.

Rules for constructing algorithms

The first rule is that when constructing an algorithm, first of all, it is necessary to specify a set of objects with which the algorithm will work. The formalized (coded) representation of these objects is called data. The algorithm begins to work with a certain set of data, which are called input, and as a result of its work produces data, which is called output. Thus, the algorithm converts input data into output data.

This rule allows you to immediately separate algorithms from “methods” and “methods”. Until we have formalized input data, we cannot build an algorithm.

The second rule is that the algorithm requires memory to work. The memory stores the input data with which the algorithm begins to work, intermediate data and output data that are the result of the algorithm. Memory is discrete, i.e. consisting of individual cells. A named memory location is called a variable. In the theory of algorithms, memory sizes are not limited, i.e., it is believed that we can provide the algorithm with any amount of memory necessary for operation.

In the school “theory of algorithms” these two rules are not considered. At the same time, practical work with algorithms (programming) begins with the implementation of these rules. In programming languages, memory allocation is carried out by declarative operators (variable declaration operators).

The third rule is discreteness. The algorithm is built from individual steps (actions, operations, commands). There are many steps that make up the algorithm, of course.

The fourth rule is determinism. After each step, you must indicate which step is performed next, or give a stop command.

The fifth rule is convergence (effectiveness). The algorithm must terminate after a finite number of steps. In this case, it is necessary to indicate what is considered the result of the algorithm.

So, an algorithm is an undefined concept in the theory of algorithms. The algorithm associates each specific set of input data with a certain set of output data, i.e., calculates (implements) a function. When considering specific issues in the theory of algorithms, we always have in mind some specific model of the algorithm.

Meaning of the word algorithm very similar to the meaning of the words recipe,instructions. However, any algorithm, unlike a recipe or method, necessarily has the following properties.

1. The execution of the algorithm is divided into a sequence of completed actions-steps. Only after completing one action (command) can you begin to execute the next one. This property of the algorithm is called discreteness. The performer is instructed to perform each individual action by a special instruction in the algorithm record (command).

2. Understandability- the algorithm should not contain instructions, the meaning of which can be perceived ambiguously by the performer, i.e. the recording of the algorithm should be so clear and complete that the performer does not have the need to make any independent decisions. The algorithm is always designed to be executed by a “non-thinking” performer. The algorithm is composed of commands included in the SKI.

Let's consider a well-known example of a “everyday” algorithm - the street crossing algorithm: “Look to the left. If there are no cars, walk to the middle of the street. If there is, wait until they pass, etc.” Imagine the situation: there is a car on the left, but it doesn’t drive - its tire is being changed. If you think that the executor of an algorithm must wait, then you understand this algorithm. If you decide that it is possible to cross the street, considering the algorithm corrected due to unforeseen (in your opinion!) circumstances, then you have not mastered the concept of an algorithm.

3. Determinism (certainty and certainty). Each command of the algorithm determines an unambiguous action of the performer, and it must be unambiguously determined which command is executed next. That is, if an algorithm is repeatedly applied to the same set of source data, then the output it receives is the same result each time.

4. Efficiency- execution of the algorithm must be completed in a finite number of steps, and the result of solving the problem must be obtained. One of the possible results may be the establishment of the fact that the problem has no solutions.

The property of effectiveness contains the property limbs- completion of the algorithm in a finite number of steps.

5. Mass character- the algorithm is suitable for solving any problem from a certain class of problems, i.e. the algorithm works correctly on a certain set of initial data, which is called the domain of applicability of the algorithm.

The property of mass character determines the quality of the algorithm rather than being one of the mandatory properties (such as discreteness, understandability, etc.). There are algorithms whose scope of applicability is limited to a single set of input data or even the absence of such (for example, obtaining a fixed number of correct digits of the number p). It is more correct to say that the algorithm should be applicable to any data from its domain of definition, and the word mass character is not always suitable for describing such a property.

Algorithm concept

Summarizing the above, we formulate the following concept algorithm.

Algorithm - a clear and precise instruction for the performer to perform the final sequence of actions leading from the initial data to the desired result.

The above definition is not a definition in the mathematical sense of the word, i.e. this is not a formal definition (for a formal definition of the algorithm, see the article “ Theory of algorithms”).

Note that for each performer the set of permissible actions (SAC) is always limited - there cannot be an executor for whom any action is permissible. The paraphrased reasoning of I. Kant substantiates the formulated statement as follows: “If such a performer existed, then among his permissible actions would be the creation of a stone that he cannot lift. But this contradicts the permissibility of the action “Lift any stone.”

It is interesting that there are problems that a person, generally speaking, can solve without knowing the algorithm for solving it. For example, a person has photographs of cats and dogs in front of him. The task is to determine whether a particular photograph is a cat or a dog. A person solves this problem, but writing an algorithm for solving this problem is still extremely difficult.

On the other hand, there are problems for which it is generally impossible to construct a solution procedure. Moreover, this fact can be strictly proven. You can read about this in the article “ Algorithmically unsolvable problems” 2.