The town of Hamlet has people for each horse, sheep for each cow, and ducks for each person. Which of the following could not possibly be the total number of people, horses, sheep, cows, and ducks in Hamlet?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
With h horses and c cows the total is 13h + 5c; test each choice by subtracting multiples of 13 and checking for a multiple of 5.
Solution
Let there be horses and cows. Then there are people, ducks, and sheep. The total is
where and are non-negative integers.
A total is possible exactly when is a non-negative multiple of for some . Since only the last digit matters for divisibility by , subtract and look for a result ending in or :
- : . Possible (, ).
- : — none ends in or . Impossible.
- : . Possible.
- : . Possible.
- : . Possible.
The answer is .
Why this works
Every " of these for each of those" sentence chains the counts to a single free variable, so the total is a linear combination of two parameters. Deciding which numbers are representable is a small Diophantine check, and because one coefficient is , only the last digit of matters, which makes the test fast. Note the people-to-duck ratio is applied to people, not horses, giving ducks.
The trap
Building the total from the wrong ratios, e.g. 3 horses per person or 3 ducks per horse, which changes 13h + 5c to some other form.
Common mistakes
- Building the total from the wrong ratios, e.g. 3 horses per person or 3 ducks per horse, which changes 13h + 5c to some other form.
- Stopping the search too early: needs and needs , so checking only wrongly eliminates them.
Techniques
Use the answer choices (mod checks, size, form) to eliminate or select · Organized listing / direct enumeration