Lably
Skip to content

Residue number system

  • 3 min read
  • 3 chapters

Related on Lably

Through Numeral system, Integer and Modular arithmetic

Multi-modular arithmetic is widely used for computation with large integers, typically in linear algebra, because it provides faster computation than with the usual numeral systems, even when the time for converting between numeral systems is taken into account. Other applications of multi-modular arithmetic include polynomial greatest common divisor, Gröbner basis computation and cryptography.

Definition

A residue numeral system is defined by a set of k integers

{m1,m2,m3,…,mk},

called the moduli, which are generally supposed to be pairwise coprime (that is, any two of them have a greatest common divisor equal to one). Residue number systems have been defined for non-coprime moduli, but are not commonly used because of worse properties. Therefore, they will not be considered in the remainder of this article.

An integer x is represented in the residue numeral system by the set of its remainders

{x1,x2,x3,…,xk}

under Euclidean division by the moduli. That is

xi=xmod⁡mi,

and

0≤xi<mi

for every i

Let M be the product of all the mi. Two integers whose difference is a multiple of M have the same representation in the residue numeral system defined by the mis. More precisely, the Chinese remainder theorem asserts that each of the M different sets of possible residues represents exactly one residue class modulo M. That is, each set of residues represents exactly one integer X in the interval 0,…,M−1. For signed numbers, the dynamic range is −⌊M/2⌋≤X≤⌊(M−1)/2⌋ (when M is even, generally an extra negative value is represented).

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Calculus and analysis