Skip to main content
Select Source:

modular arithmetic

modular arithmetic (residue arithmetic) Arithmetic based on the concept of the congruence relation defined on the integers and used in computing to circumvent the problem of performing arithmetic on very large numbers.

Let m1, m2,…, mk be integers, no two of which have a common factor greater than one. Given a large positive integer n it is possible to compute the remainders or residues r1, r2,…, rk such that nr1 (mod m1) nr2 (mod m2) … nrk (mod mk)

Provided n is less than m1 × m2 × … × mk

n can be represented by (r1,r2,…,rk)

This can be regarded as an internal representation of n. Addition, subtraction, and multiplication of two large numbers then involves the addition, subtraction, and multiplication of corresponding pairs, e.g. (r1,…,rk) + (s1,…,sk) = (r1 + s1, …, rk + sk)

Determining the sign of an integer or comparing relative magnitudes are less straightforward.

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"modular arithmetic." A Dictionary of Computing. . Encyclopedia.com. 19 Sep. 2018 <http://www.encyclopedia.com>.

"modular arithmetic." A Dictionary of Computing. . Encyclopedia.com. (September 19, 2018). http://www.encyclopedia.com/computing/dictionaries-thesauruses-pictures-and-press-releases/modular-arithmetic

"modular arithmetic." A Dictionary of Computing. . Retrieved September 19, 2018 from Encyclopedia.com: http://www.encyclopedia.com/computing/dictionaries-thesauruses-pictures-and-press-releases/modular-arithmetic

Learn more about citation styles

Citation styles

Encyclopedia.com gives you the ability to cite reference entries and articles according to common styles from the Modern Language Association (MLA), The Chicago Manual of Style, and the American Psychological Association (APA).

Within the “Cite this article” tool, pick a style to see how all available information looks when formatted according to that style. Then, copy and paste the text into your bibliography or works cited list.

Because each style has its own formatting nuances that evolve over time and not all information is available for every reference entry or article, Encyclopedia.com cannot guarantee each citation it generates. Therefore, it’s best to use Encyclopedia.com citations as a starting point before checking the style against your school or publication’s requirements and the most-recent information available at these sites:

Modern Language Association

http://www.mla.org/style

The Chicago Manual of Style

http://www.chicagomanualofstyle.org/tools_citationguide.html

American Psychological Association

http://apastyle.apa.org/

Notes:
  • Most online reference entries and articles do not have page numbers. Therefore, that information is unavailable for most Encyclopedia.com content. However, the date of retrieval is often important. Refer to each style’s convention regarding the best way to format page numbers and retrieval dates.
  • In addition to the MLA, Chicago, and APA styles, your school, university, publication, or institution may have its own requirements for citations. Therefore, be sure to refer to those guidelines when editing your bibliography or works cited list.

residue arithmetic

residue arithmetic Another name for modular arithmetic.

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"residue arithmetic." A Dictionary of Computing. . Encyclopedia.com. 19 Sep. 2018 <http://www.encyclopedia.com>.

"residue arithmetic." A Dictionary of Computing. . Encyclopedia.com. (September 19, 2018). http://www.encyclopedia.com/computing/dictionaries-thesauruses-pictures-and-press-releases/residue-arithmetic

"residue arithmetic." A Dictionary of Computing. . Retrieved September 19, 2018 from Encyclopedia.com: http://www.encyclopedia.com/computing/dictionaries-thesauruses-pictures-and-press-releases/residue-arithmetic

Learn more about citation styles

Citation styles

Encyclopedia.com gives you the ability to cite reference entries and articles according to common styles from the Modern Language Association (MLA), The Chicago Manual of Style, and the American Psychological Association (APA).

Within the “Cite this article” tool, pick a style to see how all available information looks when formatted according to that style. Then, copy and paste the text into your bibliography or works cited list.

Because each style has its own formatting nuances that evolve over time and not all information is available for every reference entry or article, Encyclopedia.com cannot guarantee each citation it generates. Therefore, it’s best to use Encyclopedia.com citations as a starting point before checking the style against your school or publication’s requirements and the most-recent information available at these sites:

Modern Language Association

http://www.mla.org/style

The Chicago Manual of Style

http://www.chicagomanualofstyle.org/tools_citationguide.html

American Psychological Association

http://apastyle.apa.org/

Notes:
  • Most online reference entries and articles do not have page numbers. Therefore, that information is unavailable for most Encyclopedia.com content. However, the date of retrieval is often important. Refer to each style’s convention regarding the best way to format page numbers and retrieval dates.
  • In addition to the MLA, Chicago, and APA styles, your school, university, publication, or institution may have its own requirements for citations. Therefore, be sure to refer to those guidelines when editing your bibliography or works cited list.

Modular Arithmetic

Modular Arithmetic

Modular arithmetic derives from the concept of congruence modulo m, written symbolically as

a =̅ b (mod m)

where a and b are any integers and m is a positive integer greater than 1. This means that a - b is divisible by m. For example,

36 =̅ 16 (mod 5)

since 36 - 16 = 20 is divisible by 5. Likewise 11 =̅ 38 (mod 9) because 11-38 = -27 is divisible by 9.

The concept of congruence was first used by Carl Friedrich Gauss (1755-1855). Gauss was a mathematician as well as a master of astronomy, physics, geodesy, and statistics. He lived in Germany and for many years was director of the university observatory in Göttingen.

Many of the properties of equality are also true for congruences. For example, consider modulo 5.

Since 5 =̅ 0 (mod 5), 6 =̅ 1 (mod 5), 7 =̅ 2 (mod 5), etc., we need only consider the set, called a complete residue set. Then, for example,

1 + 2 = 3, 3 + 4 = 2 [since 7 =̅ 2 (mod 5)], and 2 × 3 = 1 [since 6 =̅ 1 (mod 5)].

Indeed, we can produce tables for addition and multiplication. Where we note that not only do we have

a + b = b + a and a × b = b × a

for all a and b in the set (addition and multiplication are commutative), but less obviously, we have associatively

a + (b + c) = (a + b) + c and a × (b × c)= (a × b) × c

and distributivity

a × (b + c)= a × b + a × c

again for all a, b, c in the set. Furthermore, we have an additive identity, 0, such that a + 0 = 0 + a for all a in the set and a multiplicative identity, 1, such that a × l = l × a for a in the set. We can also see that we have both additive and multiplicative inverses. That is, for any a in we have a b such that

a + b = b + a = 0

and a c such that

a × c = c × a = 1

for any a in {1, 2, 3, 4}. Specifically we have

1 + 4 = 0, 2 + 3 = 0, 3 + 2 = 0, and 4 + 1 = 0 and l × 1 = 1, 2 × 3 = 1, 3 × 2 = 1, and 4 × 4 = 1

A system in which an addition and a multiplication are defined and for which the commutative, associative, and distributive properties hold, where there exist identities for addition and multiplication, where every element has an additive inverse, and every nonzero element has a multiplicative inverse, is called a field. Other examples of fields are the set of rational numbers and the set of real numbers. Since the number of elements in our set is finite, we have an example of finite field.

Do these results hold for an J complete residue set? Indeed they do, except for the existence of multiplicative inverses. Thus, if we consider the complete residue system mod 4 (0, 1, 2, 3) we see that there is no multiplicative inverse for 2 since 2 × 0 = 0,2 × l = 2,2 × 2 = 0 [(because4 =̅ 0(mod4)] and 2 × 3 = 2.

In order for multiplicative inverses to exist in a complete residue system mod m, it is necessary and sufficient for m to be a prime, or a number whose only divisors are 1 and m. Thus 2, 3, 5, 7, 11, and 13 are all primes but 4, 6, 8 and 9 are not.

The concept of congruence can be used to establish a rule for deciding whether a number is divisible by 9. A number is divisible by 9 if and only if the sum of its digits is divisible by 9. Thus, for example, 243,648 is divisible by 9 because 2 + 4 + 3 + 6 + 4 + 8 = 27 is divisible by 9 whereas 243,649 is not because 28 is not divisible by 9. A proof of this fact depends upon the fact that 10 =̅ 1 (mod 9).

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"Modular Arithmetic." The Gale Encyclopedia of Science. . Encyclopedia.com. 19 Sep. 2018 <http://www.encyclopedia.com>.

"Modular Arithmetic." The Gale Encyclopedia of Science. . Encyclopedia.com. (September 19, 2018). http://www.encyclopedia.com/science/encyclopedias-almanacs-transcripts-and-maps/modular-arithmetic-0

"Modular Arithmetic." The Gale Encyclopedia of Science. . Retrieved September 19, 2018 from Encyclopedia.com: http://www.encyclopedia.com/science/encyclopedias-almanacs-transcripts-and-maps/modular-arithmetic-0

Learn more about citation styles

Citation styles

Encyclopedia.com gives you the ability to cite reference entries and articles according to common styles from the Modern Language Association (MLA), The Chicago Manual of Style, and the American Psychological Association (APA).

Within the “Cite this article” tool, pick a style to see how all available information looks when formatted according to that style. Then, copy and paste the text into your bibliography or works cited list.

Because each style has its own formatting nuances that evolve over time and not all information is available for every reference entry or article, Encyclopedia.com cannot guarantee each citation it generates. Therefore, it’s best to use Encyclopedia.com citations as a starting point before checking the style against your school or publication’s requirements and the most-recent information available at these sites:

Modern Language Association

http://www.mla.org/style

The Chicago Manual of Style

http://www.chicagomanualofstyle.org/tools_citationguide.html

American Psychological Association

http://apastyle.apa.org/

Notes:
  • Most online reference entries and articles do not have page numbers. Therefore, that information is unavailable for most Encyclopedia.com content. However, the date of retrieval is often important. Refer to each style’s convention regarding the best way to format page numbers and retrieval dates.
  • In addition to the MLA, Chicago, and APA styles, your school, university, publication, or institution may have its own requirements for citations. Therefore, be sure to refer to those guidelines when editing your bibliography or works cited list.

Modular Arithmetic

Modular arithmetic

Modular arithmetic derives from the concept of congruence modulo m, written symbolically as

where a and b are any integers and m is a positive integer greater than 1. This means that a - b is divisible by m. For example,

since 36 - 16 = 20 is divisible by 5. Likewise 11 ≡38 (mod 9) because 11-38 = -27 is divisible by 9.

The concept of congruence was first used by Carl Friedrich Gauss (1755-1855). Gauss was a mathematician as well as a master of astronomy , physics , geodesy, and statistics . He lived in Germany and for many years was director of the university observatory in Göttingen.

Many of the properties of equality are also true for congruences. For example, consider modulo 5. Since 5 ≡ 0 (mod 5), 6 ≡ 1 (mod 5), 7 ≡ 2 (mod 5), etc., we need only consider the set, called a complete residue set. Then, for example,

Indeed, we can produce tables for addition and multiplication . Where we note that not only do we have

for all a and b in the set (addition and multiplication are commutative), but less obviously, we have associatively

and distributivity

again for all a, b, c in the set. Furthermore, we have an additive identity, 0, such that a + 0 = 0 + a for all a in the set and a multiplicative identity, 1, such that a × l = l × a for a in the set. We can also see that we have both additive and multiplicative inverses. That is, for any a in we have a b such that

and a c such that

for any a in {1, 2, 3, 4}. Specifically we have

and

A system in which an addition and a multiplication are defined and for which the commutative, associative, and distributive properties hold, where there exist identities for addition and multiplication, where every element has an additive inverse, and every non-zero element has a multiplicative inverse, is called a field . Other examples of fields are the set of rational numbers and the set of real numbers . Since the number of elements in our set is finite, we have an example of finite field.

Do these results hold for an J complete residue set? Indeed they do, except for the existence of multiplicative inverses. Thus, if we consider the complete residue system mod 4 (0, 1, 2, 3) we see that there is no multiplicative inverse for 2 since 2 × 0 = 0, 2 × l = 2, 2 × 2 = 0 [(because 4 ≡ 0 (mod 4)] and 2 × 3 = 2.

In order for multiplicative inverses to exist in a complete residue system mod m, it is necessary and sufficient for m to be a prime, or a number whose only divisors are 1 and m. Thus 2, 3, 5, 7, 11, and 13 are all primes but 4, 6, 8 and 9 are not.

The concept of congruence can be used to establish a rule for deciding whether a number is divisible by 9. A number is divisible by 9 if and only if the sum of its digits is divisible by 9. Thus, for example, 243,648 is divisible by 9 because 2 + 4 + 3 + 6 + 4 + 8 = 27 is divisible by 9 whereas 243,649 is not because 28 is not divisible by 9. A proof of this fact depends upon the fact that 10 ≡ 1 (mod 9).

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"Modular Arithmetic." The Gale Encyclopedia of Science. . Encyclopedia.com. 19 Sep. 2018 <http://www.encyclopedia.com>.

"Modular Arithmetic." The Gale Encyclopedia of Science. . Encyclopedia.com. (September 19, 2018). http://www.encyclopedia.com/science/encyclopedias-almanacs-transcripts-and-maps/modular-arithmetic

"Modular Arithmetic." The Gale Encyclopedia of Science. . Retrieved September 19, 2018 from Encyclopedia.com: http://www.encyclopedia.com/science/encyclopedias-almanacs-transcripts-and-maps/modular-arithmetic

Learn more about citation styles

Citation styles

Encyclopedia.com gives you the ability to cite reference entries and articles according to common styles from the Modern Language Association (MLA), The Chicago Manual of Style, and the American Psychological Association (APA).

Within the “Cite this article” tool, pick a style to see how all available information looks when formatted according to that style. Then, copy and paste the text into your bibliography or works cited list.

Because each style has its own formatting nuances that evolve over time and not all information is available for every reference entry or article, Encyclopedia.com cannot guarantee each citation it generates. Therefore, it’s best to use Encyclopedia.com citations as a starting point before checking the style against your school or publication’s requirements and the most-recent information available at these sites:

Modern Language Association

http://www.mla.org/style

The Chicago Manual of Style

http://www.chicagomanualofstyle.org/tools_citationguide.html

American Psychological Association

http://apastyle.apa.org/

Notes:
  • Most online reference entries and articles do not have page numbers. Therefore, that information is unavailable for most Encyclopedia.com content. However, the date of retrieval is often important. Refer to each style’s convention regarding the best way to format page numbers and retrieval dates.
  • In addition to the MLA, Chicago, and APA styles, your school, university, publication, or institution may have its own requirements for citations. Therefore, be sure to refer to those guidelines when editing your bibliography or works cited list.