Question
Problem | Binary exponentiation Recall the exponentiation algorithm given in class for evaluating a n (mod m) (a Z, m,n N): 1. Compute the binary
Problem | Binary exponentiation Recall the exponentiation algorithm given in class for evaluating an (mod m) (a Z, m,n N):
1. Compute the binary representation of n: n = b0 2k + b1 2k-1 + ... + bk-1 2 + bk , with b0 = 1, i {0, 1} for 1 i k, and k = 2. Initialize r0 a (mod m).
3. For 0 i k -1 compute
4. Output rk.
(a) To warm up with a toy example, compute 1711 (mod 77) using the procedure above; answers that don't use the binary exponentiation algorithm will receive no credit, even if they are correct. Show all your work, and write down all your intermediate quanti- ties bi and ri. Your answer should be an integer between 0 and 76.
(b) In this problem, you will formally prove that the binary exponentiation algorithm is correct.
i. Define s0 = 1 and si+1 = 2si + bi+1 for 0 i k -1. Use induction on i to prove that ii. (4 marks) Let ri , 0 i k, be defined as in steps 2 and 3 of the exponentiation algorithm. Use induction on i to prove that ri asi (mod m) for 0 i k.
iii. (2 marks) Prove that an rk (mod m), so the algorithm above does indeed compute an (mod m) as claimed.
Note: Sorry for the confusion. I have updated the questions. Hopefully, you can see them clearly now. Thanks.
Transcribed image textStep 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