Difference between revisions of "Chicken McNugget Theorem"
m |
(Added Lemma) |
||
Line 37: | Line 37: | ||
Clearly none of the <math>ia</math> for <math>1 \le i \le p-1</math> are divisible by <math>p</math>, so it suffices to show that all of the elements in <math>a \cdot S</math> are distinct. Suppose that <math>ai \equiv aj \pmod{p}</math> for <math>i \neq j</math>. Since <math>\text{gcd}\, (a,p) = 1</math>, by the cancellation rule, that reduces to <math>i \equiv j \pmod{p}</math>, which is a contradiction." | Clearly none of the <math>ia</math> for <math>1 \le i \le p-1</math> are divisible by <math>p</math>, so it suffices to show that all of the elements in <math>a \cdot S</math> are distinct. Suppose that <math>ai \equiv aj \pmod{p}</math> for <math>i \neq j</math>. Since <math>\text{gcd}\, (a,p) = 1</math>, by the cancellation rule, that reduces to <math>i \equiv j \pmod{p}</math>, which is a contradiction." | ||
− | Because <math>m</math> and <math>n</math> are coprime, we know that multiplying the residues of <math>m</math> by <math>n</math> simply permutes these residues. Each of these permuted residues is purchasable (using the definition from Proof 1), because <math>a</math> is <math>0</math> and <math>b</math> is the original residue. In addition, each number greater than that permuted residue which is congruent to it <math>\bmod m</math> is also , because this number is simply the permuted residue summed with some number of <math>m</math>'s. | + | Because <math>m</math> and <math>n</math> are coprime, we know that multiplying the residues of <math>m</math> by <math>n</math> simply permutes these residues. Each of these permuted residues is purchasable (using the definition from Proof 1), because <math>a</math> is <math>0</math> and <math>b</math> is the original residue. In addition, each number greater than that permuted residue which is congruent to it <math>\bmod m</math> is also , because this number is simply the permuted residue summed with some number of <math>m</math>'s. We now prove the following Lemma. |
− | + | <b>Lemma</b>: For any nonnegative integer <math>c < m</math>, <math>cn</math> is the least purchasable number <math>\equiv cn \bmod m</math>. | |
+ | |||
+ | <i>Proof</i>: Any number that is less than <math>cn</math> and congruent to it <math>\bmod m</math> can be represented in the form <math>cn-dm</math>, where <math>d</math> is a positive integer. If this is purchasable, we can say <math>cn-dm=am-bn</math> for some nonnegative integers <math>a, b</math>. This can be rearranged into <math>(a+d)m=(b+c)n</math>, which implies that <math>(a+d)</math> is a multiple of <math>n</math> (since <math>\gcd(m, n)=1</math>). We can say that <math>(a+d)=gn</math> for some positive integer <math>g</math>, and substitute to get <math>gmn=(b+c)n</math>. Because <math>c < m</math>, <math>(b+c)n < mn</math>, and <math>gmn < mn</math>. We divide by <math>mn</math> to get <math>g<1</math>. However, we defined <math>g</math> to be a positive integer, and all positive integers are greater than or equal to <math>1</math>. Therefore, we have a contradiction, and <math>cn</math> is the least purchasable number congruent to <math>cn \bmod m</math>. <math>\square</math> | ||
+ | |||
+ | This means that because <math>cn</math> is purchasable, every number that is greater than <math>cn</math> and congruent to it <math>\bmod m</math> is also purchasable (because these numbers are in the form <math>am+bn</math> where <math>b=c</math>). Another result of this Lemma is that <math>cn-m</math> is the greatest number <math>\equiv cn \bmod m</math> that is not purchasable. Because <math>0 \leq c < m</math>, and <math>c</math> is an integer, the greatest value of <math>c</math> is <math>m-1</math>. To find the greatest number of the form <math>cn-m</math>, we set <math>c=m-1</math> and get <math>(m-1)n-m=mn-m-n</math>. Any number greater than this and congruent to some <math>cn \bmod m</math> is purchasable, because that number is greater than <math>cn</math>. All numbers are congruent to some <math>cn</math>, and thus all numbers greater than <math>mn-m-n</math> are purchasable. | ||
Putting it all together, we can say that for any coprime <math>m</math> and <math>n</math>, <math>mn-m-n</math> is the greatest number not representable in the form <math>am + bn</math> for nonnegative integers <math>a, b</math>. <math>\square</math> | Putting it all together, we can say that for any coprime <math>m</math> and <math>n</math>, <math>mn-m-n</math> is the greatest number not representable in the form <math>am + bn</math> for nonnegative integers <math>a, b</math>. <math>\square</math> |
Revision as of 17:01, 18 February 2016
The Chicken McNugget Theorem (or Postage Stamp Problem or Frobenius Coin Problem) states that for any two relatively prime positive integers , the greatest integer that cannot be written in the form for nonnegative integers is .
A consequence of the theorem is that there are exactly positive integers which cannot be expressed in the form . The proof is based on the fact that in each pair of the form , exactly one element is expressible.
Contents
Origins
The story goes that the Chicken McNugget Theorem got its name because in McDonalds, people bought Chicken McNuggets in 9 and 20 piece packages. Somebody wondered what the largest amount you could never buy was, assuming that you did not eat or take away any McNuggets. They found the answer to be 151 McNuggets, thus creating the Chicken McNugget Theorem.
Proof 1
Definition. An integer will be called purchasable if there exist nonnegative integers such that .
We would like to prove that is the largest non-purchasable integer. We are required to show that (1) is non-purchasable, and (2) every is purchasable. Note that all purchasable integers are nonnegative, thus the set of non-purchasable integers is nonempty.
Lemma. Let be the set of solutions to . Then for any .
Proof: By Bezout's Lemma, there exist integers such that . Then . Hence is nonempty. It is easy to check that for all . We now prove that there are no others. Suppose and are solutions to . Then implies . Since and are coprime and divides , divides and . Similarly . Let be integers such that and . Then implies We have the desired result.
Lemma. For any integer , there exists unique such that .
Proof: By the division algorithm, there exists such that .
Lemma. is purchasable if and only if .
Proof: If , then we may simply pick so is purchasable. If , then if and if , hence at least one coordinate of is negative for all . Thus is not purchasable.
Thus the set of non-purchasable integers is . We would like to find the maximum of this set. Since both are positive, the maximum is achieved when and so that .
Proof 2
We start with this statement taken from Proof 2 of Fermat's Little Theorem:
"Let . Then, we claim that the set , consisting of the product of the elements of with , taken modulo , is simply a permutation of . In other words,
Clearly none of the for are divisible by , so it suffices to show that all of the elements in are distinct. Suppose that for . Since , by the cancellation rule, that reduces to , which is a contradiction."
Because and are coprime, we know that multiplying the residues of by simply permutes these residues. Each of these permuted residues is purchasable (using the definition from Proof 1), because is and is the original residue. In addition, each number greater than that permuted residue which is congruent to it is also , because this number is simply the permuted residue summed with some number of 's. We now prove the following Lemma.
Lemma: For any nonnegative integer , is the least purchasable number .
Proof: Any number that is less than and congruent to it can be represented in the form , where is a positive integer. If this is purchasable, we can say for some nonnegative integers . This can be rearranged into , which implies that is a multiple of (since ). We can say that for some positive integer , and substitute to get . Because , , and . We divide by to get . However, we defined to be a positive integer, and all positive integers are greater than or equal to . Therefore, we have a contradiction, and is the least purchasable number congruent to .
This means that because is purchasable, every number that is greater than and congruent to it is also purchasable (because these numbers are in the form where ). Another result of this Lemma is that is the greatest number that is not purchasable. Because , and is an integer, the greatest value of is . To find the greatest number of the form , we set and get . Any number greater than this and congruent to some is purchasable, because that number is greater than . All numbers are congruent to some , and thus all numbers greater than are purchasable.
Putting it all together, we can say that for any coprime and , is the greatest number not representable in the form for nonnegative integers .
Generalization
If and are not coprime, then we can simply rearrange into the form and are coprime, so we apply Chicken McNugget to find a bound We can simply multiply back into the bound to get Therefore, all multiples of greater than are representable in the form for some positive integers .
Problems
Introductory
- Marcy buys paint jars in containers of and . What's the largest number of paint jars that Marcy can't obtain?
- Bay Area Rapid food sells chicken nuggets. You can buy packages of or . What is the largest integer such that there is no way to buy exactly nuggets? Can you Generalize ?(ACOPS)
Intermediate
- Ninety-four bricks, each measuring are to stacked one on top of another to form a tower 94 bricks tall. Each brick can be oriented so it contributes or or to the total height of the tower. How many different tower heights can be achieved using all ninety-four of the bricks? Source
Olympiad
- On the real number line, paint red all points that correspond to integers of the form , where and are positive integers. Paint the remaining integer point blue. Find a point on the line such that, for every integer point , the reflection of with respect to is an integer point of a different colour than . (India TST)
- Let be a set of integers (not necessarily positive) such that
(a) there exist with ;
(b) if and are elements of (possibly equal), then also belongs to .
Prove that is the set of all integers. (USAMO)