Teaser 3142: Mrs Hyde’s garden design tips
From The Sunday Times, 11th December 2022 [link] [link]
I’m planting four differently-coloured plots in a line. Mrs Hyde’s design principles classify eight colours into five categories. Adjacent plots mustn’t have the same category, or even certain pairs of categories.
“Every scheme you’ve suggested has at least one adjacent pair of categories that breaks my rules”, said Mrs Hyde. “White, Green, Yellow, White has Honest and Social adjacent; Blue, Orange, Pink, Violet has Ardent and Social adjacent; Green, Violet, Blue, Orange has Ardent and Honest adjacent; Violet, White, Orange, Red has Droll and Honest adjacent; and White, Violet, Green, Blue has Jolly and Social adjacent. However, if you change one colour in one of your suggestions then it will work”.
What are the four colours in order in the changed suggestion that would be allowable?
[teaser3142]
Jim Randell 4:55 pm on 9 December 2022 Permalink |
Here is my first attempt. It is not particularly quick, but I’ll have another look at this puzzle later.
The program maps the different colours to the categories and checks that each of the given arrangements provides (at least) the corresponding objection. One we have a viable map we change one of the colours in one of the given arrangements and look for new arrangements that do not give rise to any of the objections raised previously.
This Python program runs in 866ms.
Run: [ @replit ]
Solution: The allowable arrangement is: White, Red, Green, Blue.
The colour assignments are:
And so the given arrangements (and their objections) are:
However, swapping Violet for Red in the final arrangement gives:
Which does not give any of the objections we have discovered so far.
LikeLike
Jim Randell 6:25 pm on 9 December 2022 Permalink |
Here is a much faster version of my program (and not much longer). It uses the [[
SubstitutedExpression()
]] solver from the enigma.py library to assign the colours to the categories, such that the objections for each arrangement applies.It runs in 57ms. (Internal runtime is 5.6ms).
Run: [ @replit ]
LikeLike