Question: Bonus Question (for additional 20%) Write MMaple procedure SQbase that inputs integers (a, 1,m) and returns the value b-a mod m, implementing the agorithm of

 Bonus Question (for additional 20%) Write MMaple procedure SQbase that inputs

Bonus Question (for additional 20%) Write MMaple procedure SQbase that inputs integers (a, 1,m) and returns the value b-a mod m, implementing the agorithm of squaring the base a modulo m. Check that your procedure is working correctly by comparing your results with the Maple calculations for a_ 976431,n-8742 193,m= 2247431 that is, with > tme) 8742193 mod 2247431 b = MapleTime time)-11 b = 2057776 MapleTime:-4.282 Calculate the processor time (use Maple's time) command as above) for calculations of this number by your procedure and compare with the MapleTime. (HINT: this procedure would corespond to wrapping the method of calculations used in Question 2 into the envelope of Maple's Procedure where the calculations are done in the loop up to the length of the binary representation of the exponent n. For an example of a procedure with the loop see SplitBin in the Lecture 6 Notes.) Bonus Question (for additional 20%) Write MMaple procedure SQbase that inputs integers (a, 1,m) and returns the value b-a mod m, implementing the agorithm of squaring the base a modulo m. Check that your procedure is working correctly by comparing your results with the Maple calculations for a_ 976431,n-8742 193,m= 2247431 that is, with > tme) 8742193 mod 2247431 b = MapleTime time)-11 b = 2057776 MapleTime:-4.282 Calculate the processor time (use Maple's time) command as above) for calculations of this number by your procedure and compare with the MapleTime. (HINT: this procedure would corespond to wrapping the method of calculations used in Question 2 into the envelope of Maple's Procedure where the calculations are done in the loop up to the length of the binary representation of the exponent n. For an example of a procedure with the loop see SplitBin in the Lecture 6 Notes.)

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 Databases Questions!