1. Home
  2. Explore
  3. Mathematics
  4. Number Theory and Cryptography

Study methods

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

Number Theory and Cryptography

  • 112Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Divisibility and Modular Arithmetic

What does it mean for a nonzero integer aaa to divide an integer bbb, and what are the related terms for aaa and bbb?

112 questions

  1. 1

    What does it mean for a nonzero integer aaa to divide an integer bbb, and what are the related terms for aaa and bbb?

    Model answer

    It means b=acb = acb=ac for some integer ccc. Then aaa is a divisor or factor of bbb, and bbb is a multiple of aaa.

    Explanation

    Divisibility means the quotient is an integer, so the division has no remainder.

  2. 2

    State the three divisibility rules relating divisibility, sums, products, and chains.

    Model answer

    If aaa divides both bbb and ccc, it divides b+cb+cb+c; if aaa divides bbb, it divides bcbcbc for any integer ccc; and if aaa divides bbb and bbb divides ccc, then aaa divides ccc.

    Explanation

    These rules follow from expressing divisible numbers as integer multiples of their divisors.

  3. 3

    What is a linear combination of bbb and ccc, and what follows if aaa divides both numbers?

    Model answer

    A linear combination is an expression mb+ncmb+ncmb+nc. If aaa divides both bbb and ccc, it divides every such combination for integers mmm and nnn.

    Explanation

    The divisibility rules for products and sums apply to each term and then to their sum.

  4. 4

    State the division algorithm for an integer aaa and a positive integer ddd, including the permitted range of the remainder.

    Model answer

    There are unique integers qqq and rrr such that a=dq+ra=dq+ra=dq+r and 0≤r<d0\le r<d0≤r<d.

    Explanation

    The quotient and remainder are unique, and the remainder is nonnegative and smaller than the divisor.

  5. 5

    In the division algorithm, what do dividend, divisor, quotient, and remainder represent, and how are quotient and remainder denoted?

    Model answer

    The dividend is aaa, the divisor is ddd, the quotient is q=adiv⁡dq=a\operatorname{ div }dq=adivd, and the remainder is r=amod⁡dr=a\operatorname{ mod }dr=amodd.

    Explanation

    The quotient gives the whole-number part of the division, while the remainder is what is left over.

  6. 6

    What are the quotient and remainder when 101101101 is divided by 111111, and what are they when −11-11−11 is divided by 333?

    Model answer

    For 101101101 divided by 111111, the quotient is 999 and the remainder is 222. For −11-11−11 divided by 333, they are −4-4−4 and 111.

    Explanation

    The second division must have a nonnegative remainder: −11=3(−4)+1-11=3(-4)+1−11=3(−4)+1, whereas a remainder of −2-2−2 is not permitted.

  7. 7

    Define congruence modulo a positive integer mmm and explain how it relates to remainders.

    Model answer

    a≡b(modm)a\equiv b\pmod ma≡b(modm) means that mmm divides a−ba-ba−b. Equivalently, aaa and bbb have the same remainder when divided by mmm.

    Explanation

    Congruence groups integers according to their remainders modulo mmm.

  8. 8

    State the characterization of congruence using an integer multiple of the modulus.

    Model answer

    a≡b(modm)a\equiv b\pmod ma≡b(modm) if and only if a=b+kma=b+kma=b+km for some integer kkk.

    Explanation

    The integer kkk can be negative, zero, or positive; it counts signed steps of size mmm between the numbers.

  9. 9

    How are the relation a≡b(modm)a\equiv b\pmod ma≡b(modm) and the remainder expression amod⁡m=bmod⁡ma\operatorname{ mod }m=b\operatorname{ mod }mamodm=bmodm different?

    Model answer

    Congruence is a relation that states whether two numbers are equivalent modulo mmm. The mod function returns a remainder.

    Explanation

    The two statements are equivalent as a test, but the word “mod” plays different roles in them.

  10. 10

    How can congruences be combined under addition and multiplication?

    Model answer

    If a≡b(modm)a\equiv b\pmod ma≡b(modm) and c≡d(modm)c\equiv d\pmod mc≡d(modm), then a+c≡b+d(modm)a+c\equiv b+d\pmod ma+c≡b+d(modm) and ac≡bd(modm)ac\equiv bd\pmod mac≡bd(modm).

    Explanation

    Numbers can be replaced by congruent numbers inside sums and products without changing the resulting congruence.

  11. 11

    Which operations can safely be applied to both sides of a congruence, and why is division not generally one of them?

    Model answer

    Adding or multiplying both sides by an integer preserves congruence, but division may not. For example, 14≡8(mod6)14\equiv8\pmod614≡8(mod6), while 7≢4(mod6)7\not\equiv4\pmod67≡4(mod6).

    Explanation

    Division can destroy congruence unless the number being cancelled is relatively prime to the modulus.

  12. 12

    How can a large sum or product modulo mmm be calculated using smaller numbers?

    Model answer

    Reduce each number modulo mmm, perform the addition or multiplication on the remainders, and reduce the result modulo mmm again.

    Explanation

    Congruence is preserved by addition and multiplication, so intermediate values can be kept small.

  13. 13

    What is Zm\mathbb Z_mZm​, and how are addition and multiplication modulo mmm defined on it?

    Model answer

    Zm={0,1,…,m−1}\mathbb Z_m=\{0,1,\ldots,m-1\}Zm​={0,1,…,m−1}. Add or multiply normally, then take the result modulo mmm.

    Explanation

    The reduced answer always lies in Zm\mathbb Z_mZm​.

  14. 14

    Name the main arithmetic properties of Zm\mathbb Z_mZm​ described in the content.

    Model answer

    It is closed under addition and multiplication; both operations are associative and commutative; 000 and 111 are their respective identities; every element has an additive inverse; and multiplication distributes over addition.

    Explanation

    For nonzero aaa, its additive inverse is m−am-am−a, while 000 is its own additive inverse.

  15. 15

    Why does a multiplicative inverse not exist for every element of Zm\mathbb Z_mZm​?

    Model answer

    Some elements cannot be multiplied by any element of Zm\mathbb Z_mZm​ to produce 111. For example, 222 has no multiplicative inverse modulo 666.

    Explanation

    The existence of an inverse depends on whether the element and the modulus are relatively prime.

  16. 16

    What does a positional representation in base bbb mean, and what restrictions apply to its digits?

    Model answer

    A number is written as a sum of digits multiplied by powers of bbb. Each digit is from 000 to b−1b-1b−1, the leading digit is nonzero, and the representation is unique.

    Explanation

    The base specifies the place values; in base ten, for example, the places are powers of ten.

  17. 17

    What are binary, octal, and hexadecimal, and which symbols can each use?

    Model answer

    Binary is base 222 and uses 0,10,10,1; octal is base 888 and uses 000 through 777; hexadecimal is base 161616 and uses 000 through 999 and AAA through FFF.

    Explanation

    In hexadecimal, AAA through FFF represent 101010 through 151515.

  18. 18

    Why are binary, octal, and hexadecimal useful in computing, and what do hexadecimal letters represent?

    Model answer

    Computers store data in binary, while octal and hexadecimal provide compact ways to represent binary values. The hexadecimal symbols A,B,C,D,E,FA,B,C,D,E,FA,B,C,D,E,F represent 10,11,12,13,14,1510,11,12,13,14,1510,11,12,13,14,15.

    Explanation

    Binary suits on/off computer circuits, and powers of 888 and 161616 align conveniently with groups of binary digits.

  19. 19

    How do you convert a binary number to decimal, and what do 1112111_21112​ and 11011211011_2110112​ equal?

    Model answer

    Multiply each bit by its corresponding power of 222 and add the results. 1112=7111_2=71112​=7 and 110112=2711011_2=27110112​=27.

    Explanation

    From right to left, binary place values are 20,21,222^0,2^1,2^220,21,22, and so on.

  20. 20

    How do you convert an octal number to decimal, and what do 1118111_81118​ and 701687016_870168​ equal?

    Model answer

    Multiply each digit by its place value, a power of 888, and add. 1118=73111_8=731118​=73 and 70168=35987016_8=359870168​=3598.

    Explanation

    Octal place values from right to left are 80,81,828^0,8^1,8^280,81,82, and so on.

  21. 21

    How do you convert a hexadecimal number to decimal, and what do E516E5_{16}E516​ and 2AE0B162AE0B_{16}2AE0B16​ equal?

    Model answer

    Replace letters with their values, multiply each digit by its power-of-161616 place value, and add. E516=229E5_{16}=229E516​=229 and 2AE0B16=1756272AE0B_{16}=1756272AE0B16​=175627.

    Explanation

    For example, E=14E=14E=14, A=10A=10A=10, and B=11B=11B=11.

  22. 22

    Describe the repeated-division algorithm for converting a positive integer to base bbb.

    Model answer

    Repeatedly divide the current quotient by bbb and record each remainder. Stop when the quotient is zero, then read the remainders in reverse order.

    Explanation

    The first remainder is the rightmost base-bbb digit, and each subsequent remainder gives the next digit to its left.

  23. 23

    What is the octal representation of decimal 123451234512345, and how can it be checked?

    Model answer

    1234510=30071812345_{10}=30071_81234510​=300718​. Check by evaluating 3⋅84+7⋅8+13\cdot8^4+7\cdot8+13⋅84+7⋅8+1.

    Explanation

    Repeated division by 888 produces remainders from right to left; evaluating the resulting expansion recovers the original number.

  24. 24

    Why can binary-to-octal and binary-to-hexadecimal conversion be done by regrouping bits, and what are the group sizes?

    Model answer

    Since 8=238=2^38=23, group binary bits in threes for octal; since 16=2416=2^416=24, group them in fours for hexadecimal. Pad the left end with zeros if needed.

    Explanation

    Each group corresponds exactly to one digit in the target base.

  25. 25

    What are the octal and hexadecimal forms of the binary string 111110101111001111101011110011111010111100?

    Model answer

    Grouping from the right in threes gives 37274837274_8372748​; grouping in fours gives 3EBC163EBC_{16}3EBC16​.

    Explanation

    A leading zero is added before grouping when the bit count is not a multiple of the group size.

  26. 26

    How does binary addition process each bit, including the carry?

    Model answer

    At each position, add the two input bits and the incoming carry. The sum bit is the result modulo 222, and the outgoing carry is the floor of the result divided by 222.

    Explanation

    The carry from the final position becomes the new top bit.

  27. 27

    How does the shifted-partial-products method multiply binary integers, and what is its bit-operation cost for two nnn-bit inputs?

    Model answer

    For each 111 bit of one factor, shift the other factor left by that bit position, then add the partial products. The cost is O(n2)O(n^2)O(n2) bit additions.

    Explanation

    There are nnn partial products, and adding each costs about nnn bit operations.

  28. 28

    How does repeated squaring compute bnb^nbn, and why is it more efficient than multiplying by bbb repeatedly?

    Model answer

    Write nnn in binary, build b,b2,b4,b8,…b,b^2,b^4,b^8,\ldotsb,b2,b4,b8,… by successive squaring, and multiply the powers corresponding to 111 bits. This uses about O(log⁡n)O(\log n)O(logn) multiplications.

    Explanation

    For instance, 11=8+2+111=8+2+111=8+2+1, so 311=38⋅32⋅33^{11}=3^8\cdot3^2\cdot3311=38⋅32⋅3.

  29. 29

    How does modular exponentiation keep calculations small, and what is its stated bit-operation cost?

    Model answer

    Process the exponent's bits, multiply the running answer when a bit is 111, and square the current power each round, reducing modulo mmm after each multiplication. The stated cost is O((log⁡m)2log⁡n)O((\log m)^2\log n)O((logm)2logn) bit operations.

    Explanation

    Reducing after each operation keeps values below mmm, and the loop runs once per exponent bit.

  30. 30

    Define prime and composite numbers, and explain the status of 111.

    Model answer

    A prime is an integer greater than 111 whose only positive divisors are 111 and itself. A composite integer greater than 111 is not prime; 111 is neither.

    Explanation

    A composite number has a divisor strictly between 111 and itself.

  31. 31

    State the Fundamental Theorem of Arithmetic and illustrate it with the factorizations of 100100100 and 999999999.

    Model answer

    Every integer greater than 111 has a unique prime factorization, up to the order of its factors. For example, 100=22⋅52100=2^2\cdot5^2100=22⋅52 and 999=33⋅37999=3^3\cdot37999=33⋅37.

    Explanation

    Prime factors act like the unique building blocks of each integer.

  32. 32

    How does the Sieve of Eratosthenes identify primes up to 100100100, and why is it enough to cross out multiples of 2,3,5,72,3,5,72,3,5,7?

    Model answer

    Keep each prime and cross out its other multiples. These four primes suffice because every composite n≤100n\le100n≤100 has a prime divisor no greater than n≤10\sqrt n\le10n​≤10.

    Explanation

    Any composite number has a factor at most its square root; the primes below 101010 are 2,3,5,72,3,5,72,3,5,7.

  33. 33

    What is trial division, and why is checking divisors only through n\sqrt nn​ sufficient?

    Model answer

    Test integers from 222 through n\sqrt nn​ for divisibility by nnn. If none divides nnn, then nnn is prime.

    Explanation

    If n=abn=abn=ab is composite, its factors cannot both exceed n\sqrt nn​.

  34. 34

    How does Euclid's proof show that there are infinitely many primes?

    Model answer

    Assume the primes are a finite list and form their product plus one. No listed prime divides that number, so it has a prime factor missing from the list, a contradiction.

    Explanation

    The constructed number is either prime itself or has a prime factor not in the supposed complete list.

  35. 35

    What is a Mersenne prime, and why does a prime exponent not guarantee one?

    Model answer

    A Mersenne prime is a prime of the form 2p−12^p-12p−1, where the result is prime. A prime exponent is not enough: 211−1=2047=23⋅892^{11}-1=2047=23\cdot89211−1=2047=23⋅89 is composite.

    Explanation

    Some examples are 22−1=32^2-1=322−1=3 and 27−1=1272^7-1=12727−1=127, but the form does not always produce a prime.

  36. 36

    What does the prime number theorem say about the number of primes up to xxx and the chance a large integer is prime?

    Model answer

    The number of primes up to xxx is approximately x/ln⁡xx/\ln xx/lnx. A randomly selected integer below nnn has probability about 1/ln⁡n1/\ln n1/lnn of being prime.

    Explanation

    The estimate becomes more accurate as xxx grows, so primes become rarer but slowly.

  37. 37

    What does the content state about simple formulas or nonconstant integer-coefficient polynomials that always produce primes?

    Model answer

    There is no simple formula that always produces primes, and no nonconstant polynomial with integer coefficients does so for every input.

    Explanation

    A constant polynomial such as the constant value 222 is an excluded, trivial exception.

  38. 38

    Why does n2−n+41n^2-n+41n2−n+41 not give a prime for every input, despite producing primes for n=1n=1n=1 through 404040?

    Model answer

    At n=41n=41n=41, the expression equals 41241^2412, which is composite.

    Explanation

    Many successful examples are evidence, not proof of a universal claim.

  39. 39

    State Goldbach's conjecture and distinguish its computational evidence from a proof.

    Model answer

    It conjectures that every even integer greater than 222 is the sum of two primes. It has been checked computationally to a very large range, but no proof is known.

    Explanation

    Examples include 10=3+710=3+710=3+7 and 20=3+1720=3+1720=3+17; extensive verification does not establish the claim for all even numbers.

  40. 40

    What are the twin prime conjecture and the conjecture about primes of the form n2+1n^2+1n2+1?

    Model answer

    The twin prime conjecture proposes infinitely many prime pairs differing by 222. It is also conjectured that infinitely many n2+1n^2+1n2+1 are prime; neither claim is proved.

    Explanation

    Examples of twin primes include (3,5)(3,5)(3,5) and (11,13)(11,13)(11,13).

  41. 41

    What weaker result about numbers of the form n2+1n^2+1n2+1 is stated?

    Model answer

    Infinitely many numbers of the form n2+1n^2+1n2+1 are either prime or a product of at most two primes.

    Explanation

    This result is weaker than the unproved claim that infinitely many such numbers are prime.

  42. 42

    What is the greatest common divisor, and when are two integers called relatively prime?

    Model answer

    The greatest common divisor is the largest positive integer dividing both numbers. They are relatively prime when their greatest common divisor is 111.

    Explanation

    For example, gcd⁡(24,36)=12\gcd(24,36)=12gcd(24,36)=12, while gcd⁡(17,22)=1\gcd(17,22)=1gcd(17,22)=1.

  43. 43

    What does it mean for a list of integers to be pairwise relatively prime?

    Model answer

    Every pair of distinct entries in the list must have greatest common divisor 111.

    Explanation

    One pair with a common divisor greater than 111 makes the whole list fail the condition.

  44. 44

    How is the greatest common divisor obtained from prime factorizations?

    Model answer

    For each prime, take the smaller exponent in the two factorizations, treating a missing prime as exponent 000, and multiply the resulting prime powers.

    Explanation

    For example, 120=23⋅3⋅5120=2^3\cdot3\cdot5120=23⋅3⋅5 and 500=22⋅53500=2^2\cdot5^3500=22⋅53 give gcd⁡(120,500)=22⋅5=20\gcd(120,500)=2^2\cdot5=20gcd(120,500)=22⋅5=20.

  45. 45

    How is the least common multiple obtained from prime factorizations, and what is its defining meaning?

    Model answer

    The least common multiple is the smallest positive common multiple; use the larger exponent of each prime in the two factorizations.

    Explanation

    For 23⋅35⋅722^3\cdot3^5\cdot7^223⋅35⋅72 and 24⋅332^4\cdot3^324⋅33, the LCM is 24⋅35⋅722^4\cdot3^5\cdot7^224⋅35⋅72.

  46. 46

    State the relationship between the product of two positive integers, their GCD, and their LCM.

    Model answer

    ab=gcd⁡(a,b)lcm⁡(a,b)ab=\gcd(a,b)\operatorname{lcm}(a,b)ab=gcd(a,b)lcm(a,b).

    Explanation

    For each prime, the smaller and larger exponents used in the GCD and LCM sum to the two original exponents.

  47. 47

    State the key remainder property behind the Euclidean algorithm.

    Model answer

    If a=bq+ra=bq+ra=bq+r, then gcd⁡(a,b)=gcd⁡(b,r)\gcd(a,b)=\gcd(b,r)gcd(a,b)=gcd(b,r).

    Explanation

    The pairs (a,b)(a,b)(a,b) and (b,r)(b,r)(b,r) have exactly the same common divisors.

  48. 48

    Use the Euclidean algorithm to find gcd⁡(287,91)\gcd(287,91)gcd(287,91) and describe its stopping rule.

    Model answer

    287=3⋅91+14287=3\cdot91+14287=3⋅91+14, 91=6⋅14+791=6\cdot14+791=6⋅14+7, and 14=2⋅7+014=2\cdot7+014=2⋅7+0, so the GCD is 777. Stop when the remainder is zero; the last nonzero remainder is the GCD.

    Explanation

    Each step replaces the pair by the divisor and remainder without changing the GCD.

  49. 49

    Why must the Euclidean algorithm terminate, and what running time is stated for it?

    Model answer

    Each remainder is a nonnegative integer strictly smaller than the preceding divisor, so the remainders cannot decrease forever. Its running time is O(log⁡b)O(\log b)O(logb) when a≥ba\ge ba≥b.

    Explanation

    The finite decreasing sequence must eventually reach remainder zero.

  50. 50

    State Bezout's identity and explain what Bezout coefficients may look like.

    Model answer

    For positive integers a,ba,ba,b, there are integers s,ts,ts,t such that gcd⁡(a,b)=sa+tb\gcd(a,b)=sa+tbgcd(a,b)=sa+tb. The coefficients may be negative.

    Explanation

    For example, 2=(−2)⋅6+1⋅142=(-2)\cdot6+1\cdot142=(−2)⋅6+1⋅14.

  51. 51

    How can Bezout coefficients be found using the Euclidean algorithm?

    Model answer

    Run the Euclidean algorithm forward, record each division, then substitute remainders backward until the GCD is expressed using the original numbers.

    Explanation

    For 252252252 and 198198198, back-substitution gives 18=4⋅252−5⋅19818=4\cdot252-5\cdot19818=4⋅252−5⋅198.

  52. 52

    What is the extended Euclidean algorithm's advantage over backward substitution?

    Model answer

    It carries the Bezout coefficients along during the divisions, finding them in one pass rather than substituting backward afterward.

    Explanation

    It is therefore a convenient method for a computer to use.

  53. 53

    State the divisibility consequence of Bezout's identity when aaa and bbb are relatively prime.

    Model answer

    If gcd⁡(a,b)=1\gcd(a,b)=1gcd(a,b)=1 and a∣bca\mid bca∣bc, then a∣ca\mid ca∣c.

    Explanation

    Bezout gives sa+tb=1sa+tb=1sa+tb=1; multiplying by ccc shows that ccc is a sum of terms both divisible by aaa.

  54. 54

    What does the prime-divisor lemma say about a prime dividing a product?

    Model answer

    If a prime ppp divides a product a1a2⋯ana_1a_2\cdots a_na1​a2​⋯an​, then it divides at least one factor.

    Explanation

    A prime dividing a product must divide one factor outright.

  55. 55

    How does the prime-divisor lemma support uniqueness of prime factorization?

    Model answer

    If two prime factorizations differed, a prime in one would have to divide a prime in the other, forcing the two primes to be equal and contradicting the supposed difference.

    Explanation

    After common primes are cancelled, the prime-divisor lemma forces a shared prime to remain, which is impossible.

  56. 56

    Under what condition can a common factor be cancelled from a congruence?

    Model answer

    From ac≡bc(modm)ac\equiv bc\pmod mac≡bc(modm), one can conclude a≡b(modm)a\equiv b\pmod ma≡b(modm) when gcd⁡(c,m)=1\gcd(c,m)=1gcd(c,m)=1.

    Explanation

    Cancellation can fail when ccc and mmm share a common factor, as in 14≡8(mod6)14\equiv8\pmod614≡8(mod6) but 7≢4(mod6)7\not\equiv4\pmod67≡4(mod6) after dividing by 222.

  57. 57

    What is a linear congruence, and how are its solutions organized?

    Model answer

    A linear congruence has the form ax≡b(modm)ax\equiv b\pmod max≡b(modm). If xxx is a solution, then so are x+kmx+kmx+km for integers kkk, so solutions occur in congruence classes.

    Explanation

    The number of solution classes depends on aaa and mmm.

  58. 58

    What do the examples 2x≡3(mod6)2x\equiv3\pmod62x≡3(mod6) and 2x≡2(mod6)2x\equiv2\pmod62x≡2(mod6) show about linear congruences?

    Model answer

    The first has no solution; the second has two solution classes, x≡1(mod6)x\equiv1\pmod6x≡1(mod6) and x≡4(mod6)x\equiv4\pmod6x≡4(mod6).

    Explanation

    A linear congruence need not have exactly one solution class.

  59. 59

    Define an inverse of aaa modulo mmm and explain how it is used to solve a linear congruence.

    Model answer

    An inverse aˉ\bar aaˉ satisfies aˉa≡1(modm)\bar a a\equiv1\pmod maˉa≡1(modm). Multiplying ax≡b(modm)ax\equiv b\pmod max≡b(modm) by aˉ\bar aaˉ isolates xxx.

    Explanation

    Multiplication preserves congruence, whereas ordinary division may not.

  60. 60

    When does an inverse of aaa modulo mmm exist, and how can Bezout's identity establish its existence?

    Model answer

    For m>1m>1m>1, an inverse exists when gcd⁡(a,m)=1\gcd(a,m)=1gcd(a,m)=1. If sa+tm=1sa+tm=1sa+tm=1, reducing modulo mmm gives sa≡1(modm)sa\equiv1\pmod msa≡1(modm), so sss is an inverse.

    Explanation

    The Euclidean algorithm can efficiently find the GCD and the Bezout coefficients.

  61. 61

    How can the inverse of 333 modulo 777 be found from the Euclidean algorithm?

    Model answer

    7=2⋅3+17=2\cdot3+17=2⋅3+1, so 1=7−2⋅31=7-2\cdot31=7−2⋅3. Thus −2-2−2 is an inverse of 333 modulo 777, and its representative from 000 to 666 is 555.

    Explanation

    Both −2-2−2 and 555 work because they are congruent modulo 777.

  62. 62

    Solve 3x≡4(mod7)3x\equiv4\pmod73x≡4(mod7) and explain how to verify the solution.

    Model answer

    Multiplying by the inverse −2-2−2 gives x≡6(mod7)x\equiv6\pmod7x≡6(mod7). Substitution gives 3x≡18≡4(mod7)3x\equiv18\equiv4\pmod73x≡18≡4(mod7).

    Explanation

    The full solution consists of every integer congruent to 666 modulo 777.

  63. 63

    State the Chinese Remainder Theorem for pairwise relatively prime moduli.

    Model answer

    For pairwise relatively prime moduli m1,…,mnm_1,\ldots,m_nm1​,…,mn​, any system of specified congruences has a unique solution modulo M=m1m2⋯mnM=m_1m_2\cdots m_nM=m1​m2​⋯mn​.

    Explanation

    There is one representative solution in the range from 000 to M−1M-1M−1; all others differ by multiples of MMM.

  64. 64

    How does the constructive proof of the Chinese Remainder Theorem build a solution?

    Model answer

    Set M=∏mkM=\prod m_kM=∏mk​, let Mk=M/mkM_k=M/m_kMk​=M/mk​, find yky_kyk​ with Mkyk≡1(modmk)M_ky_k\equiv1\pmod{m_k}Mk​yk​≡1(modmk​), and form x=∑akMkykx=\sum a_kM_ky_kx=∑ak​Mk​yk​.

    Explanation

    Modulo mkm_kmk​, every term except the kkkth vanishes, and the kkkth becomes aka_kak​.

  65. 65

    What is the solution to Sun-Tsu's system x≡2(mod3)x\equiv2\pmod3x≡2(mod3), x≡3(mod5)x\equiv3\pmod5x≡3(mod5), x≡2(mod7)x\equiv2\pmod7x≡2(mod7)?

    Model answer

    The smallest nonnegative solution is x≡23(mod105)x\equiv23\pmod{105}x≡23(mod105).

    Explanation

    The moduli are pairwise relatively prime, and 232323 leaves remainders 2,3,22,3,22,3,2 on division by 3,5,73,5,73,5,7.

  66. 66

    How does back substitution solve a system of congruences one equation at a time?

    Model answer

    Rewrite the first congruence as an equation with an integer parameter, substitute into the next congruence, solve for the new parameter, and repeat before converting the final equation back to a congruence.

    Explanation

    For x≡1(mod5)x\equiv1\pmod5x≡1(mod5), x≡2(mod6)x\equiv2\pmod6x≡2(mod6), x≡3(mod7)x\equiv3\pmod7x≡3(mod7), this method gives x≡206(mod210)x\equiv206\pmod{210}x≡206(mod210).

  67. 67

    State both forms of Fermat's little theorem given in the content.

    Model answer

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

    Explanation

    The second form does not require the condition that aaa is not divisible by ppp.

  68. 68

    Use Fermat's little theorem to reduce 72227^{222}7222 modulo 111111.

    Model answer

    710≡1(mod11)7^{10}\equiv1\pmod{11}710≡1(mod11) and 222=22⋅10+2222=22\cdot10+2222=22⋅10+2, so 7222≡72≡5(mod11)7^{222}\equiv7^2\equiv5\pmod{11}7222≡72≡5(mod11).

    Explanation

    The exponent's multiple of 101010 contributes a factor congruent to 111.

  69. 69

    What is a pseudoprime to base bbb, and what can a failed or passed Fermat test establish?

    Model answer

    A composite nnn with bn−1≡1(modn)b^{n-1}\equiv1\pmod nbn−1≡1(modn) is a pseudoprime to base bbb. Failure proves nnn composite; passing means it may be prime or a pseudoprime.

    Explanation

    Passing a Fermat test is evidence, not a proof of primality.

  70. 70

    Why is 341341341 a pseudoprime to base 222?

    Model answer

    341=11⋅31341=11\cdot31341=11⋅31 is composite, but 210≡1(mod341)2^{10}\equiv1\pmod{341}210≡1(mod341) and 340=34⋅10340=34\cdot10340=34⋅10, so 2340≡1(mod341)2^{340}\equiv1\pmod{341}2340≡1(mod341).

    Explanation

    It passes the base-222 Fermat test despite being composite.

  71. 71

    What is a primitive root modulo a prime ppp?

    Model answer

    It is a number whose positive powers modulo ppp reach every nonzero residue exactly once before repeating.

    Explanation

    Its powers generate all nonzero elements of Zp\mathbb Z_pZp​.

  72. 72

    Why is 222 a primitive root modulo 111111, while 333 is not?

    Model answer

    The powers of 222 reach all ten nonzero residues modulo 111111. The powers of 333 return to 111 after five steps and reach only five values.

    Explanation

    A primitive root must generate every nonzero residue before the powers repeat.

  73. 73

    What is a discrete logarithm modulo a prime, and why is the problem important in cryptography?

    Model answer

    For a primitive root rrr, the discrete logarithm of aaa is the exponent eee such that re≡aext(modp)r^e\equiv a ext{ (mod }p)re≡aext(modp). Computing powers is efficient, but recovering the exponent for large parameters is not known to be efficient for ordinary computers.

    Explanation

    This difference between easy forward computation and difficult reversal is useful in cryptographic systems.

  74. 74

    How does a hashing function map keys to storage locations, and what does h(k)=kmod⁡mh(k)=k\operatorname{ mod }mh(k)=kmodm guarantee?

    Model answer

    It maps a record's key to a memory location; h(k)=kmod⁡mh(k)=k\operatorname{ mod }mh(k)=kmodm maps keys into 0,…,m−10,\ldots,m-10,…,m−1.

    Explanation

    Every location in that range can be reached by the modulo function.

  75. 75

    What is a collision in hashing, why are collisions unavoidable, and how does linear probing handle them?

    Model answer

    A collision occurs when different keys map to the same location. Collisions are unavoidable when there are more possible keys than locations; linear probing tries (h(k)+i)mod⁡m(h(k)+i)\operatorname{ mod }m(h(k)+i)modm until it finds an empty slot.

    Explanation

    Taking modulo mmm makes probing wrap from the end of the table back to its beginning.

  76. 76

    What are pseudorandom numbers, and what does a linear congruential generator do?

    Model answer

    Pseudorandom numbers are generated by a fixed rule that looks random. A linear congruential generator uses xn+1=(axn+c)mod⁡mx_{n+1}=(ax_n+c)\operatorname{ mod }mxn+1​=(axn​+c)modm.

    Explanation

    The parameters are the modulus, multiplier, increment, and starting seed.

  77. 77

    What controls the range and period of a linear congruential generator, and why must a pure multiplicative generator avoid a zero seed?

    Model answer

    Outputs lie from 000 to m−1m-1m−1, and the period is the number of terms before the sequence repeats. If c=0c=0c=0 and the seed is 000, every output remains 000.

    Explanation

    A good generator needs a long period; once a value repeats, the deterministic sequence repeats.

  78. 78

    For xn+1=(7xn+4)mod⁡9x_{n+1}=(7x_n+4)\operatorname{ mod }9xn+1​=(7xn​+4)mod9 with x0=3x_0=3x0​=3, what sequence is produced before it repeats?

    Model answer

    The sequence is 3,7,8,6,1,2,0,4,53,7,8,6,1,2,0,4,53,7,8,6,1,2,0,4,5, then it returns to 333.

    Explanation

    There are nine possible residues modulo 999, and this example visits all nine before repeating.

  79. 79

    What is a check digit, and how can a weighted-sum rule detect an error?

    Model answer

    A check digit is an extra digit chosen to make a weighted sum satisfy a modular condition. A mistyped digit changes the sum and may cause the condition to fail.

    Explanation

    The check can signal an error without identifying or correcting it.

  80. 80

    State the Universal Product Code check-digit rule described in the content.

    Model answer

    Multiply digits in odd positions by 333, leave digits in even positions unchanged, and require the total to be congruent to 000 modulo 101010.

    Explanation

    Weighting alternate positions differently also helps detect swaps of neighboring digits.

  81. 81

    What check digit completes the UPC whose first eleven digits are 793573431047935734310479357343104?

    Model answer

    The check digit is 222.

    Explanation

    The weighted sum of the first eleven digits is 989898, so adding 222 makes the total 100100100, a multiple of 101010.

  82. 82

    What conclusion follows when a full UPC's weighted sum is not congruent to 000 modulo 101010?

    Model answer

    The UPC fails the check and contains an error, but the test does not identify the incorrect digit or the correct code.

    Explanation

    The example code with weighted sum 444444 fails because 44≢0(mod10)44\not\equiv0\pmod{10}44≡0(mod10).

  83. 83

    State the ISBN-10 check-digit rule and explain why the letter XXX may appear.

    Model answer

    Multiply the ten digits by their position weights 111 through 101010 and require the weighted sum to be 000 modulo 111111. The value 101010 is written as XXX.

    Explanation

    Equivalently, the check digit is selected from the first nine digits so that the full weighted sum is divisible by 111111.

  84. 84

    What check digit completes the ISBN with first nine digits 007288008007288008007288008?

    Model answer

    The check digit is 222.

    Explanation

    The first nine weighted terms sum to 189189189, and 189mod⁡11=2189\operatorname{ mod }11=2189mod11=2.

  85. 85

    Why does the ISBN-10 rule detect every single-digit error and every transposition error, according to the content?

    Model answer

    Its modulus is the prime 111111, so a changed digit or a swap of two distinct digits changes the weighted sum by a nonzero amount modulo 111111.

    Explanation

    Modulo a prime, a product can be zero only if at least one factor is zero, so the change cannot be cancelled by the weights.

  86. 86

    How does the Caesar cipher encode letters mathematically, and what are its encryption and decryption operations?

    Model answer

    Represent letters by numbers 000 through 252525. Encrypt with f(p)=(p+3)mod⁡26f(p)=(p+3)\operatorname{ mod }26f(p)=(p+3)mod26 and decrypt with f−1(p)=(p−3)mod⁡26f^{-1}(p)=(p-3)\operatorname{ mod }26f−1(p)=(p−3)mod26.

    Explanation

    The modulo operation wraps shifts past ZZZ back to the beginning of the alphabet.

  87. 87

    What ciphertext does the Caesar cipher produce for “MEET YOU,” and why does YYY encrypt to BBB?

    Model answer

    It produces “PHHW BRX.” Since YYY is 242424, adding 333 gives 272727, which reduces to 111, or BBB, modulo 262626.

    Explanation

    Each letter is shifted three positions forward with alphabetic wraparound.

  88. 88

    What is a shift cipher, and why is its key easy to find by exhaustive search?

    Model answer

    A shift cipher adds a fixed key kkk modulo 262626 and decrypts by subtracting kkk. There are only 262626 possible keys.

    Explanation

    A person trying every possible key can test each resulting message for readable text.

  89. 89

    How is an affine cipher defined, and what condition makes it decryptable?

    Model answer

    It encrypts by f(p)=(ap+b)mod⁡26f(p)=(ap+b)\operatorname{ mod }26f(p)=(ap+b)mod26. It is decryptable exactly when gcd⁡(a,26)=1\gcd(a,26)=1gcd(a,26)=1.

    Explanation

    That condition makes the mapping a bijection and ensures that aaa has a multiplicative inverse modulo 262626.

  90. 90

    How is an affine cipher decrypted?

    Model answer

    If the ciphertext number is ccc, then p≡aˉ(c−b)(mod26)p\equiv\bar a(c-b)\pmod{26}p≡aˉ(c−b)(mod26), where aˉ\bar aaˉ is the inverse of aaa modulo 262626.

    Explanation

    Subtract bbb from the encryption equation, then multiply by the inverse of aaa.

  91. 91

    For the affine cipher with a=7a=7a=7 and b=3b=3b=3, what does the letter KKK encrypt to?

    Model answer

    KKK is 101010, and 7⋅10+3=73≡21(mod26)7\cdot10+3=73\equiv21\pmod{26}7⋅10+3=73≡21(mod26), so it encrypts to VVV.

    Explanation

    The cipher is valid because gcd⁡(7,26)=1\gcd(7,26)=1gcd(7,26)=1.

  92. 92

    How can English letter frequencies be used to attack a shift cipher?

    Model answer

    Count ciphertext letters, guess that the most frequent one represents common English letters such as EEE, infer the shift, and decrypt to see whether readable English results.

    Explanation

    A shift moves the frequency pattern without changing its shape; unsuccessful guesses can be tried against other common letters.

  93. 93

    Why are shift and affine ciphers called monoalphabetic, and what weakness do they share?

    Model answer

    Each plaintext letter always maps to the same ciphertext letter. This preserves letter-frequency patterns, which can help an attacker recover the message.

    Explanation

    The same substitution is used throughout the message.

  94. 94

    What is a block cipher, and why does merely rearranging letters in blocks not defeat frequency analysis?

    Model answer

    A block cipher acts on groups of letters together. A cipher that only rearranges letters leaves every single-letter frequency unchanged.

    Explanation

    The transposition cipher is an example: it changes positions but not the letters themselves.

  95. 95

    What is a transposition cipher, and what role do its permutation and inverse play?

    Model answer

    It splits a message into blocks and rearranges positions using a permutation σ\sigmaσ. Decryption uses σ−1\sigma^{-1}σ−1 to undo the rearrangement.

    Explanation

    A permutation is a one-to-one mapping of the block positions onto themselves; short final blocks may be padded.

  96. 96

    How does the four-position transposition key in the content move letters, and what ciphertext does it produce for “PIRATE ATTACK”?

    Model answer

    It sends positions 1,2,3,41,2,3,41,2,3,4 to 3,1,4,23,1,4,23,1,4,2, respectively. The blocks PIRA, TEAT, and TACK become IAPR, ETTA, and AKTC.

    Explanation

    Apply the position permutation independently to each four-letter block.

  97. 97

    How is a message decrypted under the transposition key, and what does the example ciphertext “SWUE TRAE OEHS” decode to?

    Model answer

    Apply the inverse permutation to each block; the example decodes to “USE WATER HOSE.”

    Explanation

    The inverse restores the original positions, after which word boundaries can be inferred.

  98. 98

    What are the five components of a cryptosystem, and what condition must encryption and decryption satisfy?

    Model answer

    They are the plaintext set PPP, ciphertext set CCC, keyspace KKK, encryption functions EEE, and decryption functions DDD. For each key kkk, decryption after encryption must recover the plaintext: Dk(Ek(p))=pD_k(E_k(p))=pDk​(Ek​(p))=p.

    Explanation

    The matching functions must reverse each other so that a message is hidden but not lost.

  99. 99

    How does the shift cipher fit the five-part cryptosystem framework, and why is its keyspace weak?

    Model answer

    Its plaintext and ciphertext are strings over Z26\mathbb Z_{26}Z26​, its keyspace is Z26\mathbb Z_{26}Z26​, encryption adds kkk, and decryption subtracts kkk, all modulo 262626. It has only 262626 keys.

    Explanation

    A small keyspace makes exhaustive search practical.

  100. 100

    What distinguishes private-key cryptography from public-key cryptography?

    Model answer

    Private-key systems use a shared secret for encryption and decryption. Public-key systems publish the encryption key while keeping a separate decryption key secret.

    Explanation

    In public-key cryptography, someone can send an encrypted message without first sharing a secret with the receiver.

  101. 101

    What information forms an RSA public key, and how are its modulus and exponent chosen?

    Model answer

    The public key is (n,e)(n,e)(n,e). Choose distinct large primes p,qp,qp,q, set n=pqn=pqn=pq, and choose eee relatively prime to (p−1)(q−1)(p-1)(q-1)(p−1)(q−1).

    Explanation

    The relative-primality condition ensures that eee has an inverse modulo (p−1)(q−1)(p-1)(q-1)(p−1)(q−1).

  102. 102

    How are letters prepared and encrypted as RSA blocks?

    Model answer

    Encode each letter as a two-digit number, concatenate the numbers, divide them into blocks smaller than nnn, and encrypt each block with C=Memod⁡nC=M^e\operatorname{ mod }nC=Memodn.

    Explanation

    The block size is chosen so that every message block remains below the modulus.

  103. 103

    For the RSA public key (2537,13)(2537,13)(2537,13), how is “STOP” encoded into blocks, and what ciphertext blocks result?

    Model answer

    The letters become 18,19,14,1518,19,14,1518,19,14,15, giving blocks 181918191819 and 141514151415. Encryption gives 208120812081 and 218221822182.

    Explanation

    The four-digit blocks are below 253725372537, and each is raised to the 131313th power modulo 253725372537.

  104. 104

    How does RSA decryption work, and why does a decryption exponent exist?

    Model answer

    Choose ddd such that ed≡1(mod(p−1)(q−1))ed\equiv1\pmod{(p-1)(q-1)}ed≡1(mod(p−1)(q−1)), then recover each block with M=Cdmod⁡nM=C^d\operatorname{ mod }nM=Cdmodn. Such a ddd exists because eee is relatively prime to (p−1)(q−1)(p-1)(q-1)(p−1)(q−1).

    Explanation

    The condition imposed when choosing eee guarantees the inverse needed for decryption.

  105. 105

    Why does RSA's security depend on the difficulty of factoring its modulus?

    Model answer

    Computing n=pqn=pqn=pq is easy, but recovering ppp and qqq from a sufficiently large nnn is not known to be feasible. Knowing those primes allows calculation of the decryption exponent.

    Explanation

    The content emphasizes that factoring is believed difficult in practice, not proved to be difficult.

  106. 106

    In the RSA example with n=2537n=2537n=2537 and e=13e=13e=13, what private exponent decrypts the ciphertext blocks 0981,04610981,04610981,0461, and what message results?

    Model answer

    The private exponent is d=937d=937d=937. Decryption gives blocks 070407040704 and 111511151115, which spell “HELP.”

    Explanation

    Split the recovered digits into two-digit letter codes: 07=H07=H07=H, 04=E04=E04=E, 11=L11=L11=L, and 15=P15=P15=P.

  107. 107

    What is a cryptographic protocol, and what is the goal of the Diffie–Hellman protocol?

    Model answer

    A protocol is a sequence of messages exchanged to achieve a goal. Diffie–Hellman lets two participants establish a shared secret key over a public channel.

    Explanation

    An eavesdropper may hear every exchanged message without learning the final key.

  108. 108

    Describe how Alice and Bob produce the same Diffie–Hellman shared key.

    Model answer

    They publicly agree on a prime ppp and primitive root aaa. With private exponents k1,k2k_1,k_2k1​,k2​, they exchange ak1a^{k_1}ak1​ and ak2a^{k_2}ak2​ modulo ppp, then each computes ak1k2(modp)a^{k_1k_2}\pmod pak1​k2​(modp).

    Explanation

    Alice raises Bob's value to k1k_1k1​ and Bob raises Alice's value to k2k_2k2​; both results are equal.

  109. 109

    Why is it difficult for a Diffie–Hellman eavesdropper to compute the shared key from the public messages?

    Model answer

    The eavesdropper would need to recover a private exponent from a published power, which is the discrete logarithm problem.

    Explanation

    For large parameters, no efficient ordinary-computer method is known in the content.

  110. 110

    What does a digital signature establish, and how is it distinct from encryption for secrecy?

    Model answer

    A digital signature provides evidence of who authored a message. Unlike encryption for secrecy, it does not aim to hide the message.

    Explanation

    Recipients can verify the claimed sender even though the message may be readable by others.

  111. 111

    How does RSA signing work, and how does a recipient verify a signature?

    Model answer

    The sender applies the private RSA transformation to message blocks. A recipient applies the sender's public transformation, which recovers the original message if the signature is valid.

    Explanation

    Only the sender holds the private key, while anyone can use the public key to verify.

  112. 112

    What weakness does raw RSA signing have, and what improvement is used in real systems?

    Model answer

    An attacker can choose any number as a signature and compute its public-key transformation to create a message that passes the raw check. Real systems sign a hash of the message instead.

    Explanation

    Signing a hash avoids relying on the insecure teaching version that signs message blocks directly.

1 of 112
Question 1 of 112

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent