Modular Arithmetic
- 50Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the basic idea of arithmetic modulo n?
Ignore multiples of n and focus on the remainders; numbers with the same remainder are treated as equivalent.
Or swipe the card
50 cards
What is the basic idea of arithmetic modulo n?
Ignore multiples of n and focus on the remainders; numbers with the same remainder are treated as equivalent.
What does a≡b(modn) mean?
It means that n divides a−b; equivalently, a and b differ by a multiple of n.
Give examples of congruence modulo 5 using 17.
17≡12(mod5) and 17≡32(mod5), since each difference from 17 is divisible by 5. But 17≡33(mod5).
What numbers belong to the congruence classes of 0 and 1 modulo 5?
The class of 0 contains multiples of 5, such as 0,5,−5,10. The class of 1 contains numbers differing from 1 by a multiple of 5, such as 1,6,11,−4.
State the division theorem for an integer n and a positive integer d.
There is a unique pair of integers q,r such that n=qd+r and 0≤r<d.
In the division theorem, what are the quotient and remainder?
In n=qd+r, q is the quotient and r is the remainder. They may be denoted div(n,d) and rem(n,d).
What convention does this course use for remainders?
The remainder is always nonnegative, including when the number being divided is negative; for positive divisor n, it lies between 0 and n−1.
How is an integer related to its remainder modulo n?
Every integer is congruent modulo n to its remainder upon division by n.
How many distinct congruence classes are there modulo a positive integer n?
There are n classes, represented by the possible remainders 0,1,…,n−1. Together, they partition the integers.
When are two integers congruent modulo n in terms of their remainders?
They are congruent modulo n if and only if their remainders upon division by n are equal.
How can the division theorem prove that equal remainders imply congruence?
Write a=qn+r and b=q′n+r using their common remainder. Then a−b=(q−q′)n, so n divides a−b.
How can the division theorem prove that congruent integers have equal remainders?
If a=b+kn and b=q′n+r, then a=(q′+k)n+r. By uniqueness in the division theorem, a and b have the same remainder.
What is the difference between a≡b(modn) and a=b rem n?
The first states a congruence relation between a and b. The second states that a equals the remainder of b upon division by n.
Why can the notation a=b mod n be confusing?
“Mod” may refer either to congruence notation or to a remainder operation. Using a≡b(modn) for congruence and explicit remainder notation for the operation distinguishes them.
What is the sum of an even integer and an odd integer, and how can this be viewed modularly?
The sum is odd. Modulo 2, this says that 0+1≡1(mod2).
Why does 357×994 end in 8?
Modulo 10, the factors are congruent to 7 and 4. Their product is congruent to 7×4=28≡8(mod10).
How can you find the time 49 hours after 2:39?
49 hours is 2 days plus 1 hour, so the time is 3:39.
How do you find the day of the week 100 days after a given day?
Since 100=14×7+2, advance the day by only 2 days. For example, if the starting day is Tuesday, the resulting day is Thursday.
What do the familiar examples of parity, last digits, and weekdays have in common?
They use remainders modulo 2, 10, and 7, respectively. Clock calculations similarly use a modulus such as 12 or 24.
If a≡b(modn), what happens after adding the same integer c to both?
a+c≡b+c(modn).
If a≡b(modn), what happens after subtracting the same integer c?
a−c≡b−c(modn), and c−a≡c−b(modn).
If a≡b(modn), what happens after multiplying both by c?
ac≡bc(modn).
Can a factor be replaced by a congruent value during a modular computation?
Yes. In addition, subtraction, and multiplication modulo n, a value may be replaced by any congruent value without changing the result modulo n.
If a≡b(modn), what can be said about positive powers of a and b?
For every positive integer c, ac≡bc(modn). This follows by repeatedly multiplying congruent values, or by induction on c.
If a≡b(modn), can you generally replace the exponent in ca with b?
No. Congruence of exponents does not generally preserve powers. For example, 1≡6(mod5), but (−1)1≡(−1)6(mod5).
Why must repeated powers modulo n eventually repeat a value?
There are only n possible remainders modulo n. Among enough powers, two must have the same remainder, after which the sequence of powers repeats periodically.
What is a multiplicative inverse of a modulo n?
A number b is a multiplicative inverse of a modulo n if ab≡1(modn). It may be denoted a−1.
When does an integer a have a multiplicative inverse modulo n?
Exactly when gcd(a,n)=1.
Why does gcd(a,n)=1 guarantee an inverse of a modulo n?
Bézout’s identity gives integers b,q such that ab+qn=1. Thus ab≡1(modn), so b is an inverse.
What does Bézout’s identity state, and how can its coefficients be found efficiently?
For integers a,b, there are integers s,t with gcd(a,b)=as+bt. The extended Euclidean algorithm, also called the pulverizer in the lecture, computes such coefficients efficiently.
When can an integer be written as an integer linear combination of a and b?
An integer is an integer linear combination of a and b if and only if it is divisible by gcd(a,b).
Why can you not generally divide both sides of a congruence by a number?
Cancellation is not always valid modulo n. A number can be canceled only when it has an inverse modulo n, which requires it to be relatively prime to n.
Why does 3x≡3(mod6) not imply x≡1(mod6)?
For example, x=3 satisfies 3x=9≡3(mod6), but 3≡1(mod6). Since gcd(3,6)=1, 3 has no inverse modulo 6.
Why can you cancel 3 from 3x≡3(mod5)?
Because gcd(3,5)=1, so 3 has an inverse modulo 5. Therefore x≡1(mod5).
What is the inverse of 3 modulo 5?
2, since 3×2=6≡1(mod5).
How can you solve 7x≡14(mod30)?
Since gcd(7,30)=1, 7 is invertible modulo 30. Its inverse is 13, because 7×13=91≡1(mod30). Thus x≡2(mod30).
What does Fermat’s Little Theorem say?
If p is prime and p∤a, then ap−1≡1(modp).
Why is the condition p∤a needed in Fermat’s Little Theorem?
If p∣a, then ap−1≡0(modp), not 1.
How does Fermat’s Little Theorem help reduce exponents modulo a prime p?
For a base not divisible by p, powers differing by a multiple of p−1 are congruent modulo p, because ap−1≡1(modp).
In the proof of Fermat’s Little Theorem, what set of values is considered?
The proof considers a,2a,3a,…,(p−1)a modulo p, where p is prime and p∤a.
Why are none of a,2a,…,(p−1)a congruent to 0 modulo p?
None of the coefficients 1,…,p−1 is divisible by p, and a is not divisible by p. Since p is prime, none of their products with a is divisible by p.
Why are the values a,2a,…,(p−1)a pairwise distinct modulo p?
If ia≡ja(modp), then a can be canceled because gcd(a,p)=1, giving i≡j(modp). Since i,j∈{1,…,p−1}, this means i=j.
What product congruence results from multiplying the values in the proof of Fermat’s Little Theorem?
The values a,2a,…,(p−1)a are a rearrangement of the nonzero residues modulo p. Multiplying them gives ap−1(p−1)!≡(p−1)!(modp).
How does the product congruence complete the proof of Fermat’s Little Theorem?
Because p is prime, none of 1,…,p−1 is divisible by p, so (p−1)! has an inverse modulo p. Canceling it gives ap−1≡1(modp).
How can you reduce 795 modulo 13 using Fermat’s Little Theorem?
Since 13 is prime and 95≡11(mod12), 795≡711(mod13). Also, 712≡1(mod13), so 711 is the inverse of 7 modulo 13, which is 2. Thus the remainder is 2.
What is an effective general strategy for computing a large expression modulo n?
Reduce intermediate values modulo n and replace them with simpler congruent values before continuing the calculation.
Why can 11335 be replaced by 35 when computing modulo 100?
11335≡35(mod100), because they have the same remainder after division by 100.
Why can 7799 be replaced by −1 when computing modulo 100?
7799≡99≡−1(mod100), and −1 is simpler to use in powers.
What remainder does 35k have modulo 100 for odd k>1 and for even k>0?
For odd k>1, the remainder is 75; for even k>0, it is 25. The powers after 351 alternate between 75 and 25.
How can 1133511111×6+77995000 be simplified modulo 100?
11335≡35 and 7799≡−1(mod100). Since 5000 is even, (−1)5000=1, and since 11111 is odd and greater than 1, 3511111≡75. The expression is therefore congruent to 75×6+1=451≡51(mod100).

Ask anything
We've read this whole study set, so questions about it get the best answers.