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
y
xy-x-y
In mathematical terms, the problem can be stated:
Given positive integers
a1,a2,...,an
(a1,a2,...,an)=1
k1a1+k2a2+...+knan
where
k1,k2,...,kn
This largest integer is called the Frobenius number of the set
\{a1,a2,...,an\}
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\}
A closed-form solution exists for the coin problem only where n = 1 or 2. No closed-form solution is known for n > 2.
If
n=1
a1=1
If
n=2
g(a1,a2)=a1a2-a1-a2
N(a1,a2)=(a1-1)(a2-1)/2
Another form of the equation for
g(a1,a2)
a1,a2\inN
\gcd(a1,a2)=1
n\ge(a1-1)(a2-1)
\rho
\sigma
\sigma<a1
n=\rhoa1+\sigmaa2
The formula is proved as follows. Suppose we wish to construct the number
n\ge(a1-1)(a2-1)
\gcd(a1,a2)=1
n-ja2
j=0,1,\ldots,a1-1
a1
m
a1
m=a1
j=\sigma\ge0
t
a1=n-\sigmaa2+ta1
\rho=1-t
n=\rhoa1+\sigmaa2
\rho\ge0
\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
k\in[0,ab-a-b]
N-k
N=ab-a-b
One then shows that the converse is true as well: if
k
N-k
\gcd(a,b)=1
k=xa+yb
ab
0\lex<b
x
x
Similarly we take
u,v
N-k=ua+vb
0\leu<b
N=(u+x)a+(y+v)b
N=ab-a-b
ab-b(1+y+v)=a(x+u+1)
x+u+1
x,u\ge0
ab-b(1+y+v)=a(x+u+1)
b
(a,b)=1
x+u+1
b
x,u\leb-1
x+u+1\le2b-1
x+u+1=b
ab-b(1+y+v)=a(x+u+1)
ab
b(1+y+v)=0
1+y+v=0
y+v=-1
y
v
y
v\ge0
N-k=ua+vb
v
k
Thus for any non-negative integer
k\in[0,ab-a-b]
k
(ab-a-b)-k
ab-a-b
a,b
(ab-a-b+1)=(a-1)(b-1)
[0,ab-a-b]
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}
f
a1,a2,a3
f(z(i))=9i2+54i+79
z(i)=a1a2a3=(3i+7)(3i+10)(3i2+19i+29)
i → infty
a1,a2,a3
f(z(i))=6i2+19i+13
z(i)=a1a2a3=(3i+2)(3i+3)(6i+7)
The asymptotic average behaviour of
f
f(a1,a2,a3)\sim
8{\pi}\sqrt{a | |
1a |
2a3},
In 1978, Wilf conjectured that given coprime integers
a1<a2<...<ad
F
d\geq | F+1 |
F+1-g |
,
g
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(a, d) = 1:
g(a,a+d,a+2d,...,a+wd)=\left(\left\lfloor | a-2 |
w |
\right\rfloor\right)a+d(a-1)
The
n=2
In the event that
a>w2-3w+1
a+2d,a+3d,...,a+(w-3)d,a+(w-2)d
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(m, n) = 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
\gcd(a,b)=1,
Ak(a,b)=\{ak,ak-1b,\ldots,bk\}
g(Ak(a,b))={\sigma}k+1(a,b)-{\sigma}k(a,b)-(ak+1+bk+1),
where
{\sigma}k(a,b)
Ak(a,b).
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: - | |
+12 | 12:,, | 13: - | 14: - | 15:,, | 16: - | 17: - | |
+18 | 18:,, | 19: - | 20:,, | 21:,, | 22: - | 23: - | |
+24 | 24:,, | 25: - | 26:,, | 27:,, | 28: - | 29:,, | |
+30 | 30:,, | 31: - | 32:,, | 33:,, | 34: - | 35:,, | |
+36 | 36:,, | 37: - | 38:,, | 39:,, | 40:,, | 41:,, | |
+42 | 42:,, | 43: - | 44:,, | 45:,, | 46:,, | 47:,, | |
+48 | 48:,, | 49:,, | 50:,, | 51:,, | 52:,, | 53:,, | |
+54 | 54:,, | 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. |
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
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.
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.
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.
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.
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
(1+x6+x7)n
x29
n
n
x
(1+x9+x15)n
n