Modular Arithmetic
- 55Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What does arithmetic modulo n keep track of?
The remainders left when integers are divided by n.
Or swipe the card
55 cards
What does arithmetic modulo n keep track of?
The remainders left when integers are divided by n.
How does arithmetic modulo 2 describe even and odd numbers?
Even numbers have remainder 0; odd numbers have remainder 1.
What does the notation a ext{ is congruent to } b mod n mean?
The integers a and b differ by an integer multiple of n.
What is the division algorithm for an integer a and a positive integer n?
There is a unique pair of integers q,r such that a=qn+r and 0≤r<n.
How can congruence modulo n be characterized using remainders?
a is congruent to b modulo n if and only if they have the same remainder when divided by n.
Why do equal remainders imply that two integers are congruent modulo n?
If a=qn+r and b=q′n+r, then a−b=(q−q′)n, a multiple of n.
Why does congruence modulo n imply equal remainders?
If the remainders are r and r′, their difference lies strictly between −n and n. Since congruence makes that difference a multiple of n, it must be 0.
What does the clock analogy show about 12 and 5 modulo 7?
They are congruent modulo 7 because both land at the same position on a seven-position clock.
In clock arithmetic modulo n, which integers represent the possible positions?
The remainders 0,1, dots,n-1.
How do you perform addition and multiplication modulo n?
Perform the usual operation, then reduce the result to its remainder modulo n.
What is 10exttimes12 modulo 7?
10exttimes12=120, and 120 has remainder 1 modulo 7.
What determines a product's remainder modulo n when the factor remainders are known?
The product of the factor remainders, reduced modulo n.
Does changing the order of modular addition change the result?
No. Modular addition is commutative: a+b is congruent to b+a modulo n.
Does changing the grouping of modular addition change the result?
No. Modular addition is associative: (a+b)+c is congruent to a+(b+c) modulo n.
Is modular multiplication commutative?
Yes. The order of the factors does not change the product modulo n.
How does multiplication distribute over addition modulo n?
a(b+c) is congruent to ab+ac modulo n.
What do addition and multiplication tables modulo n record?
The remainder produced by each pairwise sum or product of possible remainders.
What is the greatest common divisor, or GCD, of two integers?
The largest positive integer that divides both integers.
Why is checking every possible divisor a poor way to compute a GCD for large integers?
It can require testing too many candidates, making it impractical for very large numbers.
If bot<a, what basic GCD identity lets you replace b with a smaller number?
extGCD(a,b)=extGCD(a,b−a).
Why does subtracting one integer from another preserve their common divisors in the GCD step?
A divisor of both a and b divides b−a, and a divisor of both a and b−a divides b.
How does the division algorithm give a stronger GCD identity?
If b=qa+r, then extGCD(a,b)=extGCD(a,r).
What are the steps of the Euclidean algorithm?
Divide the larger number by the smaller, replace the larger number with the remainder, and repeat with the new pair until the remainder is 0.
When does the Euclidean algorithm stop, and how is the GCD identified?
It stops when the remainder is 0; the last nonzero remainder is the GCD.
What remainder sequence computes extGCD(360,46)?
360 divided by 46 leaves 38; 46 divided by 38 leaves 8; 38 divided by 8 leaves 6; 8 divided by 6 leaves 2; 6 divided by 2 leaves 0.
What is extGCD(360,46)?
2.
What does the extended Euclidean algorithm find in addition to the GCD?
Integers s and t such that sa+tb=extGCD(a,b).
How can an equation sa+tb=d, where d=extGCD(a,b), certify that d is the GCD?
Any common divisor of a and b must divide sa+tb=d, so no common divisor can be larger than d.
What is a multiplicative inverse of a modulo n?
A number s such that as is congruent to 1 modulo n.
What are the multiplicative inverses of 2 and 4 modulo 7?
They are inverses of each other: 2exttimes4=8, which is congruent to 1 modulo 7.
Why does every nonzero element modulo a prime p have a multiplicative inverse?
For nonzero a modulo p, extGCD(a,p)=1. The extended Euclidean algorithm gives as+pt=1, so as is congruent to 1 modulo p.
Why does 0 have no multiplicative inverse modulo n?
Multiplying 0 by any number gives 0, never a number congruent to 1 modulo n.
When can an element a have a multiplicative inverse modulo a possibly composite n?
Exactly when extGCD(a,n)=1.
How does the extended Euclidean algorithm produce an inverse of a modulo n when extGCD(a,n)=1?
Find s,t with as+nt=1; then s is an inverse of a modulo n.
How can multiplication by a modular inverse undo multiplication by a?
If as is congruent to 1 modulo n, multiplying a product by s cancels the factor a modulo n.
What is the inverse of 5 modulo 6?
5; indeed, 5exttimes5=25, which is congruent to 1 modulo 6.
What does it mean for two positive integers a and b to be relatively prime?
Their GCD is 1.
What does the Chinese remainder theorem say for relatively prime moduli a and b?
For any specified residues modulo a and b, exactly one integer n in the range 0≤n<ab has both residues.
What does the Chinese remainder theorem establish about integers from 0 to ab−1 and pairs of residues?
Each integer corresponds to a unique pair of remainders modulo a and b, and every possible pair occurs.
If two integers have the same remainder modulo a, what does that imply about their difference?
Their difference is divisible by a.
Why does having the same remainders modulo relatively prime a and b force two integers to be congruent modulo ab?
Both a and b divide their difference, and because extGCD(a,b)=1, their product ab divides it.
How does the range 0≤x,y<ab help prove uniqueness in the Chinese remainder theorem?
If x and y have the same two remainders, then ab divides x−y. Distinct numbers in that range cannot differ by a nonzero multiple of ab, so x=y.
Why does proving uniqueness of the residue pair also establish that every pair of residues occurs?
There are ab integers in the range and ab possible residue pairs; a one-to-one assignment between these equally sized finite sets must use every pair.
How can you construct a solution to n congruent to r modulo a and n congruent to s modulo b?
Write n=kb+s and solve kb congruent to r−s modulo a.
How do you solve for k in the construction of a Chinese remainder solution?
Since a and b are relatively prime, find b−1 modulo a and set k congruent to b−1(r−s) modulo a.
What is the smallest nonnegative solution to n congruent to 4 modulo 5 and n congruent to 1 modulo 7?
29.
What role does modular arithmetic play in cryptography?
It is a mathematical foundation for cryptographic schemes and can support private computation.
In the card-based movie-preference demonstration, what arrangement represents a participant who likes the movie?
Place the red card next to the center red card and the black card on the outside.
In the card-based preference demonstration, what does a run of three red cards indicate?
Both participants chose that they like the movie.
How does a random cyclic shift help conceal individual answers in the card demonstration?
It changes where the cards appear in the sequence, so an individual arrangement cannot be identified from its position.
How does the card demonstration illustrate a zero-knowledge proof idea?
It can reveal the outcome of a shared preference check without exposing which participant gave a particular individual answer.
How can modular remainders be used to represent snippets of a large file?
Represent the file as an integer N, then send moduli and the corresponding remainders of N.
When can a set of file remainders determine a large integer file value?
When the moduli are pairwise relatively prime and their product exceeds the possible file value, the Chinese remainder theorem can reconstruct it.
Why can repeatedly broadcasting different modular snippets help many people retrieve the same file?
Each recipient can collect enough snippets for the product of their moduli to exceed the file value, then reconstruct the file.
What important complication is omitted from the simplified fountain-code illustration?
Real systems must account for errors in transmitted messages.

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