Discrete Mathematics and Its Applications, Seventh Edition

Published by McGraw-Hill Education
ISBN 10: 0073383090
ISBN 13: 978-0-07338-309-5

Chapter 4 - Section 4.2 - Integer Representations and Algorithms - Exercises - Page 255: 25

Answer

In effect, this algorithm computes 7 mod 645, 72 mod 645, 74 mod 645, 78 mod 645, 716 mod 645, ... , and then multiplies (modulo 645) the required values. Since 644 = (1010000100)_2, we need to multiply together 74 mod 645, 7128 mod 645, and 7512 mod 645, reducing modulo 645 at each step. We compute by repeatedly squaring: 72 mod 645 = 49, 74 mod 645 = 492 mod 645 = 2401 mod 645 = 466, 78 mod 645 = 4662 mod 645 = 217156 mod 645 = 436, 716 mod 645 = 4362 mod 645 = 190096 mod 645 = 466. At this point we see a pattern with period 2, so we have 732 mod 645 = 436, 764 mod 645 = 466, 7128 mod 645 = 436, 7256 mod 645 = 466, and 7512 mod 645 = 436. Thus our final answer will be the product of 466, 436, and 436, reduced modulo 645. We compute these one at a time: 466 · 436 mod 645 = 203176 mod 645 = 1, and 1 · 436 mod 645 = 436. So 7644 mod 645 = 436.

Work Step by Step

In effect, this algorithm computes 7 mod 645, 72 mod 645, 74 mod 645, 78 mod 645, 716 mod 645, ... , and then multiplies (modulo 645) the required values. Since 644 = (1010000100)_2, we need to multiply together 74 mod 645, 7128 mod 645, and 7512 mod 645, reducing modulo 645 at each step. We compute by repeatedly squaring: 72 mod 645 = 49, 74 mod 645 = 492 mod 645 = 2401 mod 645 = 466, 78 mod 645 = 4662 mod 645 = 217156 mod 645 = 436, 716 mod 645 = 4362 mod 645 = 190096 mod 645 = 466. At this point we see a pattern with period 2, so we have 732 mod 645 = 436, 764 mod 645 = 466, 7128 mod 645 = 436, 7256 mod 645 = 466, and 7512 mod 645 = 436. Thus our final answer will be the product of 466, 436, and 436, reduced modulo 645. We compute these one at a time: 466 · 436 mod 645 = 203176 mod 645 = 1, and 1 · 436 mod 645 = 436. So 7644 mod 645 = 436.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.