Lably
Skip to content

Coin problem

Mathematical problem

  • 9 min read
  • 5 chapters

Related on Lably

Through Mathematics, Money and Coin

There is an explicit formula for the Frobenius number when there are only two different coin denominations, x and y, where the greatest common divisor of these two numbers is 1: xy−x−y. 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). 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.

Statement

In mathematical terms, the problem can be stated:

Given positive integers a1,a2,…,ansuch that gcd(a1,a2,…,an)=1, find the largest integer that cannot be expressed as an integer conical combination of these numbers, i.e., as a sum: k1a1+k2a2+⋯+knan
where k1,k2,…,kn are non-negative integers.

This largest integer is called the Frobenius number of the set {a1,a2,…,an}, and is usually denoted by g(a1,a2,…,an)

The existence of the Frobenius number depends on the condition that the greatest common divisor (GCD) is equal to 1. Indeed, the potential sums are multiples of the GCD in all cases. Hence, if it is not 1, then there are always arbitrarily large numbers that cannot be obtained as sums. For example, if you had two types of coins valued at 6 cents and 14 cents, the GCD would equal 2, and there would be no way to combine any number of such coins to produce a sum which was an odd number; additionally, even numbers 2, 4, 8, 10, 16 and 22 (less than m=24) could not be formed, either. On the other hand, whenever the GCD equals 1, the set of integers that cannot be expressed as a conical combination of {a1,a2,…,an} is bounded according to Schur's theorem, and therefore the Frobenius number exists.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Topics in mathematics