Coin problem explained

Coin problem should not be confused with Change-making problem.

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,

x

and

y

: the Frobenius number is then

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).[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]

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

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 we must have

a1=1

so that all natural numbers can be formed.

n = 2

If

n=2

, the Frobenius number can be found from the formula

g(a1,a2)=a1a2-a1-a2

, which was discovered by James Joseph Sylvester in 1882.[4] Sylvester also demonstrated for this case that there are a total of

N(a1,a2)=(a1-1)(a2-1)/2

non-representable (positive) integers.

Another form of the equation for

g(a1,a2)

is given by Skupień[5] in this proposition: If

a1,a2\inN

and

\gcd(a1,a2)=1

then, for each

n\ge(a1-1)(a2-1)

, there is exactly one pair of nonnegative integers

\rho

and

\sigma

such that

\sigma<a1

and

n=\rhoa1+\sigmaa2

.

The formula is proved as follows. Suppose we wish to construct the number

n\ge(a1-1)(a2-1)

. Since

\gcd(a1,a2)=1

, all of the integers

n-ja2

for

j=0,1,\ldots,a1-1

are mutually distinct modulo

a1

. Thus any integer

m

must be congruent modulo

a1

to one of these residues; in particular, taking

m=a1

there is a unique value of

j=\sigma\ge0

and a unique integer

t

, such that

a1=n-\sigmaa2+ta1

. Rearranging, we have a nonnegative integer

\rho=1-t

so that

n=\rhoa1+\sigmaa2

. Indeed,

\rho\ge0

because

\rhoa1=n-\sigmaa2\ge(a1-1)(a2-1)-(a1-1)a2=-a1+1>(-1)a1

.

To show that exactly half of the integers

0,1,\ldots,ab-a-b

are representable as non-negative integer linear combinations, one first shows that if the integer

k\in[0,ab-a-b]

is representable, then

N-k

is not representable, where

N=ab-a-b

.

One then shows that the converse is true as well: if

k

is not representable, then

N-k

is representable. To show this, use the fact that

\gcd(a,b)=1

, which allows us to write

k=xa+yb

. Reducing and re-arranging the coefficients by adding multiples of

ab

as necessary, we can assume

0\lex<b

(in fact, this

x

is the unique such

x

satisfying the equation and inequalities).

Similarly we take

u,v

satisfying

N-k=ua+vb

and

0\leu<b

. Now we can add these equations to write

N=(u+x)a+(y+v)b

which, using

N=ab-a-b

yields

ab-b(1+y+v)=a(x+u+1)

. The integer

x+u+1

is positive, because

x,u\ge0

. In fact, since the left-hand side of

ab-b(1+y+v)=a(x+u+1)

is divisible by

b

, and

(a,b)=1

, we must have that

x+u+1

is divisible by

b

. Yet

x,u\leb-1

, so

x+u+1\le2b-1

, so that

x+u+1=b

. Substituting this into

ab-b(1+y+v)=a(x+u+1)

and subtracting

ab

from both sides yields

b(1+y+v)=0

. So

1+y+v=0

. This implies that

y+v=-1

, which means that exactly one of

y

or

v

is negative. If

y

is negative, then

v\ge0

, which means that

N-k=ua+vb

is representable; the case when

v

is negative entails that

k

is representable.

Thus for any non-negative integer

k\in[0,ab-a-b]

, we know that exactly one of

k

or

(ab-a-b)-k

is representable (and these are distinct, because

ab-a-b

must be odd as the integers

a,b

are relatively prime). This shows that half of the integers in the given range are representable; since there are

(ab-a-b+1)=(a-1)(b-1)

integers in the range

[0,ab-a-b]

, this gives the desired result.

n = 3

Formulae[6] and fast algorithms[7] 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 also been determined. The asymptotic lower bound due to Davison

f(a1,a2,a3)\equivg(a1,a2,a3)+a1+a2+a3\geq\sqrt{3a1a2a3}

is relatively sharp.[8] (

f

here is the modified Frobenius number, which is the greatest integer not representable by positive integer linear combinations of

a1,a2,a3

.) Comparison with the actual limit (defined by the parametric relationship,

f(z(i))=9i2+54i+79

where

z(i)=a1a2a3=(3i+7)(3i+10)(3i2+19i+29)

) shows that the approximation is only 1 less than the true value as

iinfty

. It is conjectured that a similar parametric upper bound (for values of

a1,a2,a3

that are pairwise-coprime and no element is representable by the others) is

f(z(i))=6i2+19i+13

where

z(i)=a1a2a3=(3i+2)(3i+3)(6i+7)

.

The asymptotic average behaviour of

f

for three variables is also known as:[9]

f(a1,a2,a3)\sim

8{\pi}\sqrt{a
1a

2a3},

Wilf's conjecture

In 1978, Wilf conjectured that given coprime integers

a1<a2<...<ad

, and their Frobenius number

F

, we have
d\geqF+1
F+1-g

,

where

g

denotes the number of all non-representable positive integers.[10] In 2015, an asymptotic version of this was proven by Moscariello and Sammartano.[11]

Frobenius numbers for special sets

Arithmetic sequences

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

g(a,a+d,a+2d,...,a+wd)=\left(\left\lfloora-2
w

\right\rfloor\right)a+d(a-1)

The

n=2

case above may be expressed as a special case of this formula.

In the event that

a>w2-3w+1

, we can omit any subset of the elements

a+2d,a+3d,...,a+(w-3)d,a+(w-2)d

from our arithmetic seq,e and the formula for the Frobenius number remains the same.[13]

Geometric sequences

There also exists a closed form solution for the Frobenius number of a set in a geometric sequence.[14] Given integers m, n, k with gcd(mn) = 1:

g(mk,mk-1n,mk-2n2,...,nk)=nk-1(mn-m-n)+

m2(n-1)(mk-1-nk-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

Ak(a,b)=\{ak,ak-1b,\ldots,bk\}

. Then [15]

g(Ak(a,b))={\sigma}k+1(a,b)-{\sigma}k(a,b)-(ak+1+bk+1),

where

{\sigma}k(a,b)

denotes the sum of all integers in

Ak(a,b).

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 placed it as a puzzle in Games Magazine in 1987,[16] and included it in his algebra textbook co-authored with Anita Wah.[17] Picciotto thought of the application in the 1980s while dining with his son at McDonald's, working out the problem 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 (setwise) relatively prime, any sufficiently large integer can be expressed as a (non-negative, integer) 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 .

Total 0 1 2 3 4 5
+0 0:,, 1: -  2: -  3: -  4: -  5: -
+6 6:,, 7: -  8: -  9:,,10: - 11: -
+1212:,, 13: - 14: - 15:,, 16: - 17: -
+1818:,,19: - 20:,,21:,,22: - 23: -
+2424:,,25: - 26:,,27:,,28: - 29:,,
+3030:,,31: - 32:,,33:,,34: - 35:,,
+3636:,,37: - 38:,,39:,,40:,,41:,,
+4242:,,43: - 44:,,45:,,46:,,47:,,
+4848:,,49:,,50:,,51:,,52:,,53:,,
+5454:,,55:,,56:,,57:,,58:,,59:,,
A possible set of combinations of boxes for a total of 0 to 59 nuggets.
Each triplet denotes the number of boxes of , and , respectively.
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+6+6+6+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. 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 scoring are permitted, attempts at penalty goals are rare, and drop goals are almost unknown. This means that team scores almost always consist of multiples of tries(5 points) and converted tries (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, 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 (which in this case has a value of 6). 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.

Applications

[18]

Shellsort Time Complexity

The Shellsort algorithm is a sorting algorithm whose time complexity is currently an open problem. The worst case complexity has an upper bound which can be given in terms of the Frobenius number of a given sequence of positive integers.

Least Live Weight Problem

Petri nets are useful for modeling problems in distributed computing. For specific kinds of Petri nets, namely conservative weighted circuits, one would like to know what possible "states" or "markings" with a given weight are "live." The problem of determining the least live weight is equivalent to the Frobenius problem.

Terms in Expanded Power of a Polynomial

When a univariate polynomial is raised to some power, one may treat the exponents of the polynomial as a set of integers. The expanded polynomial will contain powers of

x

greater than the Frobenius number for some exponent (when GCD=1), e.g., for

(1+x6+x7)n

the set is which has a Frobenius number of 29, so a term with

x29

will never appear for any value of

n

but some value of

n

will give terms having any power of

x

greater than 29. When the GCD of the exponents is not 1, then powers larger than some value will only appear if they are a multiple of the GCD, e.g. for

(1+x9+x15)n

, powers of 24, 27,... will appear for some value(s) of

n

but never values larger than 24 that are not multiples of 3 (nor the smaller values, 1-8, 10-14, 16, 17, 19-23).

See also

Further reading

External links

Notes and References

  1. Book: J. Ramírez Alfonsín . The Diophantine Frobenius problem . Oxford Univ. Press . 2005.
  2. Ravi Kannan . 1992 . Lattice translates of a polytope and the Frobenius problem . Combinatorica . 12 . 2 . 161–177 . 10.1007/BF01204720. 19200821 .
  3. D. Beihoffer . J. Hendry . A. Nijenhuis . S. Wagon . Faster algorithms for Frobenius numbers . Electronic Journal of Combinatorics . 2005 . 12 . R27 . 10.37236/1924 . free .
  4. Sylvester, James Joseph . 1882. On subinvariants, i.e. Semi-Invariants to Binary Quantics of an Unlimited Order. American Journal of Mathematics. 5. 1. 134 . 2369536. 10.2307/2369536.
  5. Skupień. Zdzisław. Zdzisław Skupień. A generalization of Sylvester's and Frobenius' problems. Acta Arithmetica. 1993. LXV.4. 4. 353–366. 10.4064/aa-65-4-353-366. free.
  6. Tripathi, A. . Formulae for the Frobenius number in three variables . Journal of Number Theory . 170 . 2017 . 368–389 . 10.1016/j.jnt.2016.05.027. free .
  7. See numerical semigroup for details of one such algorithm.
  8. M. Beck . S. Zacks . Refined upper bounds for the linear Diophantine problem of Frobenius . Adv. Appl. Math. . 32 . 2004 . 454–467 . 10.1016/S0196-8858(03)00055-1 . math/0305420 . 3. 119174157 .
  9. Ustinov, A. . The solution of Arnold's problem on the weak asymptotics of Frobenius numbers with three arguments. Sbornik: Mathematics. 200. 4. 2009. 131–160. 10.1070/SM2009v200n04ABEH004011. 2009SbMat.200..597U.
  10. Wilf, H.S.. 1978. A Circle-Of-Lights Algorithm for the "Money-Changing Problem". The American Mathematical Monthly. 85. 7. 562–565.
  11. Moscariello, A. & Sammartano, A.. 2015. On a Conjecture by Wilf About the Frobenius Number. Mathematische Zeitschrift. 280. 47–53. 10.1007/s00209-015-1412-0. 1408.5331.
  12. Book: Ramirez Alfonsin, Jorge. The Diophantine Frobenius Problem . 2005. Oxford University Press. 59–60 .
  13. Lee. S.H. . O'neill . C. . Van Over . B.. 2019 . On arithmetical numerical monoids with some generators omitted . Semigroup Forum . 98 . 2 . 315–326. 10.1007/s00233-018-9952-3. 1712.06741 . 119143449 .
  14. Ong, Darren C. . Ponomarenko, Vadim . 2008 . The Frobenius Number of Geometric Sequences . INTEGERS: The Electronic Journal of Combinatorial Number Theory . 8 . 1 . A33 . 2010-01-04 .
  15. On the Frobenius Problem for Geometric Sequences, Article A43. Tripathi. Amitabha. INTEGERS: The Electronic Journal of Combinatorial Number Theory. 8. 1. 2008.
  16. Henri. Picciotto. Math McPuzzle. 1987. April/May. 52. 85. Games Magazine.
  17. Book: Anita. Wah. Henri. Picciotto . Lesson 5.8 Building-block Numbers . http://www.mathedpage.org/attc/lessons/ch.05/5.08-building-blocks.pdf . Algebra: Themes, Tools, Concepts . 1994 . 186.
  18. Book: J. Ramírez Alfonsín . The Diophantine Frobenius problem . 132–135. Oxford Univ. Press . 2005.