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 Problem | Binary exponentiation Recall the exponentiation algorithm given in class for Z, m,n evaluating an (mod m) (a Z, m,n N): 1. Compute the binary N):

1. Compute the binary representation of n: n = b0 2k + b1 2k-1 + ... + bk-1 2 + bk , with b0 = 1, i representation of n: n = b0 2k + b1 2k-1 + ... {0, 1} for 1 + bk-1 2 + bk , with b0 = 1, i {0, i 1} for 1 i k, and k = 2. Initialize r0 a k, and k = (mod m). 3. For 0 i k -1 compute 4. Output rk. 2. Initialize r0 (a) To warm up with a toy example, compute 1711 (mod 77) a (mod m).

3. For 0 using the procedure above; answers that don't use the binary exponentiation algorithm i will receive no credit, even if they are correct. Show all your k -1 compute work, and write down all your intermediate quanti- ties bi and ri.

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 Your answer should be an integer between 0 and 76. (b) In i this problem, you will formally prove that the binary exponentiation algorithm is k -1. Use induction on i to prove that correct. i. Define s0 = 1 and si+1 = 2si + bi+1 ii. (4 marks) Let ri , 0 for 0 i k -1. Use induction on i to prove that i ii. (4 marks) Let ri , 0 i k, be defined as k, be defined as in steps 2 and 3 of the exponentiation algorithm. Use induction on i to prove that ri in steps 2 and 3 of the exponentiation algorithm. Use induction on asi (mod m) for 0 i to prove that ri asi (mod m) for 0 i k. i iii. (2 marks) Prove that an rk (mod m), so the algorithm k.

iii. (2 marks) Prove that an above does indeed compute an (mod m) as claimed. Note: Sorry for 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 text

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!