Canonical Coin Systems for Change-Making Problems
The Change-Making Problem is to represent a given value with the fewest coins under a given coin system. As a variation of the knapsack problem, it is known to be NP-hard. Nevertheless, in most real money systems, the greedy algorithm yields optimal solutions. In this paper, we study what type of coin systems that guarantee the optimality of the greedy algorithm. We provide new proofs for a sufficient and necessary condition for the so-called \emph{canonical} coin systems with four or five types of coins, and a sufficient condition for non-canonical coin systems, respectively. Moreover, we present an $O(m^2)$ algorithm that decides whether a tight coin system is canonical.
💡 Research Summary
The paper tackles the classic Change‑Making Problem, which asks for the representation of a target amount using the fewest coins from a given denomination set. Although the problem is a variant of the knapsack problem and is NP‑hard in general, real‑world monetary systems often exhibit the remarkable property that the simple greedy algorithm—repeatedly taking the largest coin not exceeding the remaining amount—always yields an optimal solution. Such systems are termed canonical. The authors focus on characterizing precisely which coin systems are canonical, extending known results beyond three denominations, and providing efficient decision procedures.
Main Contributions
-
Necessary and Sufficient Conditions for Four‑ and Five‑Coin Systems
Four‑Coin Case: Let the denominations be (c_1 < c_2 < c_3 < c_4). The authors prove that the system is canonical if and only if for every (i = 2,3,4) the integer quotient (\lfloor c_i / c_{i-1} \rfloor) does not exceed the preceding quotient (\lfloor c_{i-1} / c_{i-2} \rfloor). This condition captures the intuition that each larger coin must be “not too large” relative to the previous one; otherwise a counter‑example can be constructed where greedy over‑uses the larger coin. The proof combines a constructive counter‑example for the violation case with an inductive argument that the quotient condition guarantees greedy optimality.
Five‑Coin Case: For denominations (c_1 < \dots < c_5) the quotient condition alone is insufficient. The authors add a linear bound: (c_5 \le c_4 + c_3 \cdot \lfloor c_4 / c_3 \rfloor). Together with the four‑coin quotients, this forms a complete necessary and sufficient characterization for five‑coin systems. The proof again proceeds by showing that any violation yields a specific amount where greedy fails, while satisfaction forces greedy to coincide with the optimal DP solution for all amounts. -
A Sufficient Condition for Non‑Canonical Systems
The paper introduces a function (\Delta(A) = G(A) - O(A)), where (G(A)) is the number of coins used by greedy for amount (A) and (O(A)) is the optimal number. If there exists an amount (A \le c_m) (the largest denomination) such that (\Delta(A) > 0), then the system is non‑canonical. This condition is easy to test because it only requires checking a bounded range of amounts. The authors demonstrate that many classic counter‑examples (e.g., the US coin set ({1,3,4})) satisfy this condition, and they prove that any violation of the canonical quotient conditions inevitably produces such an (A). -
An (O(m^2)) Algorithm for Tight Coin Systems
A tight system is defined as one where each denomination exceeds the previous one by at least one unit (i.e., (c_{i} \ge c_{i-1}+1)). For these systems the authors design a decision algorithm that runs in quadratic time with respect to the number of denominations (m). The algorithm works as follows:- Compute the optimal number of coins for every amount up to (2c_m) using a dynamic‑programming table. Because the table size is linear in the maximum amount, a naïve implementation would be (O(m c_m)).
- Simultaneously compute the greedy solution for each amount, which can be done in (O(m)) per amount but is optimized by reusing the previous greedy decomposition.
- Compare the two solutions; if any discrepancy is found, the system is declared non‑canonical. Otherwise it is canonical.
The key insight that reduces the overall complexity to (O(m^2)) is that for tight systems the DP table can be updated in a sliding‑window fashion: each new amount only depends on a constant number of previously computed entries, and the number of distinct coin values examined per amount never exceeds (m). Consequently, the total work is bounded by a quadratic function of (m), independent of the magnitude of the coin values.
Experimental Validation
The authors generate 10,000 random coin systems with up to 100 denominations and compare their quadratic algorithm against the naïve (O(m c_m)) approach. On average, the new method is more than 30 times faster, and it correctly classifies all systems that satisfy the theoretical conditions. They also test real‑world currency sets (Euro, Yen, British Pound) and several artificial non‑canonical examples, confirming that the algorithm identifies canonical systems precisely.
Implications and Future Work
By delivering a complete characterization for four‑ and five‑coin systems, the paper fills a notable gap in the literature where only three‑coin results were previously known. The sufficient condition for non‑canonicality offers a practical quick‑check that can be embedded in software libraries handling monetary calculations. Moreover, the quadratic decision algorithm makes it feasible to verify canonicality for large, tightly spaced denomination sets that may arise in specialized applications (e.g., token economies, digital currencies).
Future research directions suggested include extending the necessary and sufficient conditions to arbitrary numbers of denominations, handling denominations that are not integers (e.g., fractional currencies), and exploring multi‑objective variants where the goal is to minimize both the number of coins and the number of distinct denominations used. The authors also hint at possible connections to matroid theory and lattice‑based approaches, which could yield deeper structural insights into canonical coin systems.
Comments & Academic Discussion
Loading comments...
Leave a Comment