Education

What is algorithm? »Its definition and meaning

Table of contents:

Anonim

In mathematics, computer science and other related doctrines, the algorithm is defined as a set of established and unambiguous precepts, found methodically and in a limited way that allow to perform computations, process certain information, provide solutions to problems and carry out various activities. Once you start from an initial state and an entry, following the required procedures, the final state is reached and a result is obtained. Algorithms are the object of inquiry of algorithmics and although many may not believe it, they can also be used in all aspects of everyday life.

What is an algorithm

Table of Contents

In computing it is usually defined as a succession of sequential instructions, in which some processes are carried out in order to give answers to certain decisions or needs. In the same way, algorithms are frequently used in logic and mathematics, and they are also the basis for the development of user manuals, illustrative pamphlets, among others. One of the most distinguished in mathematics is the one attributed to the geometrist Euclides, to achieve the greatest common divisor of two integers that are positive and the well-known "Gaussian method" to determine systems of linear equations.

In relation to computer science, this calculation can be known as the sequence of guidelines to follow for the determination of a problem through the use of a computer.

Therefore, algorithmics is understood as a discipline that focuses on the analysis and design of algorithms. In consideration of the first, it seeks to examine properties such as its correctness and its effectiveness with respect to time and space, to understand the problems that can be solved algorithmically. As for the second, it seeks to study the paradigms already established and proposes new examples.

The algorithm is located in the center of the progress of computing and is important in the different areas of it. In this way, it would be impossible for services as successful as Facebook and Google to handle the magnitude of information they have without the collaboration of algorithms or specialized data structures. However, in daily life algorithms are also used, an example of this is the ignition of the stove, since it begins at the moment in which the person goes to the kitchen, observes it and has its end, when it proceeds to light it.

Characteristics of an algorithm

Although the algorithm is known as the ordered and finite set of various steps that lead to the resolution of a problem, it is said that the nature of these difficulties vary according to the context in which they are found, in this way, there are problems chemical, mathematical, philosophical, among others. Thus, it can be said that its nature is varied and its execution by the computer is not necessary. Beyond everything previously explained, algorithms have characteristics that are elementary to determine what they are today and will be mentioned below.

  • The guidelines contained in an algorithm must be specific to avoid leaving room for any type of confusion, this means that the corresponding instructions must be followed appropriately or, on the contrary, the graphic representation of the flow in which you are enrolling will not facilitate the solution. correct.
  • It must be in perfect definition, trying as much as possible to follow it as many times as necessary, in order to obtain the same result and in case the opposite happens, the algorithm will not be reliable and will not serve as a guide when making a decision.
  • They are known for the particularity of being finite, they usually end at some point and later they throw a result at the end of each step. If the algorithm extends indefinitely, returning to some initial point that can never be resolved, there is the presence of a paradox or the well-known “loop” of repetitions.
  • Finally, it is said that the readability of the algorithms is the key element, because if its argument is unintelligible, the corresponding instructions could not be followed, in addition, it entails a direct, clear and laconic wording of the text found in each one.

Parts of an algorithm

Every algorithmic operation has three different parts that are subjected to the basic structure of a system and these are:

  • Input: also called the header or starting point, it is the initial instruction that represents the genesis of the algorithm and the one that motivates its reading.
  • Process: also called declaration, it is the precise elaboration offered by the algorithm and it is basically the trunk of its keys for the formulation of instructions.
  • Output: in this last phase are the specific instructions determined by the algorithm, for example, its commands or resolutions.

Examples of algorithms

Common examples of math calculations include 2 + 3 = 5 for addition and 15-9 = 6 for subtraction. Another way to visualize simple algorithms is in kitchen recipes since they describe a specific and orderly process, for example, “first you should place a half pot of water to heat, then you should add a pinch of salt and finally the pepper will be divided to extract the seeds and the veins. " In this model a beginning, a process and an end are presented, which are basically what define the algorithms.

Algorithm types

Among the various types of algorithms existing throughout the world, emphasis is placed on those that are classified according to a system of signs and others according to their function. The algorithm is basically the best known solution for the resolution of any particular problem and according to its strategies and its functions there are different types of these, among which the dynamic, reverse, brute force, opportunistic, marking stand out., random, etc. In addition to the algorithms mentioned above, there are thousands of these that are suitable for solving difficulties in any area.

According to your sign system

Qualitative and quantitative are located in this category.

  • Qualitative algorithms are characterized by having verbal elements, an example of these are the instructions or the recognized "step by step" that are conferred orally, such as recipes for culinary arts or procedures for performing manual work.
  • Quantitative algorithms are the complete opposite to qualitative ones, due to the presence of certain numerical elements and the use of mathematics to perform calculations, for example, when the square root is found or equations are solved.

Within this classification there are also computational and non-computational algorithms. The computational ones are carried out using a computer and are characterized by being so complex to the point of requiring a machine to be carried out, in addition to this, they are quantitative algorithms that can be optimized. Non-computational ones do not have the obligation to be executed by means of a machine or computer; a clear example of this is the programming of a television.

According to its function

The following are located in this classification.

1. Marking algorithm

This is characterized by using automation to set prices in a diligent way, focusing on factors such as user behavior and is also known as the ability to automatically determine prices for devaluing components, in order to increase the profits of the users. sellers. It has played a very important role in the common practices of the airline industries since the early 1990s.

The marking algorithm is distinguished by being one of the most common practices in highly competitive industries, referring to travel agencies or those online establishments. This kind of algorithm can become extremely complex or relatively simple, since in many cases it is noted that they are optimized or self-taught with the continuity of certain tests. Beyond all of that, tagging algorithms can also become unpopular with clientele as individuals tend to value both stability and fairness.

2. Probabilistic algorithms

They are those in which the way in which the results are obtained depends on the probabilities, these are commonly known as random algorithms.

In some applications, the handling of this type of operation is common, for example, when the behavior of any existing or devised system is simulated over time, in which a fortuitous solution is obtained as a consequence. In other circumstances, the problem to be solved is usually deterministic, but there is the possibility of transforming it into a fortuitous one, in order to solve it by applying the probability algorithm. The positive of the random is that its application does not require highly sophisticated mathematical studies.

In addition, within this group there are three main types that are known as numerical, Monte Carlo and Las Vegas.

  • Numerical algorithms can provide an approximate result of the problem and are generally applied in engineering.
  • Monte Carlo algorithms can give the right or wrong solution and have a certain margin of error and lastly.
  • Las Vegas algorithms are distinguished by never leaving an incorrect answer, in fact, they find the correct solution or simply inform you of the possible failure.

Dynamic programming refers to the method in which the algorithm computes the results. Sometimes the solutions of certain elements that have the problems depend on the results of other smaller problems. So, to solve these, the same values ​​must be recalculated to solve the smallest subproblems, however, this can create a waste of cycles. To fix this, dynamic programming can be used and in this case the solution of each subproblem is remembered, to use this same value instead of repeating it several times.

3. Heuristic algorithms

They are distinguished by finding solutions and even so they do not guarantee that the best of the answers will be found, for this reason, they can be considered as approximate algorithms. These can be used when finding a solution through a normal route is considered impossible. Heuristics provide the uses that will be explained below. In planning, they are used to schedule activities in a short period of time, in design they are used to delineate electrical or digital systems and in simulation they are used to verify certain procedures.

4. Backtracking algorithms

They are known as recursive strategies that solve problems such as puzzles, mazes or similar pieces, in which a deep search is carried out to find a possible solution. Its name refers to the fact that in the inquiries made to find a result, it always goes back to the previous point to be able to test alternatives. These are usually revoked to observe their impact on the economy, on the markets, on price marking, on certain operations and even on society itself.

5. Greedy algorithm

It is known as the destroyer or the sweet tooth and it is applicable in optimization problems, in each step of this algorithm a logical and optimal choice is made to end up with the best of the global solutions. However, it must be taken into account that once a judgment is reached, absolutely nothing can be done to correct or change it in the future. This operation has this name because in each step the best fraction that is able to "swallow" is chosen without worrying about what happens later.

Properties of an algorithm

Various authors have tried to define algorithms in a formal way while using mathematical models. However, these specimens are closely related to a peculiar type of information that includes numbers, symbols, and some graphs, while operating on a vast amount of data distribution. In general, the common share of each of the definitions is summarized in the following three properties:

Problem statement

Problem solving by means of a computer can consist of a process in which a problem is described and a program capable of solving it is allowed to be developed. This process requires the analysis of the problem, the design of an algorithm and its transformation into a program, as well as its performance and validation. The first two steps are the most complex in this process, but once you have examined the problem and obtained an algorithm that can solve it, your task is primarily based on translating it into the desired programming language.

Analysis of the general solution

Once the problem is defined, it is time to analyze the following:

  • The information of the tickets that they provide us.
  • The desired results.
  • The domain of work, statements or other necessary elements.

The analysis of algorithms is known as the most important part of the broader computational complexity theory, since it provides theoretical calculations for the resources that any algorithm requires to solve a given computational problem. When executing a theoretical investigation, it is common to calculate its complications in an asymptotic sense to obtain a large enough input size. The asymptotic upper bound together with theta and omega notations are used for this purpose and it should be noted that the non-asymptotic measure can be computed.

Accurate efficiency measures are really useful for those who actually use the algorithms, as they have more precision and this allows them to determine the time it will take to execute. For some individuals such as video game creators, the hidden constant can mean a big difference between success and failure. Time evaluations can come to depend on how a certain step is defined and for the analysis to make sense, it must be guaranteed that time is markedly limited by a constant.

Elaboration of the algorithm

To carry out the development of an operation, it is important that a series of procedures be carried out to comply with the resolution of a problem itself. To begin, a prior analysis of the difficulty must be carried out and this is done through a study that demonstrates the true operation of the problem long before any algorithm is carried out. Therefore, the definition of requirements is evaluated, in this step you must have a clear idea of ​​which problems to solve, be it the sum of two numbers, the ordering of a list of numbers, etc.

Later, the respective identification of modules is executed, since the correct implementation of algorithms depends on it to provide possible solutions to the requirements identified above.

Finally, the calculation is implemented in a programming language that is understandable by a computer so that it is able to understand the instructions that it models and thus can carry them out, achieving the expected result. In this last procedure, it is possible to speak of a program that is composed of a series of instructions that are ordered one after the other and manage to solve established requirements.

It is important to mention that in sequential time, the algorithms perform their function in a discretized time and seek to define the sequences of computational states in each input that is considered valid. In the abstract state, these operations are independent elements and it is considered that in them the primordial order structures can become invariant under isomorphism. In bounded exploration, the transitions from one state to another are completely established by a permanent and finite explanation, in which between one state and the next, only the limited number of terms of the current state are taken into account.

Nor should it be overlooked that algorithms are often expressed through programming languages "pseudocodes" the usual language and even the well-known flowcharts. Likewise, it is important to mention that algorithms play a fundamental role in computing due to their representation of data as sequences of bits. From another angle, a program is defined as the algorithm that expresses to the computer those specific steps that it must follow to adequately fulfill certain activities. On the other hand, learning to write pseudocode makes programming easier and will therefore be explained later.

Programming languages ​​are known as a formal or artificial language because they have grammar rules that are well defined, it has the ability to provide the programmer with the ability to textualize a series of instructions or sequences of regulations in the form of algorithms with the purpose to maintain a control regarding the physical and logical behavior of the computer, in this way, the various types of information can be reached. This set of precepts written by means of a programming language is designated as a program.

Programming languages ​​are usually made up of a set of symbols and grammatical and semantic rules that define the current structures of the language and their meaning. From another perspective, computer languages ​​also include programming languages, a clear example of this is HTML, which is what fulfills certain instructions to carry out the content of different documents. The programming language can allow the precise specification of those data that must be operated by specific software under a varied scale of circumstances.

On the other hand, pseudocode is the algorithmic description language that uses the elementary conventions of a real programming language, but that is designed for human reading instead of reading through a machine, maintaining independence from any other type of programming language. The pseudo-code ignores details that are not considered essential for human understanding of the algorithm, such as system codes, variable declarations and even some subroutines. In this way, the programming language seeks to complement itself with precise descriptions in natural language or with compact mathematical notations.