It might seem that multiplications are needed to compute , since
But observe that, for instance, since . Thus can be computed using three multiplications: one to compute , one to compute ,
To findout the contain nth power of x and resulting squares by using multiplication algorithms.
The Input of the algorithm is real number x and a positive integer n.
First using the algorithm that determines the binary representation of n.
by repetitively squaring x and the resulting squares
To find out the contain nth power of x and resulting squares by using multiplication algorithms.
Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!Get Started