In a small, remote country, there are only two types of bills--the $X bill and the $Y bill.
With combinations of these bills, almost all positive integer prices can be paid exactly. Only fifteen positive integer prices can't be paid exactly, one of which is $18.
What is X + Y ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Nice way to solve it! One small thing, when stating Chicken McNugget Theorem, we should say "m and n are relatively prime", right?
Curious mind wants to know Why (X-1)(Y-1)=30?
Log in to reply
The problem states that 15 integers cannot be expressed by the linear combination of X and Y. Using the Chicken McNugget Theorem, we know that 2 ( X − 1 ) ( Y − 1 ) thus equals 15, or that (X-1)(Y-1) = 30.
I understand that this problem is based on the buyer having exact change without respect to the seller giving anything back, but I am still confused here. On a quick look, 4 and 11 seem to have greater than 15 integers that cannot be paid exactly using only additive arithmetic (1,2,3,5,6,7,9,10,13,14,17,18,21,25,28,29--at least). I am coming off 4 12-hour nightshifts so I could be making a simple math error. Where am I going wrong?
Log in to reply
28=7x4, so it can be paid by 7 of $4 bills. After 29, we can show 4 consecutive integers of 30,31,32 and 33 can all be expressed as 4a+11b, after that we just keep adding 4s to get all other integers.
To exhaustively list all the values in our 'miss' set, I considered the positive integers mod 4, moving up in each of the three sets (0 mod 4 ignored) until reaching a multiple of 11:
1 mod 4: {1,5,9,13,17,21,25,29} - 8 total
2 mod 4: {2,6,10,14,18} - 5 total
3 mod 4: {3,7} - 2 total
Why can't it be 17? Bills of 10 and 7. No matter how you combine them, it can never sum up 18.
Log in to reply
Because the question says that.. "Only fifteen integer prices can't be paid exactly"... and there are many more than 15 integers you can't get with 10 and 7
Is the only way to solve it using the Chicken McNugget Theorem?
Confused by problem wording. "No need for overpayment or dispute over underpayment" doesn't preclude the possibility of making change. I could pay 18 eleven bills and receive 45 four bills in change. Pay 198 get 180 back I paid 18 without an overpayment or underpayment.
Log in to reply
I think you're referring to the previous phrasing. The previous phrasing essentially states that you must pay the exact amount without paying more or less.
There is something about this question and the answer that I don't understand at all. I calculate that there are a total of 21 integers that cannot be paid with only $8 and $7 dollar bills. The total list of unpayable amounts is. 1,2,3,4,5,6,9,10,11,12,13,17,18,19,20,25,26,27,33,34,41. any integer value above 41 can be paid .
Can anyone demonstrate how to pay any of these 21 integer values with only $7 and $8 dollar bills?
Now! If the two bill where $ 7 and $5 dollars I calculate that there are only 12 integer values that cannot be paid. That list is 1,2,3,4,6,8,9,11,13,16,18,23. In this case any integer value above 23 can be paid.
What am I missing hear?
Log in to reply
the 2 bills are 4 and 11, not 7 and 8.
Can anyone demonstrate how to pay any of these 21 integer values with only $7 and $8 dollar bills?
No, it's not possible. You have correctly shown the list of all the 21 numbers (1, 2, 3, ... , 41) are not possible.
What am I missing hear?
Like I said, the two bills should be (4 and 11), not (7 and 8), not (5 and 7) either.
Can anyone please add a proof to this theorum?
This can be solved using the process of elimination. 1 to 3 can build 18 so are not candidates. Number 4 in combination might work however
4, 5 5+5+4+4 is 18 4, 6 6+6+6 is 18 4, 7 7+7+4 is 18 4, 8 only produce products of 4 so eliminated 4, 9 9+9 is 18 so 4, 10 4+4+10 is 18 so out 4, 11 is the first logical candidate which indeed works and produces all but the 15.
So focusing on the 18 rather than the 15 is more cost effective using a POE.
Can't I pay 18 by giving him six bills of 11 and get back 12 bills of 4 as a change, as 6(11-2*4) =18, right?
I found the formula (m-1)(n-1)/2 by a different method. My method was not via a rigorous proof but it gave me enough confidence to seek for an answer of the form (X-1)(Y-1)=30. Having found 4 and 11 as a possible solution I checked and it worked.
So here's my thought processes which led to the formula. First I realised that every integer =mn or greater could be expressed as am+bn. 'Proof': the sequence m, 2m, 3m ... (n-1)m (all modulo n) must contain every number between 1 and n-1 without duplication. Taking k such that 0 < k < n then am = k (modulo n) so am = bn+k for some positive integers a and b. Hence k=am-bn. Therefore mn+k can be expressed as am+(m-b)n. Note that b<m (since a<n so bn < bn+k <nm) and hence both a and (m-b) are positive integers. This provides a solution for mn+1 up to mn+n-1. (m+1)n is simply a multiple of n and the next (n-1) numbers can be obtained by repeating the above trick. And so on indefinitely.
So all the inexpressible integers must be less than mn. Next I decided to count all the expressible integers from 0 to 2mn inclusive. At least, expressible in a restricted way. That is, I considered all integers of the form am+bn where a ranges from 0 to n and b ranges from 0 to m. The smallest this can be is zero. The largest it can be is 2mn. I satisfied myself [proof omitted] that each couple [a, b] led to a different sum with one exception: a=0, b=m gives the same result as a=n, b=0. Therefore the (m+1)(n+1) combinations produce (m+1)(n+1)-1 different expressible integers between 0 and 2mn inclusive, and hence the number of inexpressible integers (restricted to a<=n and b<=n) is (2mn+1) - (m+1)(n+1) +1 which simplifies to (m-1)(n-1).
Finally, the non-rigorous intuitive bit. I felt in my bones that the pattern created by generating integers of the form am+bn (with a=0 to n and b=0 to m) would be symmetrical around the midpoint mn. Hence the number of inexpressible integers less than mn would be (m-1)(n-1)/2. The other half (between mn and 2mn) are only inexpressible in my restricted sense. They can be expressed as am+bn where either a>n or b>m.
X | Y | can't pay evenly: | number of prices that can't be paid evenly: |
2 | 3 | 1 | 1 |
2 | 5 | 1,3 | 2 |
2 | 7 | 1,3,5 | 3 |
2 | 9 | 1,3,5,7 | 4 |
2 | 2n+1 | n | |
2 | 31 | 15 |
So X+Y = 33, right? It seems I missed the line, "one of which is $18."
4 | 5 | 1,2,3,6,7,11 | 6 |
4 | 7 | 1,2,3,5,6,9,10,13,17 | 9 |
4 | 9 | 1,2,3,5,6,7,10,11,14,15,19,23 | 12 |
4 | 2*n/3+1 | n | |
4 | 11 | 15 |
While slow, using this pattern, and the meta-pattern (See Kevin Guo's solution) that anticipates the number of "prices that can't be paid exactly" (the right-most column) from the pair of numbers X & Y, one could solve the same question with a much larger number of "prices that can't be paid exactly." (e.g. 5,000) Kevin's solution is great if you know (or can look up) the formula; this method helps derive the formula.
Wonderful! You have nearly derived the chicken nuggets formula on your own!
Good insight about at least one being odd!
I first eliminated combinations that could result in 18. Used a little trial and error and intuition to find 4 and 11. That would have helped...
What does 2 times n divided by 3 plus one refer to though?
Factor 18, and you will get all the small integers that cannot be a part of the solution: (18,1) (9,2) (6,3)
So 1, 2, 3, 6, 9, and 18 are automatically ruled out. Starting at the next pair, 4 and 5, you can see that 5+5+4+4=18 which rules out both of those. The next pair is 7 and 8. 7+7=14, 7+8=15, and 8+8 =16, so there is no possible way to get 18 using this pair, and since adding 7+8=15, that is the answer to the problem.
I don't quite understand how you ruled out both 4 and 5 as possibilities. I can see that you can't use both, but why can't you use one of them?
Actually I don't think 7 and 8 would work. You proved that 18 can't be expressed as 7a+8b, but you didn't show it satisfies the other condition:"Only fifteen integer prices can't be paid exactly".
In fact, there are 21 integers that can't be expressed as 7a+8b, namely: 1,2,3,4,5,6,9,10,11,12,13,17,18,19,20,25,26,27,33,34,41. This can be verified by the Chicken Nuggets Theorem quoted by Kevin Guo, as 21 = (7-1)(8-1)/2.
This solution makes no sense. You assume that just because one pair fits one part of the criteria that this must be the answer, not bothering to check whether it fits the whole problem and ignoring some 121 (this is based on your ruling out 1,2,3,6, and 9) other possible pairings. (7,8) is, in fact, wrong, because there are too many integers that can't be made.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
Below, is the script for three bills
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Postage Stamp Problem / Chicken McNugget Theorem
In this case, we can use the Chicken McNugget Theorem . Basically, if you can purchase items at m and n dollars, then the greatest price which cannot be bought using m and n (or be expressed in the form am+bn) is mn-m-n. Colloquially, there are 2 ( m − 1 ) ( n − 1 ) integers not expressed as am + bn. Therefore,
(X-1)(Y-1)=30
Using factors of 30, we get possible solutions of (2,31) (3,16) (4,11) (6,7)
Of these solutions, only (4,11) cannot express $18. Therefore, X+Y = 4 + 11 or $15 .
Link for more information is here .