Modular Inverses and Bézout Coefficients
Find an inverse by the extended Euclidean algorithm and identify exactly when a residue class permits division.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A unit has gcd one with the modulus
An inverse of \(a\bmod m\) exists exactly when \(\gcd(a,m)=1\). If \(ax\equiv1\bmod m\), then \(ax+my=1\) for some integer \(y\), so every common divisor divides one. Conversely, a Bézout combination equaling one provides the inverse as its coefficient of \(a\). The calculation uses ordinary integer division to build a remainder sequence.
Substitute the remainders backward
For \(a=12,m=35\), use \(35=2\cdot12+11\) and \(12=11+1\). Substitution gives \(1=3\cdot12-35\), hence \(3\) is the inverse of \(12\) modulo \(35\). A nonunit such as \(5\bmod35\) has no inverse because its multiples remain divisible by five. Polynomial gcds use the same remainder invariant. Secret sharing uses inverses of nonzero field differences in interpolation.[1]