An algorithm is a procedure (a finite set of well-defined instructions) for accomplishing some task which, given an initial state, will terminate in a defined end-state. The computational complexity and efficient implementation of the algorithm are important in computing, and this depends on suitable data structures.
Informally, the concept of an algorithm is often illustrated by the example of a recipe, although many algorithms are much more complex; algorithms often have steps that repeat (iterate) or require decisions (such as logic or comparison). Algorithms can be composed to create more complex algorithms.
The concept of an algorithm originated as a means of recording procedures for solving mathematical problems such as finding the common divisor of two numbers or multiplying two numbers. The concept was formalized in 1936 through Alan Turing's Turing machines and Alonzo Church's lambda calculus, which in turn formed the foundation of computer science.
Most algorithms can be directly implemented by computer programs; any other algorithms can at least in theory be simulated by computer programs. In many programming languages, algorithms are implemented as functions or procedures.
This is a graph of a portion of the complex-valued Riemann zeta function along the critical line (the set of complex numbers having real part equal to 1/2). More specifically, it is a graph of Im ζ(1/2 + it) versus Re ζ(1/2 + it) (the imaginary part vs. the real part) for values of the real variable t running from 0 to 34 (the curve starts at its leftmost point, with real part approximately −1.46 and imaginary part 0). The first five zeros along the critical line are visible in this graph as the five times the curve passes through the origin (which occur at t ≈ 14.13, 21.02, 25.01, 30.42, and 32.93 — for a different perspective, see a graph of the real and imaginary parts of this function plotted separately over a wider range of values). In 1914, G. H. Hardy proved that ζ(1/2 + it) has infinitely many zeros. According to the Riemann hypothesis, zeros of this form constitute the only non-trivial zeros of the full zeta function, ζ(s), where s varies over all complex numbers. Riemann's zeta function grew out of Leonhard Euler's study of real-valued infinite series in the early 18th century. In a famous 1859 paper called "On the Number of Primes Less Than a Given Magnitude", Bernhard Riemann extended Euler's results to the complex plane and established a relation between the zeros of his zeta function and the distribution of prime numbers. The paper also contained the previously mentioned Riemann hypothesis, which is considered by many mathematicians to be the most important unsolved problem in pure mathematics. The Riemann zeta function plays a pivotal role in analytic number theory and has applications in physics, probability theory, and applied statistics.