One-Line Definition
A Linear Diophantine Equation is an equation of the form $ax + by = c$ where $a, b, c$ are given integers ($a, b \ne 0$) and we seek strictly integer values for $x$ and $y$ ($x, y \in \mathbb{Z}$).
Solution Motion & Bounds
Understanding Diophantine behavior relies on 3 key principles:
- • Step Balance: As $x$ increases in steps of $\frac{b}{d}$, $y$ decreases in steps of $\frac{a}{d}$.
- • Finite Non-Negative Range: Restricting $x \ge 0, y \ge 0$ creates upper & lower bounds on parameter $k$, producing a finite number of valid pairs.
- • McNugget Threshold: For co-prime $a, b$, the largest unrepresentable positive integer is $ab - a - b$.
Diophantine equations appear in CAT, MBA CET, and SNAP exam questions involving currency combinations, vendor transactions, and integer word problems. Click below to explore connected Quant Vault topics:
Where Is This Used in Real Life & Business?
1 Solvability Test & Bézout's Identity
Before spending time solving $ax + by = c$, test for integer solvability using the GCD Solvability Criterion:
If $\gcd(a, b)$ does NOT divide $c$, the equation has zero integer solutions.
Worked Example 1: Solvability Check
Question: Which of the following equations has valid integer solution pairs $(x, y)$?
(A) $14x + 21y = 45$ (B) $12x + 15y = 81$
2 General Parameterized Solution Formula
If $(x_0, y_0)$ is any single initial integer solution to $ax + by = c$, then all infinitely many integer solutions $(x, y)$ are generated by the Parametric Formula:
where $d = \gcd(a, b)$ and $k$ is any arbitrary integer ($k \in \mathbb{Z} = \{\dots, -2, -1, 0, 1, 2, \dots\}$).
⚡ How Step Motion Works
Notice that as $x$ increases in steps of $\frac{b}{d}$, $y$ decreases in steps of $\frac{a}{d}$ (or vice versa). The product of the step sizes balances out: $a \cdot \left(\frac{b}{d}\right) = b \cdot \left(\frac{a}{d}\right)$.
3 Counting Non-Negative & Positive Solutions
Competitive exam questions usually restrict solutions to non-negative integers ($x \ge 0, y \ge 0$) or positive integers ($x > 0, y > 0$).
🎯 4-Step Algorithm to Count Non-Negative Solutions
Compute $d = \gcd(a, b)$. Verify if $d \mid c$. If not, answer is 0.
Find the smallest non-negative integer $x_0 \ge 0$ by testing $x = 0, 1, 2, \dots, \frac{b}{d}-1$ until $(c - ax) \pmod b = 0$.
Set up $x = x_0 + k \cdot \frac{b}{d} \ge 0$ and $y = y_0 - k \cdot \frac{a}{d} \ge 0$ to solve for integer bounds on $k$.
Total non-negative solutions = $k_{\max} - k_{\min} + 1$.
$$\text{Number of Non-Negative Solutions} = \left\lfloor \frac{c}{a \cdot b} \right\rfloor \text{ or } \left\lfloor \frac{c}{a \cdot b} \right\rfloor + 1$$
For co-prime $a, b$, the number of non-negative solutions is always either $\lfloor c / (ab) \rfloor$ or $\lfloor c / (ab) \rfloor + 1$.
4 Frobenius Coin Theorem (Chicken McNugget Theorem)
The Frobenius Coin Problem asks: Given coin denominations $a$ and $b$ where $\gcd(a, b) = 1$, what is the largest monetary amount that CANNOT be paid exactly using non-negative counts of these coins?
Worked Example 2: McNugget Theorem Application
Question: A restaurant sells chicken nuggets in packs of 7 and 11. What is the maximum number of nuggets that CANNOT be bought?
$a = 7, b = 11 \implies \gcd(7, 11) = 1$.
$g(7, 11) = (7 \times 11) - 7 - 11 = 77 - 18 = 59$.
Thus, 59 nuggets is the largest quantity that cannot be bought!
Interactive Diophantine Equation Solver
Enter coefficients $a, b$ and constant $c$ to compute GCD, test solvability & count all non-negative integer solution pairs $(x \ge 0, y \ge 0)$!
How many non-negative integral solutions $(x \ge 0, y \ge 0)$ exist for $5x + 8y = 120$?
Find the number of positive integer solutions ($x > 0, y > 0$) for $3x + 4y = 100$.
A restaurant sells chicken nuggets in packs of 7 and 11. What is the maximum number of nuggets that CANNOT be bought?