Underlying Idea
Using the following observation, one can create a recursive algorithm that computes xn for an integer n using squaring and multiplication:

A brief analysis shows that such an algorithm uses log2n squarings and at most log2n multiplications. For n > about 4 this is computationally more efficient than naïvely multiplying the base with itself repeatedly.
Read more about this topic: Exponentiation By Squaring
Famous quotes containing the words underlying and/or idea:
“Comedy deflates the sense precisely so that the underlying lubricity and malice may bubble to the surface.”
—Paul Goodman (19111972)
“Enthusiastic partisans of the idea of progress are in danger of failing to recognize ... the immense riches accumulated by the human race.... By underrating the achievements of the past, they devalue all those which still remain to be accomplished.”
—Claude Lévi-Strauss (19081990)