Harman Patil (Editor)

Coin problem

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Coin problem

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. 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.

Contents

There is an explicit formula for the Frobenius number when there are only two different coin denominations, x and y : xyxy. 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 (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, …, an such 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 requirement that the greatest common divisor (GCD) equal 1 is necessary in order for the Frobenius number to exist. If the GCD were not 1, every integer that is not a multiple of the GCD would be inexpressible as a linear, let alone conical, combination of the set, and therefore there would not be a largest such number. For example, if you had two types of coins valued at 4 cents and 6 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. 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.

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 g ( a 1 , a 2 ) = a 1 a 2 a 1 a 2 . This formula was discovered by James Joseph Sylvester in 1884. Sylvester also demonstrated for this case that there are a total of N ( a 1 , a 2 ) = ( a 1 1 ) ( a 2 1 ) / 2 non-representable integers.

Another form of the equation for g ( a 1 , a 2 ) is given by Skupień in this proposition: If a 1 , a 2 N and gcd ( a 1 , a 2 ) = 1 then, for each n ( a 1 1 ) ( a 2 1 ) , there is exactly one pair of nonnegative integers ρ and σ such that σ < a 1 and n = ρ a 1 + σ a 2 .

The formula is proved as follows. Suppose we wish to construct the number m ( a 1 1 ) ( a 2 1 ) . Note that, since gcd ( a 1 , a 2 ) = 1 , all of the integers m j a 2 for j = 0 , 1 , , a 1 1 are mutually distinct modulo a 1 . Hence there is a unique value of j , say j = σ , and a nonnegative integer ρ , such that m = ρ a 1 + σ a 2 : Indeed, ρ 0 because ρ a 1 = m σ a 2 ( a 1 1 ) ( a 2 1 ) ( a 1 1 ) a 2 = a 1 + 1 .

n = 3

Fast algorithms are known for three numbers (see Numerical semigroup for details of one such algorithm) though the calculations can be very tedious if done by hand. Furthermore, lower- and upper bounds for the n = 3 Frobenius numbers have been determined. The Frobenius-type lower bound due to Davison

g ( a 1 , a 2 , a 3 ) 3 a 1 a 2 a 3 a 1 a 2 a 3

is reported to be relatively sharp.

However, upon some special scenarios, the Frobenius number can be calculated for n = 3 which stemmed from Johnson's formula and was later developed by Dr. Worranat Pakornrat on August 14, 2016:

If an integer c | l c m ( a , b ) and g c d ( a , b , c ) = 1 , then g ( a , b , c ) = l c m ( c , a ) + l c m ( c , b ) a b c .

(Note: lcm and gcd stand for least common multiple and greatest common divisor respectively.)

Arithmetic sequences

A simple formula exists for the Frobenius number of a set of integers in an arithmetic sequence. Given integers a, d, s with gcd(ad) = 1:

g ( a , a + d , a + 2 d , , a + s d ) = ( a 2 s + 1 ) a + ( d 1 ) ( a 1 ) 1.

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(mn) = 1:

g ( m k , m k 1 n , m k 2 n 2 , , n k ) = n k 1 ( m n m n ) + m 2 ( n 1 ) ( m k 1 n k 1 ) m n . A simpler formula that also displays symmetry between the variables is as follows. Given positive integers a , b , k , with gcd ( a , b ) = 1 , let A k ( a , b ) = { a k , a k 1 b , , b k } . Then g ( A k ( a , b ) ) = σ k + 1 ( a , b ) σ k ( a , b ) ( a k + 1 + b k + 1 ) , where σ k ( a , b ) denotes the sum of all integers in A k ( a , b ) .

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 (prior to the introduction of the Happy Meal-sized nugget 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:

1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 22, 23, 25, 28, 31, 34, 37, and 43 (sequence A065003 in the OEIS).

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

44 = 6 + 9 + 9 + 20 45 = 9 + 9 + 9 + 9 + 9 46 = 6 + 20 + 20 47 = 9 + 9 + 9 + 20 48 = 6 + 6 + 9 + 9 + 9 + 9 49 = 9 + 20 + 20

Any larger integer can be obtained by adding some number of 6s to the appropriate partition above.

Alternatively, since l c m ( 9 , 20 ) = 180 and 6 | 180 , the solution can also be obtained by applying a formula presented for n = 3 earlier:

g ( 6 , 9 , 20 ) = l c m ( 6 , 9 ) + l c m ( 6 , 20 ) 6 9 20 = 18 + 60 35 = 43

Furthermore, a straightforward check demonstrates that 43 McNuggets can indeed not be purchased, as:

  1. boxes of 6 and 9 alone cannot form 43 as these can only create multiples of 3 (with the exception of 3 itself);
  2. including a single box of 20 does not help, as the required remainder (23) is also not a multiple of 3; and
  3. more than one box of 20, complemented with boxes of size 6 or larger, obviously cannot lead to a total of 43 McNuggets.

Since the introduction of the 4-piece Happy Meal-sized nugget boxes, the largest non-McNugget number is 11. In countries where the 9-piece size is replaced with the 10-piece size, there is no largest non-McNugget number, as any odd number cannot be made.

Other examples

In rugby union, there are four types of scores: penalty goal (3 points), drop goal (3 points), try (5 points) and converted try (7 points). 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 (5 points) and converted try (7 points). The following scores (in addition to 1, 2, and 4) 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 American football (NFL rules), any score is possible in a non-forfeit game except 1. The only ways to score 1 point are by a single point conversion after a 6-point touchdown, or to win by forfeit, where the score will be recorded as 1-0 or 0-1. As 2 points are awarded for a safety and 3 points for a field goal, all other scores apart from 1 are possible.

References

Coin problem Wikipedia