Question: In part b , you derived that ( N ) = AN 1 ( 1 ) , so writing N 1 in the binary system,

In part b, you derived that (N)= AN1(1), so writing N 1 in the binary system, N 1= Pai2 j , we get: (N)= A N1(1)= A Paj2 j (1)=(A 2 j ) aj (1)=...(A 4) a2(A 2) a1(1) For clarity if we want to nd (23), it can be explained as follows: (23)= A 22(1)=(A 16)1(A 8)0(A 4)1(A 2)1(1)3 So, we just need to start from computing A2 and multiplying it by itself to get A4 and again multiply by itself to get A8 and so on. Instead of doing 22 matrix multiplications, we only do 6 multiplications to get A22. i) Implement the mentioned algorithm to rebuild your function in part d.is algorithm will allow us to speed up the execution time of the program. You will need to use your binary convert function in part h. j) Evaluate the algorithmic eciency of your code in part h in the same way you did in part f. I implemented the algorithm and ran it on my own computer and I have added my result below for your reference. k) How long will running your code for N =107 take using this algorithm? Compare your nding with part g. Algorithm maers!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!