An algorithm is a sequence of steps carried out in a certain order for solving a certain problem. There may be more than one way of solving the problem, of which an algorithm may be one. Not all problems can be solved by using an algorithm.
For example, we want to solve the quadratic equation![]()
We could use the quadratic
formula
In this case
so
Hence
or![]()
The above solution however was not obtained by the use of an algorithm. If we wanted to use an algorithm to solve the equation we could complete the square and make
the subject.
We can start by factorising with 3.
![]()
Use the identity
Now write![]()
We can collect the last two terms
so![]()
Now make x the subject. Add 13 over 36 to both sides.
![]()
Square root both sides, remembering that there are two square roots, one + and one -.
![]()
Subtract
from both sides.
![]()
Both methods give the same answer, but only the second method is the result of an algorithm.