A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Multiplicative Inverses in Modular Arithmetic

College Depth 78 in the knowledge graph I know this Set as goal
9topics build on this
365prerequisites beneath it
See this on the map →
Modular Arithmetic and CongruencesThe Euclidean Algorithm+1 moreCryptographic Applications: RSALinear Congruences and Solutions+1 more
number-theory modular-arithmetic inverses

Core Idea

An integer a has a multiplicative inverse modulo n (written a⁻¹) if aa⁻¹ ≡ 1 (mod n). This exists if and only if gcd(a,n)=1. The extended Euclidean algorithm efficiently computes multiplicative inverses and is crucial for solving congruences and RSA cryptography.

Explainer

In ordinary arithmetic, every nonzero number has a multiplicative inverse: 3 × (1/3) = 1, 7 × (1/7) = 1. But in modular arithmetic, there are no fractions. So what replaces 1/a? A multiplicative inverse mod n is an integer b such that a·b ≡ 1 (mod n) — meaning a·b leaves remainder 1 when divided by n. For example, the inverse of 3 mod 7 is 5, because 3·5 = 15 = 2·7 + 1 ≡ 1 (mod 7). Once you have this, you can "divide by 3" in mod 7 arithmetic by multiplying by 5 instead.

The key question is: when does this inverse exist? Your prerequisite on modular arithmetic introduced the idea that working mod n partitions integers into residue classes. The inverse of a mod n exists if and only if gcd(a, n) = 1 — that is, a and n share no common factor. Intuitively: if gcd(a,n) = d > 1, then a·b is always divisible by d for any b, so a·b can never leave remainder 1 (which isn't divisible by d). But if gcd(a,n) = 1, then a and n are "independent" enough that some combination a·b hits exactly 1 mod n.

To actually find the inverse, you use the extended Euclidean algorithm, which you already know computes gcd(a,n). Recall that the extended version doesn't just compute gcd(a,n) = 1 — it also finds integers s and t such that as + nt = 1 (Bézout's identity). Taking this equation mod n: as + nt ≡ as ≡ 1 (mod n), since nt ≡ 0. So s is the inverse of a mod n. For example, to invert 3 mod 7: the extended Euclidean algorithm finds 3·5 + 7·(−2) = 15 − 14 = 1, giving s = 5. The inverse is 5.

This tool is essential for solving linear congruences of the form ax ≡ b (mod n). When gcd(a,n)=1, the unique solution is x ≡ a⁻¹·b (mod n) — you just multiply both sides by the inverse. When gcd(a,n) > 1, solutions exist only if gcd(a,n) divides b, and there are multiple solutions. Multiplicative inverses also sit at the heart of RSA encryption: the decryption exponent d is the modular inverse of the encryption exponent e modulo φ(n), computed via the extended Euclidean algorithm on numbers with hundreds of digits.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesSet Operations: Union, Intersection, and ComplementProof by CasesProving by Cases and ExhaustionVacuous Truth and Trivial CasesProof by Cases (Proof by Exhaustion)Mathematical InductionDivisibility and Greatest Common DivisorThe Euclidean AlgorithmModular Arithmetic and CongruencesDivisor Functions and Multiplicative FunctionsMultiplicative Inverses in Modular Arithmetic

Longest path: 79 steps · 365 total prerequisite topics

Prerequisites (3)

Leads To (3)