Le Monde puzzle [#737 re-read]

As a coincidence, while I was waiting for the solution to puzzle #737 published this Friday in Le Monde, the delivery (wo)man forgot to include the weekend magazine and I had to buy it this morning with my baguette (as if anyone cares!). The solution is (y0,z0,w0)=(38,40,46) and…it does not work! The value of (x1,y1,z1,w1) is indeed (19,39,43,8.5). Now, it does not work because the update mechanism used by the writers of the Le Monde column is to move all positions simultaneously, rather than one at a time: the update thus reads as

if un=(xn,yn,zn,wn), for i=1,…,4,

u_i^n=\frac{1}{2}\left(u_i^{n-1}+\min_{j;u_j^{n-1}>u_{i}^{n-1}}u_{j}^{n-1}\right)\,\text{mod}\,48

if uin-1 is not the maximum of un-1 and

u_{i}^{n}=\frac{1}{2}\left(u_{i}^{n-1}+48+\min_{j\ne i}u_{j}^{n-1}\right)\,\text{mod}\,48

otherwise.

(to compare with my earlier proposal). In this new configuration, the core of the R code I use is

[sourcecode language=”r” gutter=”false”]
while (nodd){

nsuite=suite=start=c(0,sort(2*sample(1:23,3)))
for (t in 1:20){
#some values of start never produce non-integer values
#of suite and never visit suite[1]=0

nsuite[-4]=(suite[-4]+suite[-1]+48*(suite[-1]-suite[-4]<0))/2
nsuite[4]=(suite[4]+suite[1]+48*(suite[1]-suite[4]<0))/2
suite=nsuite%%48

if ((suite[1]==0)||(max(is.decimal(suite))==1)){
nodd=(max(is.decimal(suite))==1)
print(t)
break()}
}}
[/sourcecode]

This new version leads to solutions (unsurprisingly!), returning

[sourcecode gutter=”false”]
> print(start)
[1] 0 12 24 36
[/sourcecode]

as one solution in 8 steps and

[sourcecode gutter=”false”]
> print(start)
[1] 0 38 40 46
[/sourcecode]

as the quickest solution in 6 steps.

One Response to “Le Monde puzzle [#737 re-read]”

  1. […] le Monde, a few days ago, the front page title was “l’augmentation du chômage […]

Leave a Reply

Discover more from Xi'an's Og

Subscribe now to keep reading and get access to the full archive.

Continue reading