# Lecture 7: Modular Algorithms

This lecture introduces an algorithmic concept, called modular algorithms,
that are commonly used in computer algebra systems such as Maple. A modular
algorithm performs a computation over a domain, such as the integers or
integral polynomials, by computing the result in a set of homomorphic
images, e.g. modulo a set of primes, and uses the results in the "modular"
domains to construct the result for the original problem using the
using the Chinese Remainder algorithm, interpolation, or a similar
construction.

### Background Material

### Reading

Also review Maple's chrem and interpolation (interp and the newer
PolynomialInterpolation) functions.
### Topics

- Chinese Remainder Theorem (CRT)
- Existence proof
- Constructive proof using the Extended Euclidean algorithm

- Modular algorithm for integer multiplication
- Reduce inputs mod sufficiently many primes (wordsize)
- Multiply mod the primes
- Recover integer product using the CRT

### Maple worksheets and programs and other resources

- mod.mws - Maple worksheet on modular arithmetic,
fast powering, the CRT, and modular algorithms
- mod.ppt (mod.pdf) - slides on modular arithmetic

### Assignments

Created: Oct. 20, 2005 by jjohnson@cs.drexel.edu