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).

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
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
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,