### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,270)
- misc (3)
- project euler (2)
- puzzle (67)
- site news (50)
- tantalizer (69)
- teaser (7)

### Site Stats

- 206,369 hits

Programming Enigma Puzzles

9 January 2019

Posted by on **From New Scientist #989, 26th February 1976** [link]

The task of collecting funds for the Red Cross in our little town falls on five married couples. Each spring they make a sort of race of it. The last occasion was very exciting. The couples all started on a different day but, having started, kept at it until the last Friday in March. Each collected the same amount each day but the amount in question was different for each couple.

A different couple was in the lead at nightfall on the final Monday, Tuesday, Wednesday, Thursday and Friday. In other words, each couple led once in the final week. At the close on Friday, Pamela and Albert held the position held by Edward and his wife on Monday night. At the close on Friday Queenie and Bill held the position held by Desmond and wife on Monday night. Similarly Rose and husband finished where Charlie and wife had been on Monday night and Sue and husband finished where Bill and Queenie had been on Monday night. Sue and husband were in the lead on Tuesday night. Queenie and Bill overtook Tania and husband during the final week. All couples had collected something by Monday nightfall.

What was the order at close of play?

[tantalizer438]

%d bloggers like this:

All couples are accumulating their totals at a steady rate, so if we were to draw a graph plotting the couples total against time, each couple would be represented by a straight line with a positive slope. And each line would intercept the time axis on a day boundary (a negative integer, if we have

t=0to be the total collected by the end of Monday,t=1the total collected by the end of Tuesday, etc).So, when couple X overtake couple Y, they are behind at all times before the intersection, and ahead at all times after the intersection. i.e. couple X’s line has a steeper slope than couple Y.

The couple in the lead on Monday (couple 1), is overtaken by couple 2 by Tuesday, so by Friday couple 2 will still be ahead of couple 1. Couple 2 is overtaken by couple 3 on Wednesday, so by Friday couple 3 will still be ahead of couple 2 (who will be ahead of couple 1). Couple 3 is overtaken by couple 4 on Thursday, so by Friday couple 4 is still ahead of couple 3 (who are ahead of couple 2, who are ahead of couple 1). And finally, on Friday, couple 4 is overtaken by couple 5, which gives the final order on Friday as:

And this is also the order of the slopes starting with the steepest.

A similar argument working with the days is reverse order, tells us the order of the couples on Monday is the reverse of this.

The equation of the line will be:

where

ais the daily amount collected anddis the number of days the couple have been collecting on Monday.If we suppose the couples start collecting Thursday, Friday, Saturday Sunday, Monday; then couple 1 collects at the slowest rate, say

m1units of currency per day, and starts the earliest. The equations for each couple are:At

t=0couple 1 is in the lead, but att=1couple 2 is in the lead:Similarly, by considering

t = 1, 2, 3, 4, we get:If we start setting: m1 = 1.00, and choosing a value in the middle of the range at each stage, we get:

So if we start on the Thursday of the previous week, with a couple starting on each consecutive day, the totals at the end of the day are:

And we see this satisfies the conditions.

Here is the graph:

On the Monday

(x=0)we see couple 1 (red) is slightly ahead of couple 2 (orange), and then we have couples 3, 4, 5 (green, blue, purple).On the Tuesday

(x=1)we see couple 2 (orange) has overtaken couple 1 (red), and then we have couples 3, 4, 5 (green, blue, purple).On the Wednesday

(x=2)we see couple 3 (green) is slightly ahead of couple 2 (orange) and couples 4, 1, 5 (blue, red, purple).On the Thursday

(x=3)we see couple 4 (blue) is ahead of couples 3 and 5 (green, purple), then couples 2, 1 (orange, red).On the Friday

(x=4)we see couple 5 (purple) is in the lead, followed by couple 4 (blue), couple 3 (green), couple 2 (orange) and couple 1 (red).The final order is the reverse of the original order, and the relative positions will remain as the lines diverge.

So does this make a viable solution?

By assigning the following couples we satisfy all the conditions of the puzzle:

And this is the only possible assignment, so this gives us the required answer:

Solution:On Friday night the order was: 1st = Albert & Pamela; 2nd = Bill & Queenie; 3rd = Charlie & Rose; 4th = Desmond & Sue; 5th = Edward & Tania.But are there other solutions? Certainly we can choose different amounts for

m1, …, m5, and different starting days for the couples. This will give us a slightly different graph, with different crossing points, but the order on Friday is always the same (and is always the reverse of the order on Monday).This

MiniZincmodel of the problem generates possible pairings and a table of positions for each couple on each day that satisfies the constraints given in the puzzle, but doesn’t determine actual amounts for each couple, so it does not verify that it is always possible to construct a graph for each scenario.However, it does find 64 different tables, but each has the same pairings and (as expected) the same ordering of couples on Monday and Friday, so this must also be the case for all possible graphs. Hence the solution to the puzzle is unique, and we have demonstrated a possible set of values that verifies it.

Here is the

MiniZincmodel:And here is a Python program that uses the

minizinc.pywrapper to produce more readable output, and confirm the pairings and Friday orders are always the same: