Modular Inverse
Context: FIT1058_MOC ยท division in ยท exists iff is coprime to ยท found via the Extended Euclidean Algorithm
Quick Revision
- ๐ฏ Objective: with โ division in = multiply by the inverse.
- ๐ฆ Core Components: exists iff โ โ computed by Extended Euclidean Algorithm.
- โก Key Constraint: prime modulus โน every nonzero element invertible (a field).
๐ Core
1. The Inverse
- Definition โ with โ the modular reciprocal.
- Division โ dividing means multiplying by the inverse.
- Examples โ : ; : only invertible.
2. Existence Theorem
- Iff coprime โ invertible in .
- Forward โ โน Bรฉzout โน coprime.
- Backward โ coprime โน โน .
3. Computing It
- Method โ run Extended Euclidean Algorithm on ; if , inverse .
- Sets โ , .
โ๏ธ Core Decision Matrix
| Element | Invertible in ? | Reason |
|---|---|---|
| never | ||
| always (self) | ||
| , | yes | Bรฉzout |
| sharing a factor | no |
When It Flips: invertibility is governed entirely by Coprimality with ; (Euler Totient Function). The inverse, when it exists, is unique in .
๐ Exam Execution Trace
Manual Execution Trace
in :
| Step / State | Inverse? | ||
|---|---|---|---|
| 0 (Init) | โ | โ | โ |
| 1 | 1 | 3 | no |
| 2 | 3 | 2 | no |
| 3 | 5 | 1 | yes |
โ ๏ธ Common Mistakes
- ๐ก never invertible, prime modulus special โ if prime, every nonzero element is coprime to โน all invertible (, a field); composite leaves some elements non-invertible.
๐ง Active Recall
For which does an inverse exist in , and why does lack one for 2 while has one for every nonzero element?
- Hint: Coprimality condition.
Answer
- Short answer: Invertible iff ; (none), but every nonzero mod 7 is coprime.
- Why: Prime field โ .
How do you actually compute in ?
- Hint: Extended Euclid.
Answer
- Short answer: Run EEA on ; if it gives , so .
- Why: Constructive Bรฉzout โ turns the existence proof into an algorithm.