Brain-Teaser 516: [Cabinet reshuffle]
From The Sunday Times, 2nd May 1971 [link]
In Northminster the Premier is planning a reshuffle of five positions in his Cabinet. They are (in decreasing order of rank):
Deputy Premier,
Chancellor of the Purse-strings,
Minister of Mails,
Secretary of Science,
Head Whip.At the moment these jobs are held (not respectively) by:
Attler,
Balfy,
Chamberton,
Disreel,
Edane.Soon these five jobs are to be re-allocated among these five people and each person will get a different job from the one he holds at the moment.
In the reshuffle the Premier is going to promote Chamberton to Minister of the Mails, or above. Edane is also to be promoted. Attler has made it clear that if he is going to be junior to Chamberton, then the only Deputy Premier he would work under would be Disreel.
Balfy is going to be demoted, but one consolation is that after the reshuffle he will be senior to someone to whom at the moment he is junior. Finally, Disreel will become Deputy Premier only if Balfy becomes Minister of Mails.
The Premier tries to avoid a party split by arranging his reshuffle to satisfy all the above demands. Also he arranges it with the least number of demotions possible in the circumstances.
Who is the present Secretary of Science? And, who is to become Secretary of Science?
This puzzle was originally published with no title.
[teaser516]
Jim Randell 12:12 pm on 2 April 2020 Permalink |
In order to get a unique solution I had to add a couple of extra “implied” conditions (the kind that got me into trouble in Enigma 99).
So: “… is going to promote Chamberton to Minister of the Mails, or above”, implies that C’s current position is below MoM.
and: “Disreel will become Deputy Premier only if …”, implies that D is not currently Deputy Premier. (Also the fact that A would serve under D as Deputy Premier implies that D does not currently hold this position).
and (maybe): “… Attler has made it clear that if he is going to be junior to Chamberton …”, implies that A is not currently junior to C (although this extra condition is not required to get a unique solution).
With these conditions made explicit we find there is a single answer to the puzzle.
This Python program runs in 86ms.
Run: [ @repl.it ]
from enigma import (defaultdict, irange, subsets, printf) # "p -> q" = "if p then q", "q if p", "p only if q" implies = lambda p, q: not(p) or q # record (by number of demotions) who occupies position 4 r = defaultdict(set) # consider "before" positions for before in subsets(irange(1, 5), size=5, select="P"): (bA, bB, bC, bD, bE) = before # [implied] D is not currently 1 if bD == 1: continue # [implied] A is not currently junior to C if (bC < bA): continue # [implied] C is currently below 3 if not (bC > 3): continue # consider "after positions" for after in subsets(irange(1, 5), size=5, select="P"): (aA, aB, aC, aD, aE) = after # nobody keeps the same post if any(bX == aX for (bX, aX) in zip(before, after)): continue # if A is junior to C, then D must be 1 if not implies(aA > aC, aD == 1): continue # D becomes 1 only if B becomes 3 if not implies(aD == 1, aB == 3): continue # C is to be promoted to 3 or above if not (aC < 4 and aC < bC): continue # E is to be promoted if not (aE < bE): continue # B is to be demoted ... if not (aB > bB): continue # ... but will become senior to someone who was his junior if not any(aB < aX and bB > bX for (bX, aX) in zip(before, after)): continue # count the number of demotions d = sum(aX > bX for (bX, aX) in zip(before, after)) printf("[d={d}, A: {bA}->{aA}; B: {bB}->{aB}; C: {bC}->{aC}; D: {bD}->{aD}; E: {bE}->{aE}]") b = dict(zip(before, "ABCDE")) a = dict(zip(after, "ABCDE")) r[d].add((b[4], a[4])) # look for the fewest number of demotions k = min(r.keys()) for (b4, a4) in r[k]: printf("{k} demotions: SoS = {b4}->{a4}")Solution: Chamberton is the current Secretary of Science. Edane will be the new Secretary of Science.
There is only one scenario that has only 2 demotions:
We are told B is to be demoted, and someone else who was above B must also be demoted under B, so we cannot do better than 2 demotions.
There are 2 further scenarios that satisfy the conditions that have 3 demotions.
LikeLike
John Crabtree 10:06 pm on 3 April 2020 Permalink |
Let the five positions in order of rank be P1, P2, P3, P4 and P5.
C and E will be promoted, D can be promoted, and B has somebody senior to him, and so A is currently in P1.
B can be demoted to P3, and so is currently in P2.
A will move to P4 or P5 (lower than B), and so will be junior to C (P3 or above), and so D moves to P1, and so B moves to P3, and so C moves to P2.
To minimise the number of demotions A moves to P5, and E moves from P5 to P4.
The current positions are not in order, and so currently C is in P4, and D is in P3.
Chamberton is the current Secretary of Science.
Edane will become the Secretary of Science.
LikeLike