Difference between revisions of "Modular arithmetic"

Line 1: Line 1:
'''Modular arithmetic''' a special type of arithmetic that involves only [[integers]]. If two integers <math>{a},{b}</math> leave the same remainder when they are divided by some positive integer <math>{m}</math>, we say that <math>{a}</math> and <math>b</math> are congruent [[modulo]] <math>{m}</math> or <math>a\equiv b \pmod {m}</math>. Sometimes we refer to the integers modulo n. This is symbolically represented by <math>\mathbb{Z}_n</math>.
+
'''Modular arithmetic''' is a special type of arithmetic that involves only [[integers]]. Given integers <math>a</math>, <math>b</math>, and <math>n</math>, with <math>n > 0</math>, we say that <math>a</math> is ''congruent to'' <math>b</math> ''modulo'' <math>n</math>, or <math>a \equiv b</math> (mod <math>n</math>), if the difference <math>{a - b}</math> is divisible by <math>n</math>.
  
  

Revision as of 21:47, 23 June 2006

Modular arithmetic is a special type of arithmetic that involves only integers. Given integers $a$, $b$, and $n$, with $n > 0$, we say that $a$ is congruent to $b$ modulo $n$, or $a \equiv b$ (mod $n$), if the difference ${a - b}$ is divisible by $n$.


Introductory

Useful Facts

Consider four integers ${a},{b},{c},{d}$ and a positive integer ${m}$ such that $a\equiv b\pmod {m}$ and $c\equiv d\pmod {m}$. In modular arithmetic, the following identities hold:

  • Addition: $a+c\equiv b+d\pmod {m}$.
  • Substraction: $a-c\equiv b-d\pmod {m}$.
  • Multiplication: $ac\equiv bd\pmod {m}$.
  • Division: $\frac{a}{e}\equiv \frac{b}{e}\pmod {\frac{m}{\gcd(m,e)}}$, where $e$ is a positive integer that divides ${a}$ and $b$.
  • Exponentiation: $a^e\equiv b^e\pmod {m}$ where $e$ is a positive integer.

Examples

  • ${7}\equiv {1} \pmod {2}$
  • $49^2\equiv 7^4\equiv (1)^4\equiv 1 \pmod {6}$
  • $7a\equiv 14\pmod {49}\implies a\equiv 2\pmod {7}$

Applications

Modular arithmetic is an extremely useful tool in mathematics competitions. It enables us to easily solve Linear diophantine equations, and it often helps with other Diophantine equations as well.


Intermediate

Topics

See also