## Brain-Teaser 560: Ribbon counter

**From The Sunday Times, 26th March 1972** [link]

“Puzzle here”, says Bell at the pub. “Chap has a ribbon shop, sells the stuff by the inch, no commercial sense. He’s barmy anyway; look how he measures it. His counter is exactly 100 inches long and he’s marked it off into 16 bits; 6 of 11 inches, 2 of 6 inches, 3 of 5 inches, 1 of 3 inches and 4 of 1 inch, and he can measure any number of inches up to a hundred, that is, by picking the right pair of marks.

“You have to sort the spaces out; but I’ll tell you, all the 11 inches are together round about the middle — well, a bit to the right, but not as much as 4 inches off centre. You get the idea? For most measurements he’s using a kind of feet and inches with eleven inches to the foot”.

“Young Green is nearly right: he can’t measure 99 inches unless there’s a 1-inch space at one end, but he doesn’t need a 1-inch at the other end for 98 inches; he does it with two 1-inch spaces at the same end; but there might be a 1-inch at the other end, all the same, and there might not”.

“In answer to two foolish questions, the ribbon must be measured single thickness, no folding; and it’s a straight counter, it’s not circular”.

“Usual prize, one pint”.

How were the spaces arranged from left to right?

This puzzle was included in the book **Sunday Times Brain Teasers** (1974, edited by Ronald Postill).

[teaser560]

## Jim Randell 10:10 am

on18 September 2022 Permalink |The puzzle is describing a

sparse rulerof length 100 with 17 marks. (See:Teaser 119).However, in this case we are told that one end of the ruler has two 1-segments (lets put them at the start), and the six 11-segments all occur together in the middle-ish (displaced slightly to the right, but not by more than 3 inches), so we can look for arrangements of the remaining segments that give a viable ruler.

This Python program runs in 104ms. (Internal runtime is 49ms).

Run:[ @replit ]Solution:The segments are as follows:The centre of the 11’s is 53 inches from the left edge.

Using the code I wrote for

Teaser 119we find there are only 2 sparse rulers of length 100 with 17 marks (and it is not possible to construct a length 100 ruler with fewer marks):The second being the mirror image of the first (which is clear from the representation in difference format).

LikeLike

## Frits 11:38 am

on19 September 2022 Permalink |@Jim, you still have to put the latest version of enigma.py to the magwag site.

LikeLike

## Jim Randell 3:57 pm

on19 September 2022 Permalink |I’ve uploaded

enigma.pyversion 2022-09-17, which has all my recent changes in it.The most interesting change is that

`SubstitutedExpression.split_sum()`

can now take multiple simultaneous sums to split. In general it is now faster to use`split_sum()`

than it is to use the specialised`SubstitutedSum`

solver.LikeLike

## Frits 3:15 pm

on19 September 2022 Permalink |Similar reusing parts of Jim’s code.

LikeLike

## Frits 3:50 pm

on19 September 2022 Permalink |This only handles the situation if the two 1-segments appear at the start (at the left).

LikeLike