Coin problem

Two pence coin
Five pence coin
With only 2 pence and 5 pence coins, one cannot make 3 pence, but one can make any higher integer amount.
Frobenius coin problem with 2-pence and 5-pence coins visualised as graphs:
Sloping lines denote graphs of 2x+5y=n where n is the total in pence, and x and y are the non-negative number of 2p and 5p coins, respectively.
A point on a line gives a combination of 2p and 5p for its given total (green).
Multiple points on a line imply multiple possible combinations (blue).
Only lines with n = 1 or 3 have no points (red).

In mathematics, the coin problem (also referred to as the Frobenius coin problem or Frobenius problem, after the mathematician Ferdinand Frobenius) is a mathematical problem that asks for the largest monetary amount that cannot be obtained using only coins of specified denominations.[1] For example, the largest amount that cannot be obtained using only coins of 3 and 5 units is 7 units. The solution to this problem for a given set of coin denominations is called the Frobenius number of the set. The Frobenius number exists as long as the set of coin denominations is setwise coprime.

There is an explicit formula for the Frobenius number when there are only two different coin denominations, and : the Frobenius number is then . If the number of coin denominations is three or more, no explicit formula is known. However, for any fixed number of coin denominations, there is an algorithm for computing the Frobenius number in polynomial time (in the logarithms of the coin denominations forming an input).[2] No known algorithm is polynomial time in the number of coin denominations, and the general problem, where the number of coin denominations may be as large as desired, is NP-hard.[3][4]

  1. ^ J. Ramírez Alfonsín (2005). The Diophantine Frobenius problem. Oxford Univ. Press.
  2. ^ Ravi Kannan (1992). "Lattice translates of a polytope and the Frobenius problem". Combinatorica. 12 (2): 161–177. doi:10.1007/BF01204720. S2CID 19200821.
  3. ^ D. Beihoffer; J. Hendry; A. Nijenhuis; S. Wagon (2005). "Faster algorithms for Frobenius numbers". Electronic Journal of Combinatorics. 12: R27. doi:10.37236/1924.
  4. ^ Weisstein, Eric W. "Coin Problem". MathWorld.