🌐
American Institute of Mathematics
aimath.org › news › congruentnumbers › modulo.html
Congruence basics
We say integers a and b are "congruent modulo n" if their difference is a multiple of n. For example, 17 and 5 are congruent modulo 3 because 17 - 5 = 12 = 4⋅3, and 184 and 51 are congruent modulo 19 since 184 - 51 = 133 = 7⋅19. We often write this as 17 ≡ 5 mod 3 or 184 ≡ 51 mod 19.
🌐
UCI Mathematics
math.uci.edu › ~ndonalds › math180a › 3congruence.pdf pdf
3 Congruences and Congruence Equations
Example 3.17. Consider the quadratic equation x2 + 3x ≡0 (mod 10). One can easily check by · plugging in the remainders 0, . . . , 9 that the solutions to this equation are ... This is perhaps surprising, since we are used to quadratic equations having at most two solutions. Now consider the same equation modulo the prime divisors of 10. Since 10|d ⇐⇒2|d and 5|d, we ... For general polynomial congruences, the same sort of thing is true.
🌐
UBC Math
personal.math.ubc.ca › ~PLP › book › sec-congruence.html
Congruence modulo n
Many results about divisibility of integers involve a fair bit of tedious work involving proof by cases; Result 5.2.5 is a good example of this. In that case we are interested in divisibility by 3 and so we use Euclidean division to separate the integers into 3 cases depending on their remainder. Much of that work can be simplified by introducing congruence. ... Let \(a,b \in \mathbb{Z}\) and \(n \in \mathbb{N}\text{.}\) We say that \(a\) is congruent to \(b\) modulo \(n\) when \(n\mid(a-b)\text{.}\) The “n” is refered to as the modulus and we write the congruence as \(a \equiv b \mod n\text{.}\)
🌐
Whitman College
whitman.edu › mathematics › higher_math_online › section03.01.html
3.1 Congruence
Then $k$ is congruent modulo 4 to exactly one of $0,1,2$ or $3$, so $k^2$ is congruent to $0^2=0$, $1^2=1$, $2^2\equiv 0$ or $3^2\equiv 1$, so it is never congruent to $2$ or $3$. $\square$ Example 3.1.5 Find all integers $x$ such that $3x-5$ is divisible by $11$. Put in somewhat more familiar terms, we are trying to solve the congruence $3x\equiv 5\pmod {{11}}$ for $x$, much as we might try to solve an equation for an unknown.
🌐
Wikipedia
en.wikipedia.org › wiki › Modular_arithmetic
Modular arithmetic - Wikipedia
3 days ago - If a ≡ b (mod m) and a−1 exists, then a−1 ≡ b−1 (mod m) (compatibility with multiplicative inverse, and, if a = b, uniqueness modulo m). If ax ≡ b (mod m) and a is coprime to m, then the solution to this linear congruence is given ...
🌐
University of Houston
math.uh.edu › ~pwalker › 3336Sp21Sec4.4Slides.pdf pdf
© 2019 McGraw-Hill Education Solving Congruences Section 4.4
Example: What are the solutions of the congruence 3x≡4( mod 7). Solution: We found that −2 is an inverse of 3 modulo 7 (two slides back). We multiply both sides of the congruence by −2 giving ... We need to determine if every x with x ≡6 (mod 7) is a solution.
🌐
Okstate
math.okstate.edu › people › binegar › 3613 › 3613-l11.pdf pdf
LECTURE 11 Congruence and Congruence Classes
yields another example of an equivalence relation. Definition 11.2. Let a, b, n ∈Z with n > 0. Then a is congruent to b modulo n; ... The following theorem tells us that the notion of congruence defined above is an equivalence relation on the
🌐
Wolfram MathWorld
mathworld.wolfram.com › Congruence.html
Congruence -- from Wolfram MathWorld
June 6, 2024 - Using congruences, simple divisibility tests to check whether a given number is divisible by another number can sometimes be derived. For example, if the sum of a number's digits is divisible by 3 (9), then the original number is divisible by 3 (9).
Find elsewhere
🌐
Reddit
reddit.com › r/explainlikeimfive › eli5: how does a congruence modulo work?
r/explainlikeimfive on Reddit: ELI5: How does a congruence modulo work?
July 20, 2020 -

I think I understand the basics of the modulo function. Assuming modulo 3 when counting up you'd go 0 > 1 > 2 > 0 ...

But then I see this equation:

a ≡ b (mod n)

And have trouble understanding it. I'm pretty sure it means that a and b have a congruent relationship when a modulo function of n is applied to them. But I'm not sure if this is correct, and what a congruent relationship is.

Thanks!

Top answer
1 of 3
1
I'm pretty sure it means that a and b have a congruent relationship when a modulo function of n is applied to them Yes, that's correct. All that means is that if you take a and b and remove as many factors of n as possible from each one, you get the same thing. For example, 1 ≡ 3 (mod 2) and 9 ≡ 5 (mod 4).
2 of 3
1
So, a ≡ b (mod n) simply means that (a-b) is divisible by n. This is equivalent to saying that if you apply the modulo n function to both a and b then you get the same result. You can easily check and see that this relation has three properties: If a ≡ b (mod n) then b ≡ a (mod n), because b-a is also divisible by n. This is called symmetry. a ≡ a (mod n) for every a, because a-a is always divisible by n. This is called reflexivity. If a ≡ b (mod n) and b ≡ c (mod n) then a ≡ c (mod n), because c-a = (c-b)-(a-b) which is divisible by n. This is called transitivity. A relation that has these three properties is called a equivalence relation. Why? Because it means that if two elements are in relation to each other, then they are "equivalent" in regards to that relation. Another cool thing is that when you an equivalence relation, you can group the elements into equivalence classes - divide all the elements into sets so that two elements are in the same set if and only if they are equivalent. Now, the modulo relation has another cool property - it preserves the algebraic operations. If a ≡ b (mod n) and c ≡ d (mod n) then a+c ≡ b+d (mod n), and the same goes for multiplication. In this case, the relation is called a congruence relation. This means that if you want to calculate (a+b) (mod n) then you can calculate a (mod n) + b (mod n) and apply (mod n) to that, and you'll get the same result.
Top answer
1 of 4
4

There are many ways to solve the problem. The conceptually simplest, but most tedious, is to test one by one the possibilities $x\equiv 0\pmod{5}$, $x\equiv 1\pmod{5}$, and so on up to $x\equiv 4\pmod{5}$. Quickly we find that $x\equiv 4\pmod{5}$. (This approach would become quite unpleasant if $5$ were replaced by $97$.)

It is simpler to use some algebra. So rewrite as $2x\equiv 3\pmod{5}$. Since $3\equiv 8\pmod{5}$, it is convenient to rewrite the congruence as $2x\equiv 8\pmod{5}$. Then since $2$ and $5$ are relatively prime, we can divide by $2$, getting $x\equiv 4\pmod{5}$.

A fancier version is to start from $2x\equiv 3\pmod{5}$. Now multiply both sides by $3$ (the modular inverse of $2$). We get $6x\equiv 9\pmod{5}$. But $6\equiv 1\pmod{5}$ and $9\equiv 4\pmod{5}$, so we conclude that $x\equiv 4\pmod{5}$.

Remark: We used congruence notation throughout, since it is very important to get accustomed to it. But $2x\equiv 3\pmod{5}$ means that $5$ divides $2x-3$. So we want to solve $2x-3=5k$, that is, $2x=3+5k$. So we want to find a $k$ such that $3+5k$ is divisible by $2$. It is clear that $k=1$ works, giving $2x=8$ so $x=4$. Any number congruent to $4$ modulo $5$ will also work, giving answer $x\equiv 4\pmod{5}$.

2 of 4
1

Hint $\ {\rm mod}\,\ 2k\!-\!1\!:\,\ 2k\!-\!1\equiv 0\,\Rightarrow\, \color{#c00}{2k\equiv 1},\ $ so $\, k\equiv 2^{-1}.\,$ Therefore, as usual, we can solve

the linear equation $\ 2x\equiv b\ $ by scaling it by $\, 2^{-1}\equiv k\,$ to get $\, x\equiv (\color{#c00}{2k})x \equiv kb.$

🌐
Cornell Computer Science
cs.cornell.edu › courses › cs2800 › 2016sp › lectures › lec12-modular.html
Modular arithmetic (CS 2800, Spring 2016)
Super important: Whenever defining functions on equivalence classes this way, you must check that the function is well defined (as we did for addition). Always check that choosing different representatives gives the same answer. ... Example (still mod 5): [3][4]=[12].
Top answer
1 of 4
17

Mathematically, congruence modulo $n$ is an equivalence relation. We define:

$$a\equiv b \pmod n \iff n\mid (a - b)$$

Equivalently: When working in $\pmod n$, any number $a$ is congruent $\mod n$ to an integer $b$ if there exists an integer $k$ for which $\;nk = (a - b)$.

Now, let's compare the "discrepancies" in the equivalences you note (which are, in fact, all true):


$$13 \equiv \color{blue}{\bf 1} \pmod 4 \iff 4\mid (13-1) \iff 4\mid 12\; \checkmark$$ $$13\equiv \color{blue}{\bf 5} \pmod 4 \iff 4\mid (13-5) \iff 4\mid 8 \;\checkmark$$

  • Note, indeed, that $\color{blue}{\bf 5 \equiv 1} \pmod 4$ since $4\mid(5 - 1) = 4$ $$ $$

$$9 \equiv \color{blue}{\bf 4} \pmod 5 \iff 5 \mid (9-4) \iff 5\mid 5 \;\checkmark$$ $$9 \equiv \color{blue}{\bf -1} \pmod 5 \iff 5 \mid (9 - (-1)) \iff 5\mid 10 \;\checkmark$$

  • And again, note that $\color{blue}{\bf4 \equiv -1} \pmod 5$ since $5\mid(4-(-1)) = 5$ $$ $$

It is often customary to express equivalence modulo $n$, by choosing $b$ in $\;a \equiv b \pmod n\;$ to be such that $0 \leq b \lt n$. But this choice is simply a representative of all the numbers which belong to the same equivalence class, denoted $[b]$, $\pmod n$:

E.g. If $n = 4$, then one of the following holds: $$a \equiv b \pmod 4 \iff \begin{cases} a, b \in [0] = \{4k + 0\mid k\in \mathbb Z\} = \{\cdots, -8, -4, 0, 4, 8, 12,\cdots\} \\ \\ a, b \in [1] = \{4k + 1\mid k \in \mathbb Z\} = \{\cdots, -7, -3, 1, 5, 9, 13,\cdots\} \\ \\ a ,b \in [2] = \{4k + 2\mid k \in \mathbb Z\} = \{\cdots, -6, -2, 2, 6, 10, 14,\cdots\} \\ \\ a, b \in [3] = \{4k + 3\mid k \in \mathbb Z\} = \{\cdots, -5, -1, 3, 7, 11, 15, \cdots\} \end{cases} $$

2 of 4
15

All the equations you wrote up there are correct. $13 \equiv 5 \equiv 1 \equiv 1 + 4k \pmod 4$ for any integer $k$. Computer scientists tend to say that the 'modulus operation' returns the smallest integer between $0$ and what you're modding out by. Mathematicians take a slightly higher viewpoint, saying two numbers are considered the same if their difference is divisible by what you're modding out by.

But I would expect a different notation. Mathematically, $13 \equiv 5 \equiv 1 \equiv 1 + 4k \pmod 4$. In computer science, I would expect to see $13 \bmod 4 = 1$, or even $13\%4=1$. (In particular, none of that equivalence relation / only up to equivalence stuff).

🌐
Carnegie Mellon University
math.cmu.edu › ~jmackey › summer › congruences.pdf pdf
21-128 Congruences Definitions of congruence
Let di = gcd(ai, ni) for each 1 ≤i ≤r. If: ... Fermat’s little theorem. Let a ∈Z and let p ∈N be prime. If p ∤a then ap−1 ≡1 mod p. Proof strategy. Consider the list 1, 2, . . . , p −1. First prove that the list a, 2a, . . . , (p −1)a is the · same list (modulo p), just ...
🌐
StudySmarter
studysmarter.co.uk › congruence equations
Congruence Equations: Examples, Definition, Linear & Explained
Let's begin by exploring some simple congruence equation problems that will help you grasp the concept with ease. These examples will also demonstrate how to apply the methods mentioned earlier in solving linear congruence equations. ... Solve the congruence equation \(5x \equiv 3 \pmod{11}\). Since the modulus \(11\) is a prime number, we can try finding the modular inverse of \(5\) modulo \(11\).
🌐
Calcworkshop
calcworkshop.com › home › number theory › modular arithmetic
Modular Arithmetic (w/ 17 Step-by-Step Examples!)
February 1, 2021 - But 11 and 6 are not congruent modulo 3 because they are not in the same equivalence class and their difference, 11-6 = 5, is not a multiple of 3, as illustrated below. ... So, what have we learned? If the remainders are equal to each other, then they are congruent! And the following theorem highlights this very idea: ... And this leads us to several vital theorems for congruence modulo.
Top answer
1 of 2
1

That depends on your definition of the remainder, which in turn depends on a definition of 'integer division'.

It's quite easy for positive numbers: the result of division is the largest integer not exceeding the exact result. For example 5/8 = 0. Then the remainder is 5–8*(8/5) = 5–8*0 = 5.

For negative numbers, however, a problem appears with a meaning of 'the largest'. One can assume it is the value largest with respect to its absolute value, i.e. the result is rounded towards zero (some programming languages work this way); then the integer division (–5)/8 results in –0=0, and the remainder is –5.
Or one can take literally the largest value, in which case (–5)/8=–1 and then the remainder is 3.

2 of 2
0

A quick answer is that when we work with modulo n and you are using the following definition:

two numbers, namely a and b, are congruent modulo n <=> a%n = b%n

We have to consider the same criteria in order for them to be equal, and that is, to consider a remainder of the same sign as the divisor.

The long answer involves some group theory in there. It is not easy to sumarize in a few words, but can be simply explained, using the example you have provided along the way. First, we will consider the group of remainders modulo, that is, a set of posible positive remainders when a integer is divided by n. Through the perspective of the group, -3 and 5 are the same element, because -3 + 8 = 5.

P.D.: I advise you from reading that book if such definition was given, such vague definitions are misleading and not rigorous in mathematics. By the way, if you want a good book about number theory I recommend: H. Rosen, Kenneth, Elementary Number Theory, Fifth Edition, Pearson ISBN-0-321-26314-6

🌐
Brilliant
brilliant.org › wiki › modular-arithmetic
Modular Arithmetic | Brilliant Math & Science Wiki
When looking at the remainder of the Fibonacci numbers taken modulo 29, we obtain the repeating sequence · \[ 1, 1, 2, 3, 5, 8, 13, 21, 5, 26, 2, 28, 1, 0 , \ldots. \] A quick check shows us that no number appears in both sequences, and thus the answer is no. \(_ \square \) Reveal the answer · \[n^3 - 3n +7 \equiv 0 \pmod{n-5} \\ 2n^2 - n +2 \equiv 0 \pmod{n+6}\] What integer \( n \geq 5 \) satisfies the above system of congruence equations?
🌐
Math-History
math.wichita.edu › discrete-book › section-numtheory-divcong.html
Divisibility and Congruences
We say that \(a\) is congruent to \(b\) modulo \(m\) if · \begin{equation*} m \divides (b-a) \end{equation*} We write \(a \equiv b \pmod m\) We call \(m\) the modulus. Each of these statements is true: \(\displaystyle 13 \equiv 6 \pmod 7 \) \(\displaystyle -8 \equiv 6 \pmod 7 \) \(\displaystyle 7 \equiv 0 \pmod 7\) Video / Answer. Let’s compare the the congruence relation with the modulus operator: \(a \equiv b \pmod{m}\) is a logical statement.
🌐
Texas A&M University
people.tamu.edu › ~yvorobets › MATH433-2010B › Lect1-04web.pdf pdf
MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued).
... Then [b]n = [b]n[1]n = [b]n[a]n[b′]n = [1]n[b′]n = [b′]n. ... Let d = gcd(a, n). If d > 1 then n/d and · a/d are integers, [n/d]n ̸= [0]n, and [a]n[n/d]n = ... Now consider the case gcd(a, n) = 1. In this case 1 ... Find the inverse of 23 modulo 107.