Coin problem
With only 2 pence and 5 pence coins, one cannot make 3 pence, but one can make any higher integral amount.
The coin problem is a mathematical problem that asks for the largest monetary amount that cannot be obtained using only coins of specified denominations. 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 has no common divisor greater than 1.
There is an explicit formula for the Frobenius number when there are only two different coin denominations, x and y : xy − x − y. If the number of coin denominations is three or more, no explicit formula is known; but, for any fixed number of coin denominations, there is an algorithm computing the Frobenius number in polynomial time. 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:This largest integer is called the Frobenius number of the set, and is usually denoted by g.
The requirement that the greatest common divisor equal 1 is necessary in order for the Frobenius number to exist. If the GCD were not 1, then starting at some number m the only sums possible are multiples of the GCD; every number past m that is not divisible by the GCD cannot be represented by any linear combination of numbers from the set. 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 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 is bounded according to Schur's theorem, and therefore the Frobenius number exists.
Frobenius numbers for small ''n''
A closed-form solution exists for the coin problem only where n = 1 or 2. No closed-form solution is known for n > 2.''n'' = 1
If n = 1, then a1 = 1 so that all natural numbers can be formed. Hence no Frobenius number in one variable exists.''n'' = 2
If n = 2, the Frobenius number can be found from the formula. This formula was discovered by James Joseph Sylvester in 1882, although the original source is sometimes incorrectly cited as, in which the author put his theorem as a recreational problem.Sylvester also demonstrated for this case that there are a total of non-representable integers.
Another form of the equation for is given by Skupień in this proposition: If and then, for each, there is exactly one pair of nonnegative integers and such that and.
The formula is proved as follows. Suppose we wish to construct the number. Note that, since, all of the integers for are mutually distinct modulo. Hence there is a unique value of, say, and a nonnegative integer, such that : Indeed, because.
''n'' = 3
Formulae and fast algorithms are known for three numbers though the calculations can be very tedious if done by hand.Simpler lower and upper bounds for Frobenius numbers for n = 3 have been also determined. The asymptotic lower bound due to Davison
is relatively sharp.. Comparison with the actual limit shows that the approximation is only 1 less than the true value as. It is conjectured that a similar parametric upper bound is where.
The asymptotic average behaviour of for three variables is also known:
Frobenius numbers for special sets
Arithmetic sequences
A simple formula exists for the Frobenius number of a set of integers in an arithmetic sequence. Given integers a, d, w with gcd = 1:The case above may be expressed as a special case of this formula.
In the event that, we can omit any subset of the elements from our arithmetic sequence and the formula for the Frobenius number remains the same.
Geometric sequences
There also exists a closed form solution for the Frobenius number of a set in a geometric sequence. Given integers m, n, k with gcd = 1:Examples
McNugget numbers
One special case of the coin problem is sometimes also referred to as the McNugget numbers. The McNuggets version of the coin problem was introduced by Henri Picciotto, who included it in his algebra textbook co-authored with Anita Wah. Picciotto thought of the application in the 1980s while dining with his son at McDonald's, working the problem out on a napkin. A McNugget number is the total number of McDonald's Chicken McNuggets in any number of boxes. In the United Kingdom, the original boxes were of 6, 9, and 20 nuggets.According to Schur's theorem, since 6, 9, and 20 are relatively prime, any sufficiently large integer can be expressed as a linear combination of these three. Therefore, there exists a largest non-McNugget number, and all integers larger than it are McNugget numbers. Namely, every positive integer is a McNugget number, with the finite number of exceptions:
Thus the largest non-McNugget number is 43. The fact that any integer larger than 43 is a McNugget number can be seen by considering the following integer partitions
Any larger integer can be obtained by adding some number of 6s to the appropriate partition above.
Alternatively, since and, the solution can also be obtained by applying a formula presented for earlier:
Furthermore, a straightforward check demonstrates that 43 McNuggets can indeed not be purchased, as:
- boxes of 6 and 9 alone cannot form 43 as these can only create multiples of 3 ;
- including a single box of 20 does not help, as the required remainder is also not a multiple of 3; and
- more than one box of 20, complemented with boxes of size 6 or larger, obviously cannot lead to a total of 43 McNuggets.
Other examples
In rugby union, there are four types of scores: penalty goal, drop goal, try and converted try. By combining these any points total is possible except 1, 2, or 4. In rugby sevens, although all four types of scores are permitted, attempts at penalty goals are rare and drop goals almost unknown. This means that team scores almost always consist of multiples of try and converted try. The following scores cannot be made from multiples of 5 and 7 and so are almost never seen in sevens: 3, 6, 8, 9, 11, 13, 16, 18 and 23. By way of example, none of these scores was recorded in any game in the 2014-15 Sevens World Series.Similarly, in National Football League, the only way for a team to score exactly one point is if a safety is awarded against the opposing team when they attempt to convert after a touchdown. As 2 points are awarded for safeties from regular play, and 3 points are awarded for field goals, all scores other than 1–0, 1–1, 2–1, 3–1, 4–1, 5–1 and 7–1 are possible.