What is the name of the property of an algorithm that means that a given. Rules for constructing algorithms. The discreteness of the algorithm means

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 new list Consistent actions can only be created by a living being. 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 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 special program"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 mathematician Al Khwarizmi, 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 must be suitable for solving all problems of this 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 called graphic image the logical structure of the 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.

Elements of the theory of algorithms

Algorithm - a concept related to the fundamental principles of computer science. It arose long before the advent of computers and is one of the basic concepts of mathematics.

Word "algorithm" came from the name of an outstanding medieval scientist Muhammad ibn Musa Al-Khwarizmi(9th century AD), abbreviated Al-Khwarizmi. In the Latin translation of one of Al-Khorezmi’s works, the rules for performing actions began with the words DIXIT ALGORIZMI (Algorismi said), in other Latin translations the author was called ALGORITHMUS (Algorithmus).

The concept "algorithm" there is no clear, unambiguous definitions in a mathematical sense. You can only give description (explanation) of this concept. To clarify the concept "algorithm" the definition of the concept is of great importance "algorithm executor" . The algorithm is formulated based on a specific performer.

Algorithm - a guide to action for the performer, therefore the meaning of the word “algorithm” is close in meaning to the meaning of the words “instruction” or “instruction”.

Algorithm - clear and precise prescription(indication) the performer performs a certain sequence of actions to achieve a specified goal or solve a given problem.

Algorithm - an exact prescription that sets a computational process, starting with an arbitrary initial data from a certain set of data possible for this process, aimed at obtaining a result completely determined by these initial data.

It is clear that what has been said is not a definition in the mathematical sense, but only reflects an intuitive understanding of the algorithm (in mathematics there is no concept of “prescription”; it is unclear what accuracy should be, what “understandability” is, etc.).

Basic properties of the algorithm

    Mass character.

The algorithm has a certain number of input values ​​- arguments that are specified before execution begins. The purpose of executing the algorithm is to obtain a result (results) that has a very specific relationship to the original data. The algorithm specifies the sequence of actions for processing source data into results. For an algorithm, you can select different sets of input data from the set of data valid for this process, i.e. you can use the algorithm to solve a whole class of problems of the same type, differing in the initial data. This property of the algorithm is usually called mass character . However, there are algorithms that only apply to a single set of data. We can say that for each algorithm there is its own class of objects acceptable as input data. Then the property mass character means the algorithm is applicable to all objects of this class.

    Clarity.

For an algorithm to be executed, it must be understandable to the performer. Algorithm clarity means the performer's knowledge of what needs to be done to execute this algorithm.

    Discreteness.

The algorithm is represented as a finite sequence of steps (the algorithm has discrete structure) and its execution is divided into individual steps (the execution of the next step begins after the completion of the previous one).

    Limb.

The execution of the algorithm ends after execution finite number of steps . When executing an algorithm, some of its steps may be repeated many times. In mathematics, there are computational procedures that are algorithmic in nature, but Not having the property limbs .

    Certainty.

Each step of the algorithm must be clearly and unambiguously defined and should not allow arbitrary interpretation by the performer. Therefore, the algorithm is designed for purely mechanical design . Exactly certainty algorithm makes it possible to entrust its execution automatic .

    Efficiency.

Each step of the algorithm must be completed accurately and in a finite time. In this sense, they say that the algorithm must be effective , i.e. The performer's actions at each step of the algorithm's execution must be simple enough so that they can be performed accurately and in a finite time. Typically, individual instructions to the performer contained in each step of the algorithm are called teams . Thus, the efficiency of the algorithm is related to the ability to execute each command in a finite time. The set of commands that can be executed by a specific executor is called system of executor commands . Consequently, the algorithm must be formulated so as to contain only those commands that are included in the executor's command system. In addition, efficiency means that the algorithm can be executed not just in finite time, but in reasonably finite time.

The above comments clarify intuitive concept of algorithm , but this concept itself does not become any clearer or stricter. However, mathematics has used this concept for a long time. Only with the identification of algorithmically unsolvable problems, i.e. problems for which it is impossible to construct an algorithm, there is an urgent need to construct a formal definition of an algorithm that corresponds to a well-known intuitive concept. The intuitive concept of an algorithm, due to its uncertainty, cannot be an object of mathematical study, therefore, to prove the existence or non-existence of an algorithm for solving a problem, a strict formal definition of the algorithm was necessary.

The construction of such a formal definition began with the formalization of the objects (operands) of the algorithm, since in the intuitive concept of an algorithm its objects can be of an arbitrary nature. They can be, for example, numbers, sensor readings that record production process parameters, chess pieces and positions, etc. However, assuming that the algorithm deals not with the real objects themselves, but with their images, we can assume that algorithm operands - words in any alphabet. Then it turns out that the algorithm converts words in an arbitrary alphabet into words of the same alphabet. Further formalization of the concept of an algorithm is associated with the formalization of actions on the operands and the order of these actions. One of these formalizations was proposed in 1936 by the English mathematician A. Turing, who formally described the design of some abstract machine ( Turing machines ) as the executor of the algorithm and expressed the main thesis that any algorithm can be implemented by a corresponding Turing machine. Around the same time, the American mathematician E. Post proposed another algorithmic scheme - Post's car , and in 1954, the Soviet mathematician A.A. Markov developed a theory of classes of algorithms, which he called normal algorithms , and the main thesis was stated that every algorithm is normalizable.

These algorithmic schemes are equivalent in the sense that the algorithms described in one of the schemes can also be described in the other. Recently, these theories of algorithms have been combined under the name brain teaser .

Logical theories of algorithms are quite suitable for solving theoretical questions about the existence or non-existence of an algorithm, but they do not help in any way in cases where it is necessary to obtain a good algorithm suitable for practical applications. The point is that, from the point of view of logical theories, algorithms intended for practical applications are algorithms in the intuitive sense. Therefore, when solving problems arising in connection with the creation and analysis of such algorithms, one often has to be guided only by intuition, and not by strict mathematical theory. Thus, practice has posed the task of creating a meaningful theory, the subject of which would be algorithms as such, and which would make it possible to evaluate their quality, provide practically suitable methods for their construction, equivalent transformation, proof of correctness, etc.

A meaningful (analytical) theory of algorithms became possible only thanks to the fundamental work of mathematicians in the field of logical theories of algorithms. The development of such a theory is associated with the further and expansion of the formal concept of an algorithm, which is too narrowed within the framework of logical theories. The formal nature of the concept will make it possible to apply mathematical research methods to it, and its breadth should ensure the ability to cover all types of algorithms that one has to deal with in practice.

Topic: Algorithm. properties of the algorithm

Algorithm- this is a clear and precise instruction to the performer to perform a final sequence of steps leading from the initial data to the desired result

Algorithm properties

q Discreteness (discontinuity) - the algorithm must be divided into
sequence of steps performed;

q Certainty (determinism, accuracy) - algorithm
must be unambiguously (accurately) implemented by the performer.

q Mass character - the compiled algorithm is applicable to solve
similar problems with different initial data.

q Limb (performance)- in a finite number of steps
the result must be obtained;

q Formality – property meaning that any performer,
for example, a computer acts formally, that is, strictly
follows the instructions provided by the developer
algorithm.

q Understandability the algorithm must contain only those commands
which a specific performer understands.

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.

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

· 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).

Cycle called a repeatedly repeated section of calculations. A computational process containing one or more cycles is called cyclical .

Answer the test questions

1.The main properties of the algorithm include...

a) brevity, certainty, fidelity, mass character, formality

b) discreteness, importance, effectiveness, fidelity, formality

c) reliability, intermittency, effectiveness, generality, formality

d) certainty, importance, effectiveness, mass character

2. Graphic description of the algorithm is a description using...

a) ....diagrams

b)… block diagrams

c) ...graphs

d) ...all of the above methods

3. What property of the algorithm does the definition refer to?

The performer, without understanding the meaning of the algorithm and the statement of the problem, by executing each command correctly, can obtain the correct result.

a) mass participation

b) effectiveness

c) formality

d) reliability

4. Description of the algorithm algorithmic language is a tool for writing an algorithm..

a) ... in theoretical form

b) ... in the form of diagrams

c) ... in analytical form

d) ... in a special form

5. The property of an algorithm that determines the step-by-step nature of the algorithm is called...

a) effectiveness

b) unambiguity

c) discreteness

d) mass character

e) all properties determine the step-by-step nature of the algorithm

6. An algorithm is called linear if...

a) it is designed in such a way that its implementation involves repeated repetition of the same actions;

b) the sequence of execution of his commands depends on the truth of certain conditions;

c) his commands are executed in the order of their natural sequence one after another, regardless of any conditions;

d) it includes an auxiliary algorithm;

e) its record is presented as one line.

7.The main properties of the algorithm do NOT include...

a) correctness;

b) certainty

c) mass participation

d) effectiveness