Once upon a time, after selling his first golden egg laid by the magic goose, Jack received a whole prime number of Shilling coins as a trade. He then wandered through the market, looking for livestock he would bring to his farmland, and found one shop with hens, pigs, and ducks on sales. The three kinds had different prices of whole Shillings per one animal of a kind.
As Jack pondered which animals to buy with all his money, the ingenious merchant skillfully offered these calculated options:
In the end, Jack wanted all kinds of animals combined and so purchased them with all his Shillings.
How many hen(s), pig(s), and duck(s) did he bring home respectively? Suppose if your answer is 1 hen, 2 pigs, and 3 ducks, submit 1 2 3 as your answer. (If you think there is no such applicable combination, submit 0 0 0 as your answer.)
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.
Let S be the total Shillings Jack acquired and x be the price of each hen, y be that of each pig, and z be that of each duck.
Then we can set up the Diophantine equations as followed:
7 x + 5 y = S 8 y + 3 z = S 4 z + 9 x = S
We can then rewrite the whole system as matrix multiplication:
⎣ ⎡ 7 0 9 5 8 0 0 3 4 ⎦ ⎤ ⎣ ⎡ x y z ⎦ ⎤ = ⎣ ⎡ S S S ⎦ ⎤ = S ⎣ ⎡ 1 1 1 ⎦ ⎤
The determinant of the 3 × 3 matrix equals to 7 × 8 × 4 + 5 × 3 × 9 = 2 2 4 + 1 3 5 = 3 5 9
Hence, solving the equation by multiplying the inverse matrix, we will obtain:
⎣ ⎡ x y z ⎦ ⎤ = 3 5 9 S ⎣ ⎡ 8 × 4 − 9 × − 3 8 × − 9 − 5 × 4 7 × 4 − 5 × − 9 5 × 3 − 7 × 3 7 × 8 ⎦ ⎤ ⎣ ⎡ 1 1 1 ⎦ ⎤ = 3 5 9 S ⎣ ⎡ 3 2 − 2 0 + 1 5 2 7 + 2 8 − 2 1 − 7 2 + 4 5 + 5 6 ⎦ ⎤ = 3 5 9 S ⎣ ⎡ 2 7 3 4 2 9 ⎦ ⎤
Since S is prime as stated in the question and so is 3 5 9 , we can conclude that S = 3 5 9 . Otherwise, x , y , z will not be integers and so contradicted. Thus, x = 2 7 ; y = 3 4 ; and z = 2 9 .
Now let us sum up all the costs: x + y + z = 2 7 + 3 4 + 2 9 = 9 0 . Then 3 5 9 ≡ 1 ( m o d 9 0 ) , having 1 Shilling short to make up perfect sets of these animals. Therefore, we need to find the way to put this − 1 remainder within x , y , z combination.
First, let us rewrite y = x + 7 and z = x + 2 . Hence, we can rewrite the new Diophantine equation:
3 5 9 = 4 x + 4 ( x + 2 ) + 4 ( x + 7 ) − 1 = 1 2 x + 3 5
Now we just need to write 3 5 in terms of 2- and 7-multiples, for a , b stands for numbers of ducks and pigs purchased: 3 5 = 2 a + 7 b .
Clearly, b needs to be odd because 3 5 − 2 a is odd, and b < 5 because if b ≥ 5 , a will not be positive integer.
Thus, only b = 1 or b = 3 works. However, if b = 1 , then a = 1 4 , but 2 7 3 5 9 < 1 4 , meaning Jack can not buy over 1 3 animals even by buying all the cheapest hens.
As a result, b = 3 is the only solution, leading to a = 7 .
That means, Jack would be able to buy 3 pigs and 7 ducks, and by simple subtraction, we will calculate 2 hens as well:
2 x + 3 y + 7 z = 2 × 2 7 + 3 × 3 4 + 7 × 2 9 = 3 5 9
Finally, Jack had purchased 2 hens, 3 pigs, and 7 ducks.
Let the number of gold coins, and the prices of hen, pig, and duck be g , h , p , and d respectively. Then we have:
⎩ ⎪ ⎨ ⎪ ⎧ 7 h + 5 p + 0 d = g 0 h + 8 p + 3 d = g 9 h + 0 p + 4 d = g . . . ( 1 ) . . . ( 2 ) . . . ( 3 )
\(\begin{array} {} 8 \times (1) - 5 \times (2): & 56 h + 0p - 15d = 3g & ...(4) \end{array} \)
From 1 5 × ( 3 ) + 4 × ( 4 ) : 3 5 9 h = 2 7 g . Since g and 359 are primes and h an integer, this means that g = 3 5 9 and h = 2 7 . Substituting the two values in ( 1 ) : ⟹ p = 5 3 5 9 − 7 ( 2 7 ) = 3 4 and ( 3 ) : ⟹ d = 4 3 5 9 − 9 ( 2 7 ) = 2 9 .
Let the number of hens, pigs, and ducks purchased be k , m , and n respectively. Then we have:
2 7 k + 3 4 m + 2 9 n ⟹ 3 5 9 − 2 7 k − 2 9 n 1 9 + 7 k + 5 n = 3 5 9 ≡ 0 (mod 34) ≡ 0 (mod 34)
Putting k = 1 ⟹ 2 6 + 5 n ≡ 0 (mod 34) ⟹ n ≡ 2 2 . But it is unacceptable because 2 2 > ⌊ 2 9 3 5 9 ⌋ = 1 2 the maximum possible value of m .
Putting k = 2 ⟹ 3 3 + 5 n ≡ 0 (mod 34) ⟹ n ≡ 7 acceptable. Implying that m = 3 4 3 5 9 − 2 7 ( 2 ) − 2 9 ( 7 ) = 3 . Therefore, k m n = 2 3 7 .
Let x,y,z be the unit cost of a hen,pig, and duck respectively. Then we have the equations: 7x + 5y = p, 8y + 3z = p, 4z + 9x = p.By eliminating y and z, we get 359x = 27p. But 359 is a prime, so x = 27. Substituting in the other equations, y = 34 and z = 29. If he went home with a hens, b pigs, and c ducks, then 27a + 34b + 29c = 359. Clearly b < 9. Substituting values for b, and finding a,c results in a + 2, b = 3, c = 7.
Problem Loading...
Note Loading...
Set Loading...
Use S for the total Jack has in shillings, and h , p , d for the respective prices of hens, pigs and ducks.
S = 7 h + 5 p
S = 8 p + 3 d
S = 4 d + 9 h
Add the second and third of these equations, and subtract the first:
S = 2 h + 3 p + 7 d giving the answer 2 3 7 .
This is the only order of addition and subtraction that doesn't result in a negative quantity of one of the animals.