7 junio, 2024

Quantitative algorithms: concept, characteristics, examples

We explain what quantitative algorithms are, their characteristics and give several examples

What are quantitative algorithms?

The quantitative algorithms are those algorithms that use algebraic operations and specific numerical calculations to define a process, obtaining specific values. For example, the result of a subtraction or a multiplication.

In computer science, mathematics and other related disciplines, an algorithm is a finite and ordered set of instructions that allows an activity to be carried out through successive steps that do not raise doubts for whoever must execute these actions, leading to the solution. of a certain problem.

It is significant to highlight the importance of algorithms, because they represent a basic element for computing, robotics and mathematics, since through them it is possible to order ideas. They lead to the correct execution of activities and ideas with an order, concerning any aspect.

Some examples in mathematics are the division algorithm to calculate the quotient of two numbers, the multiplication algorithm to calculate a product, Gauss’s method to solve a system of linear equations, or Euclid’s algorithm to obtain the greatest common divisor. of two integers.

Characteristics of quantitative algorithms

very precise

The steps and instructions that are contained in these algorithms must be very precise, that is, they must not leave any kind of margin for any ambiguity to exist, since mathematical operations do not admit it. In addition, being precise they allow the user to stick to a specific guide.

defined

Quantitative algorithms must be perfectly defined, that is, they must be able to be followed as many times as necessary, each time obtaining without a doubt the same desired result.

Otherwise, the algorithm as such will not be reliable, so it cannot serve as a guide for correct decision making.

Independent and autonomous

To carry out any computer program, it is convenient to previously design or define the algorithm. However, quantitative algorithms are completely independent and autonomous from programming languages.

For any problem that you want to solve, you can write the algorithm to run it later in any programming language, just as it can be run on different computers.

knowledge required

These algorithms usually require some previous numerical knowledge, mainly technical, because quantitative algorithms are often stated in a language that adapts to each case in question, except the simplest and most everyday ones.

On the other hand, having absolute confidence in some logical method for solving numerical problems could obviate solutions that are creative and more innovative, even though they may be unpredictable.

parts of an algorithm

Every algorithm has three distinct parts: input, process, and output. This allows the process to have a sequential order, which greatly reduces the range of possible errors, helping to solve problems that arise easier and faster.

Entrance: corresponds to the initial instructions that give rise to the algorithm, in which the initial data is taken and it is motivated to read it. It can also be called starting point, beginning or head.
Process: refers to the quantitative elaborations that the algorithm offers punctually. It is the corresponding body where the formulation of the instructions is carried out. It can also be called a sequence of statements.
Exit: Finally, there are the specific instructions that the algorithm dictates to show its results, that is, its resolutions or commands. It can also be called end or foot.

Steps to follow to develop a quantitative algorithm

All these steps are equally important. If you stop analyzing any of them, you will have problems during the development of the algorithm.

1. First step

Define what comparisons and/or numerical calculations are necessary to reach the final result:

All comparisons and intermediate numerical calculations. All final comparisons and numerical calculations.

2. Second step

Take into consideration all types of restrictions and conditions in order to reach the solution of the problem.

Differences with qualitative algorithm

Accuracy

Quantitative algorithms are quite precise, since the instructions that must be given to carry out the corresponding numerical calculations must be quite exact in order to obtain the desired result, as the mathematical language characterizes.

On the other hand, qualitative algorithms are more likely to have skipped a step or to be misinterpreted by the reader, because the narrative language used to indicate the instructions may have certain intrinsic inaccuracies.

steps or instructions

Algorithms are quantitative when they have instructions or steps that involve any kind of numerical computation. For example, the algorithm to solve the area of ​​a triangle, to solve the factorial of a natural number or to calculate the average of some data.

On the other hand, algorithms are qualitative when their instructions or steps do not involve numerical calculations. Examples: the instructions to make a cooking recipe, to carry out a physical activity or to assemble a device that comes disassembled from the factory.

Examples of quantitative algorithms

Perform the four basic arithmetic operations between two integers

Start. Declare (Number1, Number2, addition, subtraction, product): integer. Declare (division): real number. Enter the values ​​of the numbers (N1, N2). sum= Number1 + Number2. subtraction= Number1 – Number2. product= Number1 * Number2. division= Number1 / Number2. Show (addition, subtraction, product, division). End.

Get the area of ​​a triangle

Start. Declare (base, height, area_triangle): real numbers. Enter triangle values ​​(base, height). triangle_area= (base * height) / 2. Show (triangle_area). End.

Enter an age and get the year of birth as a result

Start. Declare (age, current_year, birth_year): natural numbers. Enter value of (age). Enter value of (current_year). birth_year = current_year – age. Show (birth_year). End.

Get the average of three natural numbers

Start. Declare (number1, number2, number3, add, average): natural numbers. Enter the values ​​of (number1, number2, number3). add= number1 + number2 + number3. average = add / 3. Show (add, average). End.

Calculate the sum and product of five integers

Start. Declare (number1, number2, number3, number4, number5, sum, product): integers. Enter the values ​​of (number1, number2, number3, number4, number5). sum= number1 + number2 + number3 + number4 + number5. product = number1 * number2 * number3 * number4 * number5. Show(sum, product). End.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *