The concept of an algorithm and the properties of an algorithm are some of the most important concepts in computer science. Many people today, in the age of computer technology, think about what it is and gradually begin to, for one reason or another, dig deeper into the basics of computer science, while the modern generation is already passing this material in the sixth grade.
What it is?
What is the concept of an algorithm and the properties of an algorithm?
An algorithm is a certain sequence of actions, that is, in principle, we have to deal with them every day, although we may not even be aware of this.
Man and Algorithm
For example, if we ask one of our family members to buy something in the store, we set the algorithm of actions, that is, we tell in detail what specific products you need to buy, in what quantity, and also what requirements are presented to each of them. In this case, as mentioned above, a clear algorithm of actions is set, for example:
- Go to a specific store.
- Find out if white bread is sold there.
- Find out if it's fresh.
- If the answers to questions 2 and 3 are yes, then two loaves are bought.
Of course, it might seem that the procedure is quite mundane, and its similar description is quite voluminous. But in fact, if we are talking about the concept of an algorithm and the properties of an algorithm in modern computer science, then the instructions there can be much more extensive, since the above algorithm is one of the simplest.
Algorithms in nature
Each person constantly solves a huge number of the most diverse problems of varying complexity, while some of them are so simple that they are solved completely automatically, without even being perceived as a specific task. For example: close the door with a key, wash your face, have breakfast, feed your family, etc.
But there are other tasks that are so complex that to solve them requires lengthy reflection, as well as a considerable amount of effort to initially find a solution, and only then achieve the goal. These tasks include: learn a foreign language, earn a certain amount of money, and others. In other words, to accomplish such tasks, much more complex actions are required compared to how many of them are required to complete the “buy bread” task, but in fact, even the simplest tasks are solved in several steps.
Concept, types and properties
In the form of a certain sequence of actions, one can describe the procedure for solving a huge number of problems that a person faces in everyday life, and this sequence is represented in computer science as a concept of an algorithm and properties of an algorithm.
One of the most famous among all is the so-called Euclidean algorithm, with which the largest divisor of two integers is determined.
At the same time, it is worth noting the fact that, when considering the concept of an algorithm and its properties, it is necessary to correctly understand not only the actions themselves, but also the order in which they are performed. Indeed, such situations often happen when, when changing the order of actions in the algorithm, it may ultimately turn out to be unfeasible under certain circumstances. For example, if you go to the store, then the beginning of the algorithm will be approximately as follows:
- Go to a shop.
- Choose bread.
Or:
- Choose bread.
- Go to a shop.
If we consider the last algorithm, then in this case bread is initially selected, and only then we go to the store with a more precisely defined task, and if in fact we don’t get the bread we need, then in this case the algorithm we built will end up unenforceable.
Kinds
Types of algorithms can be as follows:
- Cyclical. An algorithm in which there is a cyclic structure, i.e. multiple repetition of various actions.
- Linear. An algorithm that uses a sequence structure, that is, actions are arranged one after another.
- Branching. An algorithm that uses a branch structure when an action is selected depending on whether a particular condition is met.
The properties
Their properties are as follows:
- Determinism. When specifying the same initial data several times, the algorithm starts to execute equally, providing the same signal.
- Massiveness. Using the algorithm, not one single task is solved, but many tasks of a certain type.
- Performance. Using the algorithm in any case leads to the solution of the problem.
- Discreteness. The algorithm includes a sequence of actions, the implementation of which is not of any complexity.
- Limb. The sequence of actions of the algorithm cannot be unlimited or infinite.
- Correctness. If an algorithm is formed to perform a specific task, then it should always produce the corresponding result.
Algorithm in Computer Science
When a person gradually delves into computer science and thinks about what the concept of an algorithm is and its properties, he learns that an algorithm that has an error will, in a sense, be better than one that functions, but does it wrong. After all, if an error is present, then in this case the computer will inform us about it, and we can later find it and fix it, but if the error that makes the algorithm work incorrectly appears only in rare cases, then in this case it may appear in the most crucial moment.
How easy is it to compose?
For many people , information processing seems to be a fairly simple task, but in fact it is not, because for starters you need to at least understand what the concept of an algorithm, and the properties of the algorithm, and its executors are. In particular, this concerns the compilation of the algorithm, which is required for the correct processing of information.
The simplest example is user instruction for a specific subject. If it is composed unprofessionally, then the user can simply break the item, as it will be incorrect to operate it or not learn to work with it, not to mention the fact that there may be certain physical injuries, if we talk about serious domestic technique.
Many will say that in fact there is nothing complicated in compiling instructions for the finished device, but in fact it is not, because in reality it is much easier for the majority of people to do something on their own than to explain to someone else how it is done.
For example, almost every student easily uses a mobile phone, as well as all the functions available in it, and this seems extremely simple and intuitive. But in fact, it is not so simple to explain how to use a mobile phone to a person who has never held this device in his hands, as he will have a huge number of questions, and those that you don’t even suspect. It is in this situation that it will be difficult to explain everything in accordance with what the concept of an algorithm and the properties of an algorithm are. The sequence of actions will be incomprehensible, and a person will not be able to perform them the way it is necessary for the normal operation of the device.
What difficulties may arise?
As an example, consider how to make a tea brewing algorithm for a robot that basically does not know anything, and for it a complete source of information about a task is an algorithm. The concept, types, properties - we all know this, but for most people the mental model of such an algorithm is approximately the following:
- Take a cup.
- Put tea in it.
- Pour sugar.
- Pour boiling water.
- Stir.
But in reality, such an algorithm will be practically impossible to execute, since the robot does not have common sense, and this entire procedure for it is a minimal set of information.
Precision is the basis of the algorithm
The main thing that you need to understand when considering the concept of an algorithm and the properties of an algorithm is the accuracy of the actions, because the robot does not even know where to get the cup and which one to take, and even if he takes it, he will hold it in his hands, how he had no command to put her on the table. Now he will need to put tea, but again this can be done with your hands, or you can use a spoon, and you need to know the quantity. Thus, a huge number of various problems appear that need to be solved even at the stage of constructing the algorithm.
What does it look right?
Of course, considering the concept of an algorithm and the properties of an algorithm, an accurate description can be formed almost ad infinitum, but the following sequence of actions will be optimal in this situation:
- Take a cup in the sideboard with the inscription "Work".
- Put the cup down on the kitchen table.
- Remove from the cabinet to the right of the refrigerator containers with the words "Sugar" and "Tea", and then put them on the table next to the cup.
- Take a teaspoon from the sideboard.
- Pour one full teaspoon from the container labeled “Tea” into the cup, and then two teaspoons from the container labeled “Sugar”.
- Turn on the kettle.
- Wait until the kettle boils, then pour water from it into the cup until it is 2/3 full.
- Stir the liquid evenly in a cup with a teaspoon for 30 seconds.
Thus, considering the concept of an algorithm and the properties of an algorithm, by whom each action is performed, as well as many other elements, it will be possible to come to the construction of an optimal sequence of actions. Even the above algorithm cannot be called perfect, and it provides that the robot knows a large number of things, but even with this example you can understand how difficult it is to actually describe those or other things that you and I have perfectly known since childhood.
What do you need to know?
First of all, before there, how to compile the algorithm, you need to decide what the initial conditions are for performing a certain task, and what you need to know must also be known. The algorithm itself is already a finite sequence of actions in solving a specific problem, which leads from the initial information to a specific result. In any case, the primacy in the development of the algorithm of actions belongs to the person, and various people or all kinds of devices such as satellites, robots, computers, advanced household appliances are engaged in the execution of these actions, and more recently, even certain toys have learned to perform them.
History
Al-Khwarizmi is the person who first defined the concept of an algorithm and the properties of an algorithm. This concept acquired mass character after a certain time, when it got a broader meaning, and it also began to determine any exact rules of a certain action. Today, this concept is already perceived by many as one of the most important concepts of such a science as computer science, without which it is almost impossible to imagine.
Al-Khwarizmi himself lived in the 9th century AD, and it is worth noting that the original Arabic original, which set out his arithmetic works, was lost, but there is a translation by which Western Europe was able to eventually get acquainted with the decimal positional system numbering, as well as the basic rules for performing various arithmetic operations.
The scientist sought to ensure that the rules that he formulated were extremely clear to any literate person. To achieve this in a century when there was still no full-fledged mathematical symbolism was extremely difficult, but the scientist was able in his works to ultimately achieve a clear and at the same time rigorous verbal prescription, according to which the reader was not able to evade prescribed tasks or skip certain actions .
In the Latin translation, the scientist’s works were set forth in a single book called Algorizmi said. Over time, people began to gradually forget that Algorizmi was the author of such rules, as a result of which the rules began to be called algorithms. Thus, gradually “Algorizmi said” was transformed and became “the algorithm says”.