Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Frobenius Coin Problem

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

SUPPLEMENTARY NOTES

The Frobenius Coin Problem

Learning areas: Number, patterns, algebra, algorithms, linear equations, Diophantine


equations, proof by contradiction, mathematical induction, strong induction, divisibility,
greatest common divisor, Extended Euclidean Algorithm

These supplementary notes on the Frobenius Coin Problem are intended for school teachers, year 11 or
12 students studying Specialist Mathematics, students who have studied the Noether or Polya books of
the AMT’s Enrichment series, or other interested readers with a strong background in secondary school
mathematics. It is recommended that you first attempt parts (a) to (f) of the introductory activity and
also explore the accompanying linear graphing tool, both available at http://www.amt.edu.au/mathspack.
For further hints and tips, contact mail@amt.edu.au.

1 Pythagistan revisited: the 5c and 8c problem


In the introductory activity we were able to argue, somewhat informally, that 27 cents is the
largest total that cannot be made from combinations of 5c and 8c coins. In this section we will
work through two different proofs of this fact using the Principle of Mathematical Induction.
The first follows the same line of reasoning as the solution of part (a) vi. in the introductory
activity, where sufficiently many consecutive cases are known to work. As such, it is actually an
application of strong induction, with more than one initial case needing to be checked manually.
While mathematically sound and reasonably intuitive to follow, the drawback of this approach is
that the number of consecutive initial cases to be checked depends on the value of the two coins
themselves. It is therefore not obvious how this might be generalised to coins with arbitrary values.
The second proof is more nuanced since it relies on the analysis of several cases, but it is more
readily adaptable to other coin values since only one initial case is required to kickstart the inductive
argument.

1.1 The ‘adding extra coins’ strategy

We aim to prove that every total of at least 28 cents can be made from a combination of 5c and
8c coins. This statement can be written more formally as follows, where x and y represent the
numbers of each type of coin.
Theorem: For every integer n ≥ 28, there exist non-negative integers x and y such that 5x+8y = n.
Proof: We begin with the observation that the statement is true for all n satisfying 28 ≤ n ≤ 32,
since
28 = 5 × 4 + 8 × 1, 29 = 5 × 1 + 8 × 3, 30 = 5 × 6 + 8 × 0,
31 = 5 × 3 + 8 × 2, 32 = 5 × 0 + 8 × 4.
Next we assume, by strong induction, that for some k ≥ 32, the statement is true for all n satisfying
28 ≤ n ≤ k. We are required to prove that the statement is also true for n = k + 1.
Since k ≥ 32, we have 28 ≤ k − 4 < k, so the statement is true for n = k − 4 by the inductive
assumption. That is, there exist non-negative integers x′ and y ′ such that 5x′ + 8y ′ = k − 4. Letting
x = x′ + 1 and y = y ′ , which are both non-negative, we have
5x + 8y = 5(x′ + 1) + 8y ′
= (5x′ + 8y ′ ) + 5
= (k − 4) + 5
= k + 1,
so the statement is true for n = k + 1. This completes the proof by strong induction. !
Exercise A: Adapt the proof above to show that every total of 50c or more can be made from a
combination of the Eulish 6c and 11c coins.

1.2 The ‘coin replacement’ strategy

Here we give an alternative proof based on the following strategy: if you have enough 5c coins,
replace some of them with 8c coins to increase the total value by 1 cent; if you have enough 8c
coins, you can achieve the same effect by replacing some of those instead; if you don’t have enough
of either coin, then not to worry, your total must have been less than the range of values we are
interested in anyway. The precise replacement strategy relies on the values found in part (e) of the
introductory activity.
Theorem: For every integer n ≥ 28, there exist non-negative integers x and y such that 5x+8y = n.
Proof: We begin by observing that the statement is true for n = 28, since 28 = 5 × 4 + 8 × 1.
Next we assume, by induction, that for some k ≥ 28 the statement is true for n = k. That is, there
exist non-negative integers x′ and y ′ such that 5x′ + 8y ′ = k. We are required to prove that the
statement is also true for n = k + 1.
If x′ ≥ 3, then we may let x = x′ − 3 and y = y ′ + 2, so that x and y are both non-negative. Then
5x + 8y = 5(x′ − 3) + 8(y ′ + 2)
= (5x′ + 8y ′ ) − 15 + 16
= k + 1,
so the statement is also true for n = k + 1, as required. (This argument amounts to replacing three
5c coins with two 8c coins, provided there are enough 5c coins available.)
If y ′ ≥ 3, then we may let x = x′ + 5 and y = y ′ − 3, so that x and y are both non-negative. Then
5x + 8y = 5(x′ + 5) + 8(y ′ − 3)
= (5x′ + 8y ′ ) + 25 − 24
= k + 1,
so the statement is also true for n = k + 1, as required. (This is the reverse situation, replacing
three 8c coins with five 5c coins.)
Suppose, on the other hand, that both x′ < 3 and y ′ < 3. Then, given that they are integers, we
have x′ ≤ 2 and y ′ ≤ 2 so that
k = 5x′ + 8y ′ ≤ 5 × 2 + 8 × 2 = 26.
However, this contradicts the inductive assumption that k ≥ 28. (That is, if the total is large
enough, you always have enough 5c or 8c coins available to apply at least one of the replacement
strategies above.) This completes the proof by induction. !
Exercise B: Adapt the proof above to show that every total of 50c or more can be made from a
combination of the Eulish 6c and 11c coins.

2
1.3 Consolidation

Exercise C: Choose two other coin values a and b, with no common factors greater than 1. Exper-
iment to find c, the largest impossible total (it will be less than ab). Use both the ‘adding extra
coins’ and ‘coin replacement’ strategies described above to prove the following result:
For every integer n ≥ c + 1, there exist non-negative integers x and y such that ax + by = n.

2 Finding the coin replacement strategy


In Section 1.2, the two coin replacement strategies required for the Pythagistani 5c and 8c coins
were as follows: replace three 5c coins with two 8c coins, or replace three 8c coins with five 5c
coins. These strategies can be summarised by the following numerical observations:
8×2=5×3+1 and 5 × 5 = 8 × 3 + 1,
or equivalently
1 = 5 × (−3) + 8 × 2 = 5 × 5 + 8 × (−3).
Thus we have found two integer solutions (s, t) of the equation 5s + 8t = 1, one with s < 0 and
t > 0, and the other with s > 0 and t < 0.
You may not have found it too difficult to stumble upon the required replacement strategies for
the Eulish 6c and 11c coins, or your chosen coin values in Exercise C. However, for arbitrary
pairs of coin values it is useful to have a method for finding those replacement strategies more
systematically.

2.1 The Euclidean Algorithm

In primary or secondary school, you have most likely been introduced to the following strategy
for finding the greatest common divisor (otherwise known as the highest common factor ) of two
positive integers: determine the factorisation of each number as a product of primes (via a factor
tree, for example) and then identify the common primes. For example, 90 = 2 × 3 × 3 × 5 and
24 = 2 × 2 × 2 × 3, so gcd(90, 24) = 2 × 3 = 6.
In practice this method is terribly inefficient. The Euclidean Algorithm provides an alternative
method which does not rely on prime factorisation; in fact, in its simplest form it relies only on
repeated subtraction.
Given positive integers a and b, with a > b, gcd(a, b) is found with the Euclidean Algorithm as
follows:
• Divide a by b, taking note of the quotient q and remainder r, and rewrite the division statement
as a multiplication with remainder, namely a = bq + r.
• Replace the pair of integers (a, b) with the new pair (b, r) and repeat the above step.
• Keep repeating until the remainder is zero. The last non-zero remainder is the greatest
common divisor.

Example: Calculate gcd(90, 24).


90 ÷ 24 = 3 rem 18 90 = 24 × 3 + 18
24 ÷ 18 = 1 rem 6 24 = 18 × 1 + 6
18 ÷ 6 = 3 rem 0 18 = 6 × 3 + 0
so gcd(24, 90) = 6 (highlighted).

3
It is not necessary to write the division statement each time, as seen here.

Example: Calculate gcd(184, 54).

184 = 54 × 3 + 22
54 = 22 × 2 + 10
22 = 10 × 2 + 2
10 = 2 × 5 + 0

so gcd(130, 54) = 2.

Exercise D: Use the Euclidean Algorithm to calculate the following:


i. gcd(30, 17) ii. gcd(96, 27) iii. gcd(425, 245) iv. gcd(201, 88)

2.2 The Extended Euclidean Algorithm

Given two positive integers a and b, the Extended Euclidean Algorithm provides a method for
writing gcd(a, b) as a combination of a and b. That is, it finds integer solutions (s, t) of the
equation as + bt = gcd(a, b) (known as Bezout’s identity).
The Extended Euclidean Algorithm uses the lines of working generated when calculating the great-
est common divisor. Starting with the second last line of working, write gcd(a, b) as the subject
of the equation. Then manipulate the right-hand side by substituting alternative expressions from
each preceding line, simplifying much as you would with algebraic like terms, but resisting the
temptation to simply evaluate the numerical values involved. Working from bottom to top in this
way results in a combination of the original numbers a and b, as desired.

Example: Find an integer solution (s, t) for the equation 184s + 54t = 2.
Recall the following lines of working to calculate gcd(184, 54):

184 = 54 × 3 + 22 (1)
54 = 22 × 2 + 10 (2)
22 = 10 × 2 + 2 (3)
10 = 2 × 5 + 0

Then
2 = 22 − 10 × 2 from (3)
= 22 − (54 − 22 × 2) × 2 from (2)
= 22 − 54 × 2 + 22 × 4
= 22 × 5 − 54 × 2
= (184 − 54 × 3) × 5 − 54 × 2 from (1)
= 184 × 5 − 54 × 15 − 54 × 2
= 184 × 5 + 54 × (−17),

so (s, t) = (5, −17).

Exercise E: Apply the Extended Euclidean Algorithm to find integer solutions of as+bt = gcd(a, b)
with the values from Exercise D. Answers can be checked at the following website:
http://people.math.sc.edu/sumner/numbertheory/euclidean/euclidean.html

4
2.3 Application to Pythagistani coin replacement

Since gcd(5, 8) = 1, we can use the Extended Euclidean Algorithm to find integer solutions of
5s + 8t = 1, as follows:
8=5×1+3 (4)
5=3×1+2 (5)
3=2×1+1 (6)
2=1×2+0

1=3−2 from (6)


= 3 − (5 − 3) from (5)
=3×2−5
= (8 − 5) × 2 − 5 from (4)
=8×2−5×3
= 5 × (−3) + 8 × 2,
hence (s, t) = (−3, 2) is a solution.
The solution above happens to correspond to the first coin replacement strategy for the induction
argument in Section 1.2: replacing three 5c coins with two 8c coins results in an overall increase of
1 cent.
Finding the alternative replacement strategy amounts to observing that it is possible to make a
total of 40c in two different ways. That is, replacing five 8c coins with eight 5c coins has no net
effect:
1 = 5 × (−3) + 8 × 2
= 5 × (−3) + [ 5 × 8 − 8 × 5 ] + 8 × 2
= 5 × 5 + 8 × (−3),
so (s, t) = (5, −3) is the other required solution.
Exercise F: Use the Extended Euclidean Algorithm to establish two replacement strategies for the
Eulish 6c and 11c coins, and also for the pair of coins you chose for Exercise C.
Note that repeatedly applying the final coin swap, it becomes clear that there are in fact infinitely
many strategies, as shown in the next exercise.
Exercise G: Suppose that (s1 , t1 ) is a known integer solution for the equation as + bt = gcd(a, b).
Show that (s1 + kb, t1 − ka) is also a solution for any integer k.
Exercise H: State the general solution for each equation in Exercise E.
While the general solution provides an unlimited number of potential coin replacement strategies
for the induction argument, the larger the value of n (either positive or negative), the larger the
number of coins required to effect the replacement. Hence the smallest solutions, namely when
n = 0 and n = 1 or −1, should still be used since they are the most widely applicable.

2.4 Consolidation

Exercise I: Use the coin replacement strategy to prove that every total greater than or equal to
7788 cents can be made from a combination of 119c and 67c coins. How many initial cases would
you need to check in order to apply the ‘adding extra coins’ strategy of Section 1.1?

5
3 Finding the largest impossible total
The induction argument for Pythagistani 5c and 8c coins starts with the initial total of 28 cents.
Verifying that this case is possible is simply a matter of finding a combination of coins that works.
But how can we be certain that making 27 cents is impossible? After all, the Extended Euclidean
Algorithm provides infinitely many solutions for the equation 5s + 8t = 1, and we can easily adapt
these to find infinitely many solutions for 5s + 8t = 27. It just so happens that each such solution
has a negative value for either s or t, so it does not provide the non-negative integer solution
required for the context of the coin problem.
One strategy to establish this is to exhaustively list all possibilities. For example, consider in turn
each possible number of 5c coins: there cannot be zero 5c coins, because 27 is not a multiple of
8; there cannot be one 5c coin, because 27 − 5 = 22 is not a multiple of 8, etc. This is relatively
painless for such a small total, but for larger totals this approach quickly becomes impractical.

3.1 Divisibility and contradiction

Suppose that a non-negative integer solution (x, y) exists for the equation 5x + 8y = 27. Adding
five to both sides, rearranging and factorising, we have
5x + 8y + 5 = 32
5x + 5 = 32 − 8y
5(x + 1) = 8(4 − y).
From the uniqueness of prime factorisation (the Fundamental Theorem of Arithmetic), the fact
that 5 and 8 have no common prime factors, and the condition x + 1 ≥ 1, it follows that (4 − y)
must be a positive multiple of 5. In particular, 4 − y ≥ 5, but then y ≤ −1, which contradicts the
assumption that y is non-negative. It follows that no such non-negative solution (x, y) can exist,
so 27 cents cannot be made from 5c and 8c coins.
Exercise J: Adapt the above argument to show that a total of 49 cents cannot be made from a
combination of 6c and 11c coins, and also that 7787 cannot be made from 119c and 67c coins.
Exercise K: Suppose two coins have positive integer values a and b, where gcd(a, b) = 1. Show
that, in general, it is not possible to make a total value of ab − a − b cents using these coins.

3.2 Extended Euclidean Algorithm revisited

Having established that, in general, a total of ab − a − b is impossible, we are left with one final
question: is the subsequent value of ab − a − b + 1 cents, or equivalently (a − 1)(b − 1) cents, always
possible? This expression corresponds to the initial cases that kickstarted the inductive arguments
considered so far: the total of 4 × 7 = 28 cents for 5c and 8c coins, the total of 5 × 10 = 50 cents
for 6c and 11c coins, and the total of 118 × 66 = 7788 cents for 119c and 67c coins. In the latter
example, it is far from obvious how to actually make the total of 7788 cents from a combination of
119c and 67c coins. To do so, we return to the Extended Euclidean Algorithm.
Having found the solution (s, t) = (−9, 16) of the equation 119s + 67t = 1, we proceed as follows:
7788 = 118 × 66
= (119 − 1) × (67 − 1)
= 119 × 67 − 119 − 67 + 1
= 119 × 67 − 119 − 67 + (119 × (−9) + 67 × 16)
= 119 × 67 + 119 × (−10) + 67 × 15.

6
We now have a decision to make: how to regroup the first term 119 × 67 ? To ensure that the
overall sum has non-negative coefficients, we choose to group it with the other multiple of 119:

7788 = [ 119 × 67 + 119 × (−10) ] + 67 × 15


= 119 × 57 + 67 × 15.

Hence a total of 7788 cents can be made from fifty-seven 119c coins and fifteen 67c coins.

Exercise L: Use the method outlined above to show that it is possible to make a total of 6 × 9 = 54
cents from 7c and 10c coins. [Try to avoid guessing the solution first.]
To generalise the above, we need the following observation which follows from the general solution
in Exercise G: there exists an integer solution (s, t) of as + bt = 1 which satisfies 0 < s < b and
−a < t < 0.

Exercise M: With coins as in Exercise K, use the above observation to show that it is always
possible to make a total of (a − 1)(b − 1) cents.

4 Solution of the general coin problem

Theorem: Suppose two coins have positive integer values a and b, respectively, where gcd(a, b) = 1.
Then making a total of ab − a − b cents is impossible, but every larger total is possible.

Exercise N: Complete the proof!

References
Art of Problem Solving. (2019). Chicken McNugget Theorem.
Available at: https://artofproblemsolving.com/wiki/index.php/Chicken McNugget Theorem. [Accessed
May 2019].
Mathworld. (2019). Coin Problem – from Wolfram MathWorld.
Available at: http://mathworld.wolfram.com/CoinProblem.html. [Accessed May 2019].
Hutchinson, J. (2010). An Introduction to Contemporary Mathematics. ANU.
Available at: https://maths.anu.edu.au/files/introduction contemporary mathematics.pdf. [Accessed May
2019].

Acknowledgements
I am indebted to a secondary school student of mine, Mustafa Al-Kubaisi, for sparking my interest in the
general problem of finding the largest impossible postage given two relatively prime stamp values. I also
acknowledge various colleagues at the Australian Mathematics Trust: Dr Norm Do and Dr Andrew Kepert
for pointing me in the direction of the equivalent Frobenius Coin Problem, and Bernadette Webster for
her tireless editorial advice.
Chris Wetherell, May 2019
Australian Maths Trust

You might also like