1. Home
  2. Explore
  3. Mathematics
  4. Modular Arithmetic

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Modular Arithmetic

  • 50Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Modular Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is the basic idea of arithmetic modulo nnn?

Tap to flipClick to flipspace

Ignore multiples of nnn and focus on the remainders; numbers with the same remainder are treated as equivalent.

Or swipe the card

50 cards

  1. What is the basic idea of arithmetic modulo nnn?

    Ignore multiples of nnn and focus on the remainders; numbers with the same remainder are treated as equivalent.

  2. What does a≡b(modn)a \equiv b \pmod na≡b(modn) mean?

    It means that nnn divides a−ba-ba−b; equivalently, aaa and bbb differ by a multiple of nnn.

  3. Give examples of congruence modulo 555 using 171717.

    17≡12(mod5)17 \equiv 12 \pmod 517≡12(mod5) and 17≡32(mod5)17 \equiv 32 \pmod 517≡32(mod5), since each difference from 171717 is divisible by 555. But 17≢33(mod5)17 \not\equiv 33 \pmod 517≡33(mod5).

  4. What numbers belong to the congruence classes of 000 and 111 modulo 555?

    The class of 000 contains multiples of 555, such as 0,5,−5,100, 5, -5, 100,5,−5,10. The class of 111 contains numbers differing from 111 by a multiple of 555, such as 1,6,11,−41, 6, 11, -41,6,11,−4.

  5. State the division theorem for an integer nnn and a positive integer ddd.

    There is a unique pair of integers q,rq,rq,r such that n=qd+rn=qd+rn=qd+r and 0≤r<d0 \le r<d0≤r<d.

  6. In the division theorem, what are the quotient and remainder?

    In n=qd+rn=qd+rn=qd+r, qqq is the quotient and rrr is the remainder. They may be denoted div⁡(n,d)\operatorname{div}(n,d)div(n,d) and rem⁡(n,d)\operatorname{rem}(n,d)rem(n,d).

  7. What convention does this course use for remainders?

    The remainder is always nonnegative, including when the number being divided is negative; for positive divisor nnn, it lies between 000 and n−1n-1n−1.

  8. How is an integer related to its remainder modulo nnn?

    Every integer is congruent modulo nnn to its remainder upon division by nnn.

  9. How many distinct congruence classes are there modulo a positive integer nnn?

    There are nnn classes, represented by the possible remainders 0,1,…,n−10,1,\ldots,n-10,1,…,n−1. Together, they partition the integers.

  10. When are two integers congruent modulo nnn in terms of their remainders?

    They are congruent modulo nnn if and only if their remainders upon division by nnn are equal.

  11. How can the division theorem prove that equal remainders imply congruence?

    Write a=qn+ra=qn+ra=qn+r and b=q′n+rb=q'n+rb=q′n+r using their common remainder. Then a−b=(q−q′)na-b=(q-q')na−b=(q−q′)n, so nnn divides a−ba-ba−b.

  12. How can the division theorem prove that congruent integers have equal remainders?

    If a=b+kna=b+kna=b+kn and b=q′n+rb=q'n+rb=q′n+r, then a=(q′+k)n+ra=(q'+k)n+ra=(q′+k)n+r. By uniqueness in the division theorem, aaa and bbb have the same remainder.

  13. What is the difference between a≡b(modn)a \equiv b \pmod na≡b(modn) and a=b rem⁡ na=b\ \operatorname{rem}\ na=b rem n?

    The first states a congruence relation between aaa and bbb. The second states that aaa equals the remainder of bbb upon division by nnn.

  14. Why can the notation a=b mod⁡ na=b\ \operatorname{mod}\ na=b mod n be confusing?

    “Mod” may refer either to congruence notation or to a remainder operation. Using a≡b(modn)a \equiv b \pmod na≡b(modn) for congruence and explicit remainder notation for the operation distinguishes them.

  15. What is the sum of an even integer and an odd integer, and how can this be viewed modularly?

    The sum is odd. Modulo 222, this says that 0+1≡1(mod2)0+1 \equiv 1 \pmod 20+1≡1(mod2).

  16. Why does 357×994357\times 994357×994 end in 888?

    Modulo 101010, the factors are congruent to 777 and 444. Their product is congruent to 7×4=28≡8(mod10)7\times4=28\equiv8\pmod{10}7×4=28≡8(mod10).

  17. How can you find the time 494949 hours after 2:392{:}392:39?

    494949 hours is 222 days plus 111 hour, so the time is 3:393{:}393:39.

  18. How do you find the day of the week 100100100 days after a given day?

    Since 100=14×7+2100=14\times7+2100=14×7+2, advance the day by only 222 days. For example, if the starting day is Tuesday, the resulting day is Thursday.

  19. What do the familiar examples of parity, last digits, and weekdays have in common?

    They use remainders modulo 222, 101010, and 777, respectively. Clock calculations similarly use a modulus such as 121212 or 242424.

  20. If a≡b(modn)a\equiv b\pmod na≡b(modn), what happens after adding the same integer ccc to both?

    a+c≡b+c(modn)a+c\equiv b+c\pmod na+c≡b+c(modn).

  21. If a≡b(modn)a\equiv b\pmod na≡b(modn), what happens after subtracting the same integer ccc?

    a−c≡b−c(modn)a-c\equiv b-c\pmod na−c≡b−c(modn), and c−a≡c−b(modn)c-a\equiv c-b\pmod nc−a≡c−b(modn).

  22. If a≡b(modn)a\equiv b\pmod na≡b(modn), what happens after multiplying both by ccc?

    ac≡bc(modn)ac\equiv bc\pmod nac≡bc(modn).

  23. Can a factor be replaced by a congruent value during a modular computation?

    Yes. In addition, subtraction, and multiplication modulo nnn, a value may be replaced by any congruent value without changing the result modulo nnn.

  24. If a≡b(modn)a\equiv b\pmod na≡b(modn), what can be said about positive powers of aaa and bbb?

    For every positive integer ccc, ac≡bc(modn)a^c\equiv b^c\pmod nac≡bc(modn). This follows by repeatedly multiplying congruent values, or by induction on ccc.

  25. If a≡b(modn)a\equiv b\pmod na≡b(modn), can you generally replace the exponent in cac^aca with bbb?

    No. Congruence of exponents does not generally preserve powers. For example, 1≡6(mod5)1\equiv6\pmod51≡6(mod5), but (−1)1≢(−1)6(mod5)(-1)^1\not\equiv(-1)^6\pmod5(−1)1≡(−1)6(mod5).

  26. Why must repeated powers modulo nnn eventually repeat a value?

    There are only nnn possible remainders modulo nnn. Among enough powers, two must have the same remainder, after which the sequence of powers repeats periodically.

  27. What is a multiplicative inverse of aaa modulo nnn?

    A number bbb is a multiplicative inverse of aaa modulo nnn if ab≡1(modn)ab\equiv1\pmod nab≡1(modn). It may be denoted a−1a^{-1}a−1.

  28. When does an integer aaa have a multiplicative inverse modulo nnn?

    Exactly when gcd⁡(a,n)=1\gcd(a,n)=1gcd(a,n)=1.

  29. Why does gcd⁡(a,n)=1\gcd(a,n)=1gcd(a,n)=1 guarantee an inverse of aaa modulo nnn?

    Bézout’s identity gives integers b,qb,qb,q such that ab+qn=1ab+qn=1ab+qn=1. Thus ab≡1(modn)ab\equiv1\pmod nab≡1(modn), so bbb is an inverse.

  30. What does Bézout’s identity state, and how can its coefficients be found efficiently?

    For integers a,ba,ba,b, there are integers s,ts,ts,t with gcd⁡(a,b)=as+bt\gcd(a,b)=as+btgcd(a,b)=as+bt. The extended Euclidean algorithm, also called the pulverizer in the lecture, computes such coefficients efficiently.

  31. When can an integer be written as an integer linear combination of aaa and bbb?

    An integer is an integer linear combination of aaa and bbb if and only if it is divisible by gcd⁡(a,b)\gcd(a,b)gcd(a,b).

  32. Why can you not generally divide both sides of a congruence by a number?

    Cancellation is not always valid modulo nnn. A number can be canceled only when it has an inverse modulo nnn, which requires it to be relatively prime to nnn.

  33. Why does 3x≡3(mod6)3x\equiv3\pmod63x≡3(mod6) not imply x≡1(mod6)x\equiv1\pmod6x≡1(mod6)?

    For example, x=3x=3x=3 satisfies 3x=9≡3(mod6)3x=9\equiv3\pmod63x=9≡3(mod6), but 3≢1(mod6)3\not\equiv1\pmod63≡1(mod6). Since gcd⁡(3,6)≠1\gcd(3,6)\ne1gcd(3,6)=1, 333 has no inverse modulo 666.

  34. Why can you cancel 333 from 3x≡3(mod5)3x\equiv3\pmod53x≡3(mod5)?

    Because gcd⁡(3,5)=1\gcd(3,5)=1gcd(3,5)=1, so 333 has an inverse modulo 555. Therefore x≡1(mod5)x\equiv1\pmod5x≡1(mod5).

  35. What is the inverse of 333 modulo 555?

    222, since 3×2=6≡1(mod5)3\times2=6\equiv1\pmod53×2=6≡1(mod5).

  36. How can you solve 7x≡14(mod30)7x\equiv14\pmod{30}7x≡14(mod30)?

    Since gcd⁡(7,30)=1\gcd(7,30)=1gcd(7,30)=1, 777 is invertible modulo 303030. Its inverse is 131313, because 7×13=91≡1(mod30)7\times13=91\equiv1\pmod{30}7×13=91≡1(mod30). Thus x≡2(mod30)x\equiv2\pmod{30}x≡2(mod30).

  37. What does Fermat’s Little Theorem say?

    If ppp is prime and p∤ap\nmid ap∤a, then ap−1≡1(modp)a^{p-1}\equiv1\pmod pap−1≡1(modp).

  38. Why is the condition p∤ap\nmid ap∤a needed in Fermat’s Little Theorem?

    If p∣ap\mid ap∣a, then ap−1≡0(modp)a^{p-1}\equiv0\pmod pap−1≡0(modp), not 111.

  39. How does Fermat’s Little Theorem help reduce exponents modulo a prime ppp?

    For a base not divisible by ppp, powers differing by a multiple of p−1p-1p−1 are congruent modulo ppp, because ap−1≡1(modp)a^{p-1}\equiv1\pmod pap−1≡1(modp).

  40. In the proof of Fermat’s Little Theorem, what set of values is considered?

    The proof considers a,2a,3a,…,(p−1)aa,2a,3a,\ldots,(p-1)aa,2a,3a,…,(p−1)a modulo ppp, where ppp is prime and p∤ap\nmid ap∤a.

  41. Why are none of a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a congruent to 000 modulo ppp?

    None of the coefficients 1,…,p−11,\ldots,p-11,…,p−1 is divisible by ppp, and aaa is not divisible by ppp. Since ppp is prime, none of their products with aaa is divisible by ppp.

  42. Why are the values a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a pairwise distinct modulo ppp?

    If ia≡ja(modp)ia\equiv ja\pmod pia≡ja(modp), then aaa can be canceled because gcd⁡(a,p)=1\gcd(a,p)=1gcd(a,p)=1, giving i≡j(modp)i\equiv j\pmod pi≡j(modp). Since i,j∈{1,…,p−1}i,j\in\{1,\ldots,p-1\}i,j∈{1,…,p−1}, this means i=ji=ji=j.

  43. What product congruence results from multiplying the values in the proof of Fermat’s Little Theorem?

    The values a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a are a rearrangement of the nonzero residues modulo ppp. Multiplying them gives ap−1(p−1)!≡(p−1)!(modp)a^{p-1}(p-1)!\equiv(p-1)!\pmod pap−1(p−1)!≡(p−1)!(modp).

  44. How does the product congruence complete the proof of Fermat’s Little Theorem?

    Because ppp is prime, none of 1,…,p−11,\ldots,p-11,…,p−1 is divisible by ppp, so (p−1)!(p-1)!(p−1)! has an inverse modulo ppp. Canceling it gives ap−1≡1(modp)a^{p-1}\equiv1\pmod pap−1≡1(modp).

  45. How can you reduce 7957^{95}795 modulo 131313 using Fermat’s Little Theorem?

    Since 131313 is prime and 95≡11(mod12)95\equiv11\pmod{12}95≡11(mod12), 795≡711(mod13)7^{95}\equiv7^{11}\pmod{13}795≡711(mod13). Also, 712≡1(mod13)7^{12}\equiv1\pmod{13}712≡1(mod13), so 7117^{11}711 is the inverse of 777 modulo 131313, which is 222. Thus the remainder is 222.

  46. What is an effective general strategy for computing a large expression modulo nnn?

    Reduce intermediate values modulo nnn and replace them with simpler congruent values before continuing the calculation.

  47. Why can 113351133511335 be replaced by 353535 when computing modulo 100100100?

    11335≡35(mod100)11335\equiv35\pmod{100}11335≡35(mod100), because they have the same remainder after division by 100100100.

  48. Why can 779977997799 be replaced by −1-1−1 when computing modulo 100100100?

    7799≡99≡−1(mod100)7799\equiv99\equiv-1\pmod{100}7799≡99≡−1(mod100), and −1-1−1 is simpler to use in powers.

  49. What remainder does 35k35^k35k have modulo 100100100 for odd k>1k>1k>1 and for even k>0k>0k>0?

    For odd k>1k>1k>1, the remainder is 757575; for even k>0k>0k>0, it is 252525. The powers after 35135^1351 alternate between 757575 and 252525.

  50. How can 1133511111×6+7799500011335^{11111}\times6+7799^{5000}1133511111×6+77995000 be simplified modulo 100100100?

    11335≡3511335\equiv3511335≡35 and 7799≡−1(mod100)7799\equiv-1\pmod{100}7799≡−1(mod100). Since 500050005000 is even, (−1)5000=1(-1)^{5000}=1(−1)5000=1, and since 111111111111111 is odd and greater than 111, 3511111≡7535^{11111}\equiv753511111≡75. The expression is therefore congruent to 75×6+1=451≡51(mod100)75\times6+1=451\equiv51\pmod{100}75×6+1=451≡51(mod100).

Card 1 of 50
Card 1 of 50

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent