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

  • 48Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Number Theory Foundations

State Bézout’s identity for integers aaa and bbb.

48 questions

  1. 1

    State Bézout’s identity for integers aaa and bbb.

    Model answer

    There exist integers sss and ttt such that gcd⁡(a,b)=as+bt\gcd(a,b)=as+btgcd(a,b)=as+bt.

    Explanation

    Bézout’s identity expresses the greatest common divisor as an integer linear combination of the two integers.

  2. 2

    What algorithm can efficiently find the coefficients in Bézout’s identity?

    Model answer

    The extended Euclidean algorithm, also called the pulverizer, efficiently computes the coefficients.

    Explanation

    The extended Euclidean algorithm finds integers sss and ttt for which gcd⁡(a,b)=as+bt\gcd(a,b)=as+btgcd(a,b)=as+bt.

  3. 3

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

    Model answer

    An integer can be written as 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).

    Explanation

    The integer linear combinations of aaa and bbb are exactly the multiples of their greatest common divisor.

  4. 4

    What does it mean for two integers to be congruent modulo nnn?

    Model answer

    Integers aaa and bbb are congruent modulo nnn if and only if nnn divides a−ba-ba−b.

    Explanation

    Congruence modulo nnn means the difference between the integers is a multiple of nnn.

  5. 5

    How does modular arithmetic simplify everyday calculations involving parity, last digits, or time?

    Model answer

    It focuses on remainders and ignores full multiples of the modulus; for example, parity uses remainders modulo 222, and last digits use remainders modulo 101010.

    Explanation

    The same principle applies to clocks and weekdays: full cycles can be ignored, leaving only the remainder after division by the cycle length.

  6. 6

    What is the division theorem for an integer nnn and a positive integer ddd?

    Model answer

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

    Explanation

    The theorem guarantees both the existence and uniqueness of a quotient and a nonnegative remainder in the specified range.

  7. 7

    In the division theorem, what do qqq and rrr represent?

    Model answer

    qqq is the quotient and rrr is the remainder when nnn is divided by ddd.

    Explanation

    The division theorem writes the dividend as the divisor times the quotient plus the remainder.

  8. 8

    How can the quotient and remainder be denoted using the notation described in the lecture?

    Model answer

    The quotient can be written as div⁡(n,d)\operatorname{div}(n,d)div(n,d) or ndiv⁡dn\operatorname{div}dndivd, and the remainder as rem⁡(n,d)\operatorname{rem}(n,d)rem(n,d) or nrem⁡dn\operatorname{rem}dnremd.

    Explanation

    The lecture uses both function-style and infix notations for quotient and remainder.

  9. 9

    How are congruence classes modulo nnn related to remainders?

    Model answer

    Every integer is congruent modulo nnn to its remainder, so the possible classes are represented by 0,1,…,n−10,1,\ldots,n-10,1,…,n−1.

    Explanation

    Each integer belongs to the class represented by the remainder obtained when it is divided by nnn.

  10. 10

    What does the congruence class of 000 modulo 555 contain?

    Model answer

    It contains all integers congruent to 000 modulo 555, such as 000, 555, −5-5−5, 101010, and −10-10−10.

    Explanation

    These are precisely the multiples of 555.

  11. 11

    Which congruence class modulo 555 contains −9-9−9, and how can you determine it?

    Model answer

    It is the class represented by 111, because −9-9−9 has remainder 111 when divided by 555 using a nonnegative remainder.

    Explanation

    The class of an integer is determined by its remainder modulo the modulus.

  12. 12

    What does it mean for the residue classes modulo nnn to form a partition of the integers?

    Model answer

    Every integer belongs to exactly one of the classes represented by 000 through n−1n-1n−1.

    Explanation

    The classes are disjoint and together contain all integers, because each integer has a unique remainder.

  13. 13

    State the relationship between congruence modulo nnn and equality of remainders.

    Model answer

    aaa is congruent to bbb modulo nnn if and only if aaa and bbb have the same remainder when divided by nnn.

    Explanation

    Equal remainders imply their difference is divisible by nnn; conversely, if nnn divides their difference, the division theorem gives them the same remainder.

  14. 14

    Why does having equal remainders imply that two integers are congruent modulo nnn?

    Model answer

    Writing a=qn+ra=qn+ra=qn+r and b=q′n+rb=q'n+rb=q′n+r gives a−b=n(q−q′)a-b=n(q-q')a−b=n(q−q′), so nnn divides their difference.

    Explanation

    The shared remainder cancels when the two division-theorem expressions are subtracted.

  15. 15

    Why does congruence modulo nnn imply equal remainders?

    Model answer

    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, so both integers have remainder rrr.

    Explanation

    The division theorem’s uniqueness guarantees that the remainder in these expressions is the remainder for each integer.

  16. 16

    Give examples of two integers that are congruent modulo 555, and one pair that is not.

    Model answer

    171717 is congruent to 121212 and to 323232 modulo 555, but it is not congruent to 333333 modulo 555.

    Explanation

    The differences 17−12=517-12=517−12=5 and 17−32=−1517-32=-1517−32=−15 are multiples of 555, whereas 17−33=−1617-33=-1617−33=−16 is not.

  17. 17

    What convention for remainders is used in the lecture, and why should programmers be cautious?

    Model answer

    Remainders are taken to be nonnegative; programming languages may use different remainder or modulo conventions, especially for negative inputs.

    Explanation

    The behavior of a programming-language operator can differ from the mathematical convention, so its definition should be checked.

  18. 18

    How do the statements a≡b(modn)a\equiv b\pmod na≡b(modn) and a=brem⁡na=b\operatorname{rem}na=bremn differ?

    Model answer

    The first says that aaa and bbb are congruent; the second says that aaa equals the particular remainder of bbb modulo nnn.

    Explanation

    Congruence is a relation between two integers, while remainder notation identifies one value. The lecture recommends keeping these meanings distinct in notation.

  19. 19

    If aaa is congruent to bbb modulo nnn, what can be said about adding the same integer ccc to both?

    Model answer

    a+ca+ca+c is congruent to b+cb+cb+c modulo nnn.

    Explanation

    Adding the same value leaves the difference unchanged: (a+c)−(b+c)=a−b(a+c)-(b+c)=a-b(a+c)−(b+c)=a−b.

  20. 20

    If aaa is congruent to bbb modulo nnn, what can be said about subtracting ccc from both?

    Model answer

    a−ca-ca−c is congruent to b−cb-cb−c modulo nnn.

    Explanation

    The difference between the resulting expressions is still a−ba-ba−b, which is divisible by nnn.

  21. 21

    If aaa is congruent to bbb modulo nnn, what can be said about c−ac-ac−a and c−bc-bc−b?

    Model answer

    c−ac-ac−a is congruent to c−bc-bc−b modulo nnn.

    Explanation

    Their difference is (c−a)−(c−b)=b−a(c-a)-(c-b)=b-a(c−a)−(c−b)=b−a, a multiple of nnn.

  22. 22

    If aaa is congruent to bbb modulo nnn, what can be said about multiplying both by ccc?

    Model answer

    acacac is congruent to bcbcbc modulo nnn.

    Explanation

    The difference ac−bc=c(a−b)ac-bc=c(a-b)ac−bc=c(a−b) remains divisible by nnn.

  23. 23

    How can congruent values be used to simplify a modular calculation?

    Model answer

    An intermediate value can be replaced by any congruent value that is easier to work with, without changing the final congruence.

    Explanation

    Addition, subtraction, and multiplication preserve congruence, allowing calculations to be reduced modulo nnn along the way.

  24. 24

    If aaa is congruent to bbb modulo nnn and ccc is a positive integer, what can be said about aca^cac and bcb^cbc?

    Model answer

    aca^cac is congruent to bcb^cbc modulo nnn.

    Explanation

    Repeated multiplication preserves congruence; the result can also be proved by induction on ccc.

  25. 25

    Does congruence of exponents generally allow one to replace an exponent in a modular power?

    Model answer

    No. In general, congruent exponents do not guarantee congruent powers.

    Explanation

    For example, 111 and 666 are congruent modulo 555, but (−1)1=−1(-1)^1=-1(−1)1=−1 is not congruent to (−1)6=1(-1)^6=1(−1)6=1 modulo 555.

  26. 26

    Why is the claim that congruent exponents always give congruent powers disproved by (−1)1(-1)^1(−1)1 and (−1)6(-1)^6(−1)6 modulo 555?

    Model answer

    Although 111 and 666 are congruent modulo 555, the powers are −1-1−1 and 111, which are not congruent modulo 555.

    Explanation

    A single counterexample disproves a claim intended to hold generally.

  27. 27

    How can the remainder of a large power be computed more efficiently than evaluating the entire power first?

    Model answer

    Reduce the base modulo the modulus, then repeatedly multiply and reduce intermediate results to find a manageable pattern.

    Explanation

    Congruence is preserved under multiplication, so reducing intermediate values gives the same final remainder.

  28. 28

    What pattern do the powers of 353535 follow modulo 100100100 after the first power?

    Model answer

    Odd powers greater than 111 have remainder 757575, while even powers have remainder 252525.

    Explanation

    For example, 352≡2535^2\equiv25352≡25, 353≡7535^3\equiv75353≡75, and 354≡25(mod100)35^4\equiv25\pmod{100}354≡25(mod100); the pattern then alternates.

  29. 29

    Why must a sequence of powers modulo 100100100 eventually repeat a remainder?

    Model answer

    There are only 100100100 possible remainders modulo 100100100, so a sufficiently long sequence of powers must repeat a value.

    Explanation

    Once a remainder repeats, subsequent powers repeat in a cycle because each next power is obtained by multiplying by the same base.

  30. 30

    Does the repeating pattern of powers modulo a number always begin quickly or have a short period?

    Model answer

    No. A pattern eventually repeats, but it may be harder to find and may have a longer period than the example modulo 100100100.

    Explanation

    The finite number of possible remainders guarantees eventual repetition, not a particular starting point or cycle length.

  31. 31

    What does it mean for xxx to have a multiplicative inverse modulo nnn?

    Model answer

    A multiplicative inverse of xxx modulo nnn is a number yyy such that xy≡1(modn)xy\equiv1\pmod nxy≡1(modn).

    Explanation

    It is the modular analogue of a number that multiplies xxx to give 111.

  32. 32

    Give a multiplicative inverse pair modulo 555 from the lecture.

    Model answer

    222 and 333 are inverses modulo 555, since 2⋅3=6≡1(mod5)2\cdot3=6\equiv1\pmod52⋅3=6≡1(mod5).

    Explanation

    Their product differs from 111 by a multiple of 555.

  33. 33

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

    Model answer

    It has an inverse modulo nnn if and only if gcd⁡(a,n)=1\gcd(a,n)=1gcd(a,n)=1.

    Explanation

    An inverse exists exactly when 111 can be expressed as an integer linear combination of aaa and nnn, which occurs precisely when their gcd is 111.

  34. 34

    How does Bézout’s identity show that aaa has an inverse modulo nnn when gcd⁡(a,n)=1\gcd(a,n)=1gcd(a,n)=1?

    Model answer

    Bézout’s identity gives integers bbb and qqq with ab+qn=1ab+qn=1ab+qn=1, so ab≡1(modn)ab\equiv1\pmod nab≡1(modn) and bbb is an inverse of aaa.

    Explanation

    The integer linear combination becomes a multiplicative-inverse equation when reduced modulo nnn.

  35. 35

    Why can 333 not be canceled from 3x≡3(mod6)3x\equiv3\pmod63x≡3(mod6) to conclude x≡1(mod6)x\equiv1\pmod6x≡1(mod6)?

    Model answer

    Because gcd⁡(3,6)=3\gcd(3,6)=3gcd(3,6)=3, not 111, so 333 has no multiplicative inverse modulo 666; in fact, x=3x=3x=3 satisfies the original congruence but not the proposed conclusion.

    Explanation

    Indeed, 3⋅3=9≡3(mod6)3\cdot3=9\equiv3\pmod63⋅3=9≡3(mod6), while 3≢1(mod6)3\not\equiv1\pmod63≡1(mod6).

  36. 36

    Under what condition can a coefficient be canceled from a congruence modulo nnn?

    Model answer

    A coefficient can be canceled when it is relatively prime to the modulus.

    Explanation

    If the coefficient’s gcd with the modulus is 111, it has a multiplicative inverse that can be multiplied through the congruence.

  37. 37

    Solve 3x≡3(mod5)3x\equiv3\pmod53x≡3(mod5) using a multiplicative inverse.

    Model answer

    Since 222 is the inverse of 333 modulo 555, multiplying both sides by 222 gives x≡1(mod5)x\equiv1\pmod5x≡1(mod5).

    Explanation

    The gcd of 333 and 555 is 111, and 2⋅3≡1(mod5)2\cdot3\equiv1\pmod52⋅3≡1(mod5).

  38. 38

    Solve 7x≡14(mod30)7x\equiv14\pmod{30}7x≡14(mod30) using an inverse of 777.

    Model answer

    7−1≡13(mod30)7^{-1}\equiv13\pmod{30}7−1≡13(mod30), so multiplying both sides by 131313 gives x≡2(mod30)x\equiv2\pmod{30}x≡2(mod30).

    Explanation

    Since 7⋅13=91≡1(mod30)7\cdot13=91\equiv1\pmod{30}7⋅13=91≡1(mod30), multiplying the right-hand side gives 14⋅13≡2(mod30)14\cdot13\equiv2\pmod{30}14⋅13≡2(mod30).

  39. 39

    State Fermat’s Little Theorem.

    Model answer

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

    Explanation

    The condition that aaa is not divisible by ppp is essential to the theorem as stated.

  40. 40

    Why must the condition that aaa is not divisible by ppp be included in Fermat’s Little Theorem?

    Model answer

    If aaa is divisible by ppp, then ap−1≡0(modp)a^{p-1}\equiv0\pmod pap−1≡0(modp), not 111.

    Explanation

    The theorem requires aaa to be nonzero modulo the prime ppp.

  41. 41

    In what sense can Fermat’s Little Theorem help reduce exponents modulo a prime?

    Model answer

    For a base not divisible by prime ppp, a factor of ap−1a^{p-1}ap−1 can be replaced by 111 modulo ppp, so exponents can be reduced by multiples of p−1p-1p−1.

    Explanation

    This is a special exponent-reduction rule modulo a prime, rather than a general rule for replacing exponents by congruent ones.

  42. 42

    For prime ppp and aaa not divisible by ppp, what can be said about the values a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a modulo ppp?

    Model answer

    They are all nonzero and pairwise distinct modulo ppp.

    Explanation

    None is divisible by ppp; if ia≡ja(modp)ia\equiv ja\pmod pia≡ja(modp), then aaa can be canceled because it has an inverse modulo ppp, giving i≡j(modp)i\equiv j\pmod pi≡j(modp).

  43. 43

    Why can aaa be canceled in the proof that the values a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a are distinct modulo ppp?

    Model answer

    Because ppp is prime and does not divide aaa, so gcd⁡(a,p)=1\gcd(a,p)=1gcd(a,p)=1 and aaa has an inverse modulo ppp.

    Explanation

    Multiplying a congruence by this inverse shows that equal products imply equal coefficients modulo ppp.

  44. 44

    What set of residues do the nonzero values a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a represent modulo ppp?

    Model answer

    They represent all the nonzero residues modulo ppp, each exactly once.

    Explanation

    There are p−1p-1p−1 distinct nonzero values, matching the p−1p-1p−1 nonzero residue classes modulo ppp.

  45. 45

    How does multiplying the residues in the proof of Fermat’s Little Theorem produce a factorial expression?

    Model answer

    The product of the coefficients 1,2,…,p−11,2,\ldots,p-11,2,…,p−1 is (p−1)!(p-1)!(p−1)!, while the product of a,2a,…,(p−1)aa,2a,\ldots,(p-1)aa,2a,…,(p−1)a is ap−1(p−1)!a^{p-1}(p-1)!ap−1(p−1)!.

    Explanation

    Each of the p−1p-1p−1 terms in the second product contributes one factor of aaa.

  46. 46

    Why can (p−1)!(p-1)!(p−1)! be canceled in the proof of Fermat’s Little Theorem?

    Model answer

    None of 1,2,…,p−11,2,\ldots,p-11,2,…,p−1 is divisible by ppp, so (p−1)!(p-1)!(p−1)! is relatively prime to ppp and has an inverse modulo ppp.

    Explanation

    Canceling this invertible factor from the product congruence yields ap−1≡1(modp)a^{p-1}\equiv1\pmod pap−1≡1(modp).

  47. 47

    Use Fermat’s Little Theorem to reduce 7957^{95}795 modulo 131313 to a smaller power.

    Model answer

    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).

    Explanation

    Fermat’s Little Theorem gives 712≡1(mod13)7^{12}\equiv1\pmod{13}712≡1(mod13), allowing the exponent to be reduced modulo 121212.

  48. 48

    What is the remainder of 7957^{95}795 modulo 131313?

    Model answer

    The remainder is 222.

    Explanation

    After reducing to 7117^{11}711, note that 711⋅7=712≡1(mod13)7^{11}\cdot7=7^{12}\equiv1\pmod{13}711⋅7=712≡1(mod13); since 7−1≡2(mod13)7^{-1}\equiv2\pmod{13}7−1≡2(mod13), 711≡2(mod13)7^{11}\equiv2\pmod{13}711≡2(mod13).

1 of 48
Question 1 of 48

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent