An algorithm allows us to carry out a task or find the solution to a certain problem through a series of well-defined and structured instructions, which must also be in order, that is, one after the other, and be finite, that is, have a possible solution. In this way, defined an initial state and an entry, if we follow the instructions given we will reach the final state and find the solution to the problem or reach the defined objective.
The general consensus is that Algorithms are used only in matters related to mathematics. While the term algorithm is very present in this area and in all other areas in which data structuring is used, such as computing, logic and other areas related to numbers, the truth is that algorithms are used much more than we think, and in all aspects of our daily life.
If you want learn more about the fascinating world of algorithms and see how they relate practically in all the orders of our life, we invite you to continue reading the article until the end.
What is an algorithm?
The term algorithm comes from the classical Arabic language isbu lubr, then transformed into brass Alborarismus, that according to experts can be translated as Calculation using figures arbigas. The origin of the word dates back to the Middle Ages, more precisely from the hand of the mathematician Al_ Khwarizmi, in an area of Central Asia now known as Uzbekistan, in Central Asia.
Basically, The algorithm is an ordered series of processes or steps that must be carried out to reach the solution to a specific problem. The algorithms can be of different types, those of daily life such as following the instructions for brushing teeth, operating a washing machine and the algorithms used to solve or carry out more complicated processes such as the operation of a computer program.
One of the algorithm characteristics is that they allow us to define a series of steps to follow that must be performed to achieve the result we want, that is, a predictable result. At this point it fits highlight an example of algorithm usage: the computer software, which consists of precise instructions to carry out a procedure in the same way, but written in a programming language.
However, the use of algorithms is not limited to computers or automated systems, since also in nature and in our lives the algorithms are well present. Basically Any task that should be carried out through instructions and rules defined for them can be considered as an algorithm. An example of this would be to wash your hands and similar tasks, as we can see below in this same post.
Types of algorithms
In simple terms to understand, there are two types of algorithms. The first are called conventional algorithms, which are those that people do every day in their daily occurrence, in order to reach a certain goal, such as making breakfast, or to solve problems in their workday, such as programming what to have lunch based on the time you have available.
Although it may seem too simple, the truth is that if we take the meaning of algorithm, which basically dictates that it is logical and finite sequence of steps that can solve a problem or meet a certain objective any of the cited examples fit perfectly to the meaning of algorithm.
The other type of algorithms are called computational algorithms, which are those that use applications and computer software to perform the tasks that we ask for or the automatic actions performed by the devices without our request. Again if we take the algorithm definition, we will meet all the required conditions.
It should be noted at this point that all arithmetic and algebraic operations related to algorithms are included in a Science called Algorithmia. If we want to know more about computational algorithms, We invite you to continue reading the rest of the post, where you will find important definitions about the subject.
We have all heard the word Algorithm related to computer science, such as when talking about Google algorithm or of Facebook algorithm This is because nothing happens in computing without a series of steps, which definitely make up an algorithm.
In this sense, The algorithm is the fundamental element of any computer program, and it is not related to the programming language used to develop it, but in the steps that must be taken to achieve the objective, that is, the set of instructions and steps developed to carry out the task entrusted to the software.
In a nutshell this means that first the software developer must write the algorithm and then translate it into the programming language that best suits your own needs and customer requirements. With this, the computer engineer makes sure to have a solid base from which to start creating a methodology with well-defined and finite scenarios, that is, they must end at some point during their journey.
Basically the use of a computer algorithm offers us the possibility of finding a generic solution to a certain problem, and it will allow us to reuse it whenever necessary to achieve the desired objective.
Characteristics of an algorithm
Up to this point we have talked about different types of algorithms and their origins, but we need to know a more than important point, what are the fundamental characteristics that every algorithm must meet. That is why under these lines we will find the fundamental points that a process must meet to be considered a true algorithm.
- The first thing to consider is that an algorithm must be precise: That is why the exact order of execution of each step involved in the process must be indicated.
- Another important point to consider is that An algorithm must be perfectly defined. This means that if the same is executed more than twice, the same result must always be obtained regardless of the number of times it is followed.
- It is also necessary to know that an algorithm must be finite, that is to say that the algorithm must culminate at some moment of its execution, expressed in other words, it must have a number of well-determined steps until completing its task.
- Likewise, An algorithm has to be readable. This means that the text you describe must be clear and concise, in a way that allows for immediate understanding, that is, without elaborate or unclear procedures.
- Finally, an algorithm must be defined in three fundamental parts, which are: Entry, Process and Exit. If you want to know more about this topic, later in this post you will find information about it.
Characteristics of computational algorithms
Originally, the idea of bringing this concept of the field of mathematics to the field of computer science was proposed by the English mathematician Alan Turing, who laid the foundations to define the basic elements of an algorithm applied to computer science, which They should be the following:
- A limited sequence of steps, that must be clearly defined. Also these steps must be independent of each other.
- An agent, that in some cases a human operator and in other cases part of the program itself is the actor whose task is to apply each of the stages of the process at a specific point in the route.
- This agent must have the ability to interpret the instructions Operational and simultaneously have the possibility of storing the information provided by the program itself.
- The result obtained when certain program operations are performed always behave the same in each step of the operation, taking into account of course the configuration of the initial input data.
- The operation always must end with a concise result.
At this point it should be noted that there are cases in which the procedure requires that a specific result be offered, and other cases in which it is not necessary. That is why repetitive or irregular algorithms that do not culminate are so common in the programming of applications for computers.
The best example of this are modern operating systems such as Windows, Linux or the OS of Mac computers, which must continue running to allow other applications and processes of the computer to continue fulfilling its function or task.
Parts of an algorithm
From this point, we will know the Basic rules of the parties that must conform an algorithm to be considered as such. Basically, the algorithms must be composed of three main parts that are entry, process and exit, regardless of whether they are computational algorithms, non-computational algorithms, qualitative algorithms or quantitative algorithms.
Below we will find the characteristics that each phase of an algorithm must have.
|Entry||This phase of the algorithm corresponds to the input data that must be fed to it. Basically it is about the information delivered to the algorithm, that is, the data values with which a certain result will have to be offered.|
|Process||The second phase of an algorithm occupies the necessary calculations to process the data with which we have fed the algorithm, that is to say at this point the information delivered to the algorithm input will be processed, and with which the expected result must be reached.|
|Departure||The third and last phase of an algorithm is where the result of the operation is obtained, that is to say the transformation of the data that was provided in the input phase and developed in the process phase.|
How to make an algorithm
In the case that we need make our own algorithm to solve problems or improve some process in our activity, We can do it quite simply, since the only thing we have to do is make it clear that we need and how we can solve it.
To do this we must perform the series of necessary steps and their derivations to be able to reach the expected result of the problem we have at hand. The steps to define and specify our algorithm They are as follows:
- First step: Prior analysis of the problem or need. The first thing we have to do, before starting with the development of any algorithm It is to carry out a detailed analysis of the situation or problem.
- Second step: Define the requirements. In this step you must define exactly the problem that we have to solve and break it down, including all the derivations that may arise.
- Third step: The identification of the modules. In this step, clearly identifying the modules is as important as identifying the requirements. This is because the correct identification of the modules will help us to considerably simplify the implementation of the algorithm steps correct for our problem, and that we have identified in the previous step.
- Fourth step: The creation of the algorithm. At this point we must ensure that the algorithm meets all the appropriate requirements to carry out the task function. This is similar both for non-computational algorithms and for computational algorithms. In the case of a computational algorithm, you must also comply with certain characteristics to be able to then be implemented in any programming language.
- Fifth step: The implementation of the algorithm. In the chaos of the computational algorithms, their implementation must be carried out by translating it into a programming language with the purpose that any computer can interpret its instructions and send the necessary information to its hardware to complete the steps corresponding and thus obtain the expected result.
- Sixth step: Creation of the tools to carry out the algorithm. In the latter, and if we could correctly complete all the previous steps, we will be in position to be able to create the necessary tools to be able to execute the developed algorithm. In the case of a computational algorithm, we can develop through any programming language an application to be able to carry it out, which have a series of instructions that ordered one after the other could represent the algorithm that we designed and be able to offer a solution to the identified requirements. In cases where it is a non-computational algorithm, we can develop the necessary taking into account the steps that the algorithm must follow, such as a production line.
Algorithm application examples
The algorithms can be applied in any field, and they are not at all out of the question of daily life, that is, they are not just calculations that are applied in certain scientific fields, since in our daily life we can find dozens of examples of algorithms, which most of the time go unnoticed by all of us.
Examples of algorithms in daily life are the process of digestion, which is basically a concept of algorithm with which we live every day without having to implicitly know its definition to happen. This means that in order for us to carry out the digestion process every day it is not necessary for us to know how this works or the actors involved in the procedure.
The algorithms are launched countless times a day, but we have become accustomed to them or maybe we simply ignore that they are, because we are not familiar with the Algorithm concept.
A fact that we must emphasize is that the algorithms in daily life, They do not differ too much from the algorithms that are used in computer science. In the following example, we propose compare the described algorithm with some situation given in real life. We assure you that the result will surprise you!
For the example we have performed an algorithm Where it is determined if a person can enter a mechanical attraction in an amusement park.
|Step 1||to write What is the age?|
|Step 2||Read Age|
|Step 3||to write What is the height?|
|Step 4||Read Height|
|Step 5||If (Age> = 18 Height> = 148) then|
|Step 6||to write Can enter|
|Step 7||Otherwise if not|
|Step 8||to write Cannot enter|
|Step 9||Completion of Yes|