Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started