# Computational complexity

Chapter
Part of the Universitext book series (UTX)

In Chapter 1 we have recalled some basic notions about natural, integer, rational numbers, and about the operations on numbers. The need to solve concrete problems leads, as we have discussed in § 1.2, to devise mathematical models; they in turn pose the question of developing computing procedures, which may be very complex, but that in any case result in the solution of the studied problem in finitely many steps. Such a procedure is called an algorithm, from the name of the Arab-language mathematician and astronomer al-Khowarizmi, who lived in the 9th century. This is a good moment to pose the main question: which is the cost of an algorithm, in terms of effort and time needed to execute its steps from the beginning to the end of the necessary operations? For instance, if we use a computer to perform the computations, which is the cost of a given algorithm, in terms of computation time and programming difficulty? Is there a mathematically sound way to distinguish good algorithms, those requiring little time and little programming effort, from those requiring too much time, in relative or absolute terms, for their execution?

As we have said, an algorithm is just a finite sequence of elementary operations. Thus, in order to answer the above questions, that is to say, to determine the computational complexity of a given algorithm, it is necessary to calculate with precision the number of basic operations composing the algorithm. Multiplying this number by the time taken to program or perform a single basic operation with the available computing devices, we obtain a measure of the total time needed to perform the calculations the algorithm consists of. Notice that, while this measure of complexity is crucially affected by the characteristics of the computing devices we are using, the computational complexity is an intrinsic property of the algorithm. In any case, the computation time of an algorithm is proportional to its computational complexity, and the ratio is determined by the characteristics of the computing devices.

## Keywords

Computational Complexity Computing Device Integer Number Great Common Divisor Elementary Operation
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.