Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. A combinatorics Le Monde mathematical puzzle:

How many distinct integers between 0 and 16 can one pick so that all positive differences are distinct?

If k is the number of distinct integers, the number of positive differences is

1+2+…+(k-1) = k(k-1)/2,

which cannot exceed 16, meaning k cannot exceed 6. From there, picking 6 integers at random makes it easy to check for the condition:

x=sort(sample(0:16,6))
y=outer(x[-1],x[-6],"-")
while (max(duplicated(y[lower.tri(y)]))==1){
x=sort(sample(0:16,6))
y=outer(x[-1],x[-6],"-")}


which quickly returns

> x
 0  1  5  9 12 15


as a solution. Now, reading the puzzle solution of Le Monde today, on September 09, I discovered that the authors proposed a sequence of length 7, (0,1,2,4,5,7,11,16), which does not work since 1-0=2-1… and proved that 8 is an impossible value by quite a convoluted argument. Did I misread again?!

Filed under: Books, Kids, R Tagged: intervals, Le Monde, lower.tri(), mathematical puzzle  