From The Sunday Times, 30th August 1964 [link]
I am the Managing Director of a factory and I have under me five employees. Their names are: Alf, Bert, Charlie, Duggie and Ernie. And their jobs are, not necessarily respectively: Doorkeeper, Doorknob Polisher, Bottle Washer, Welfare Officer and Worker.
There has been some dissatisfaction recently about wages which, in the past, I am bound to admit, have sometimes been rather haphazard. It is clearly very difficult to arrange things in such a way that merit is appropriately rewarded, but it seemed to me important that everybody’s position should at least be clear. After much thought, therefore, I put up the following notice:
Wages:
1. Alf is to get more than Duggie.
2. Ernie is to get 12 per cent more than the Bottle Washer will when he receives the 10 percent rise that he will be getting next month.
3. The Doorknob Polisher is to get 30 per cent more than he used to.
4. Charlie is to get £12 a year less than 20 per cent more than the Welfare Officer.
5. No one is to get less than £200 or more than £600 a year.
6. The Doorkeeper is to get 5 per cent more than he would if he got 10 per cent less than Bert.
Everyone always has received in my factory, receives now, and as long as I am in charge will always receive an exact number of £s per year.
What are the various jobs of my employees, and what yearly wage is each of them to get?
This puzzle is included in the book Sunday Times Brain Teasers (1974). The puzzle text above is taken from the book.
[teaser177]
Jim Randell 7:48 am on 3 November 2022 Permalink |
This puzzle is very similar to Teaser 467 (and the answer is the same), although the conditions are slightly different.
We can solve this puzzle using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 63ms. (Internal runtime of the generated program is 1.2ms).
Run: [ @replit ]
Solution: Psalm 149. Hymn 263. Hymn 587.
LikeLike
GeoffR 8:33 am on 3 November 2022 Permalink |
There are many solutions without the restricted psalm and hymn number ranges.
LikeLike
GeoffR 1:43 pm on 3 November 2022 Permalink |
from enigma import is_prime, nsplit, all_different # Find Psalm number for P1 in range(100,150): if not (is_prime(P1)): continue A,B,C = nsplit(P1) if 0 in (A,B,C):continue if not all_different(A,B,C):continue # Find 1st Hymn number for H1 in range(151,667): if not (is_prime(H1)):continue D,E,F = nsplit(H1) if 0 in (D,E,F): continue if not all_different(A,B,C,D,E,F):continue # Find 2nd Hymn number for H2 in range(H1+1, 667): if not is_prime(H2):continue G,H,I = nsplit(H2) if 0 in (G,H,I):continue if not all_different(A,B,C,D,E,F,G,H,I):continue print(f"Sunday's numbers were {P1}, {H1}, {H2}") # Sundays numbers were 149, 263, 587LikeLike