If m = 2* is a power of 2, explain how you could use repeated squaring to compute am (mod n) for all n. Then apply your method to compute 1032 (mod 41).

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter10: Sequences, Series, And Probability
Section10.5: The Binomial Theorem
Problem 49E
icon
Related questions
Question

Help me fast

If m = 2* is a power of 2, explain how you could use repeated squaring
to compute am (mod n) for all n. Then apply your method to compute 102
(mod 41).
If m is not a power of 2, explain how you could use the results of the exercise
above to compute a™ (mod n) for any n. Then apply your method to compute
1726 (mod 44).
Transcribed Image Text:If m = 2* is a power of 2, explain how you could use repeated squaring to compute am (mod n) for all n. Then apply your method to compute 102 (mod 41). If m is not a power of 2, explain how you could use the results of the exercise above to compute a™ (mod n) for any n. Then apply your method to compute 1726 (mod 44).
Expert Solution
Step 1

a) We have m = 2k. First we illustrate the method of repeated squaring to compute am (mod n). Then we will compute 1032 (mod 41).
The following steps compute the value of am (mod n):

1. Write m as a sum of powers of 2,
m = u0 + u1.2 + u2.4 + u3.8 +...+ur.2r,
where each ui is either 0 or 1. (This is called the binary expansion of m.)

2.Make a table of powers of a modulo m using successive squaring.
   a1                       A0 (mod n)a2  (a1)2 = A02  A1 (mod n)a4  (a2)2 = A12  A2 (mod n)a8  (a4)2 = A22  A3 (mod n)...a2r  (a2r-1)2 = Ar-12  Ar (mod n)
Note that to compute each line of the table we only need to take the number at the end of
the previous line, square it, and then reduce it modulo m. Also note that the table has r + 1
lines, where r is the highest exponent of 2 appearing in the binary expansion of k in Step 1.

Step 2

3. The product A0u0, A1u1, A2u2, ..., Arur mod n, will be congruent to am (mod n). Note that all of the ui's are either 0 or 1, so this number is really just the product of those Ai's for which u1 is 1.
We compute
am  au0 + u1.2 + u2.4 + u3.8 +...+ur.2r      au0 + a2u1 + a4u2 + a8u3 +...+a2rur     A0u0 + A1u1 + A2u2 + ... + Arur


Now, we compute the value of 1032 (mod 41).
We can 32 as 32 = 0 + 0.2 + 0.22 + 0.23 + 0.24 + 1.25


steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Single Variable
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, advanced-math and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell