Question: For this problem consider raising an integer a to the power n (another positive integer). Let a^n express the output to this problem. 1. Express

For this problem consider raising an integer a to the power n (another positive integer). Let a^n express the output to this problem. 1. Express this problem formally with input and output conditions. 2. Describe a simple brute force algorithm to compute this product. How many multiplications does it take asymptotically in the worst case? 3. Assume for the moment that n > 1 and is even. Express the value of a^n as a product of two subproblems. 4. Now assume n > 1 and is odd. Express the value of a^n as a product of two subproblems (and possibly other terms). 5. State a self-reduction for your problem. 6. State a recursive algorithm that solves the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
