Answer to Question #93054 in C++ for siddharrth

Question #93054
How many multiplication operations will be enough for calculating 3^8 ?
1
Expert's answer
2019-08-23T06:59:40-0400

Answer is 3

We can use a method of binary exponentiation.

That is, we can decrease even power number of exponent dividing by 2, and replacing that operation with simple squaring.

In the task case we can see that

3^8 = 3^4 * 3^4 = (3^4)^2.

Continuing analogously, we get:

3^8 = (3^4)^2 = ((3^2)^2)^2

So 3 operations of squaring and then 3 multiplications. If we follow the process from bottom up,

3*3 = 9

9*9=81

81*81=6561



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS