The Mathematicians' Picnic

Algebra Level 4

[not original but a fun problem - credit to TM Campbell]

The Chief Mathematician was disappointed at the mathematicians' picnic to find that the picnic tables were not evenly spaced. In fact, they were separated by distances of 12 12 , 8 8 , 5 5 , 10 10 , and 6 6 feet, in that order. He ordered that the tables be repositioned at equal spacing, with the minimum of total movement so as to minimise the risk of upsetting the lunch. How was this done?

If the minimum total movement (in feet) required is T T , give 1000 T \left \lfloor 1000T \right \rfloor as your answer.

For example, if the first table is moved 3 3 feet to the left, and the second table 2 2 feet to the right, this contributes 5 5 feet to the total movement.


The answer is 8250.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Chris Lewis
Apr 13, 2021

This fairly innocuous looking problem has two major difficulties: the function we have to minimise is a sum of modulus functions; these aren't differentiable, so we can't use calculus, and they're not linear, so we can't use linear programming (except...see below). Also, the constraint is quite unusual.

Warning - long solution ahead! If there's a quicker way, please let me know.

The first thing to observe is that the sizes of the individual tables don't matter - only the gaps are important, so we can treat the tables themselves as having zero length.

Say we measure distances from the first table; let the initial position of the i th i^\text{th} table be P i P_i ; so P 1 = 0 P_1=0 , P 2 = 12 P_2=12 , P 3 = 20 P_3=20 , P 4 = 25 P_4=25 , P 5 = 35 P_5=35 , P 6 = 41 P_6=41 .

If table i i is moved d i d_i feet to the right (a move to the left corresponding to a negative value), the function we need to minimise is i = 1 6 d i \sum_{i=1}^6 |d_i|

If Q i = P i + d i Q_i=P_i+d_i denotes the final position of the i th i^\text{th} table, then the constraint is that the Q i Q_i form an arithmetic progression; that is Q i = A + i D Q_i=A+iD for some A , D A,D . Alternatively, we can write five constraints as Q i + 1 Q i = D Q_{i+1}-Q_i=D


Approach 1: linear programming

I mentioned above that the objective function is not linear. However, there is a very cunning trick we can use: instead of using the d i d_i as variables, let table i i be moved l i l_i feet to the left and r i r_i feet to the right, with both these values non-negative. Then our objective function becomes i = 1 6 l i + r i \sum_{i=1}^6 l_i+r_i The trick here is that by minimising this function, we force either l i l_i or r i r_i (or both) to be zero. There's no risk of linear programming returning, say, l i = 5 l_i=5 and r i = 2 r_i=2 because the overall effect is the same as l i = 3 l_i=3 , r i = 0 r_i=0 , but with a larger contribution to the objective function.

The constraints can be written as l i 0 l_i \ge 0 , r i 0 r_i \ge 0 , D 0 D\ge 0 and P i + 1 + r i + 1 l i + 1 ( P i + r i l i ) = D P_{i+1}+r_{i+1}-l_{i+1}-\left(P_i+r_i-l_i\right)=D

This is now completely linear, so we can use (say) the simplex algorithm to solve it; the result is a total distance moved of 8.25 8.25 feet, giving the answer 8250 \boxed{8250} .


Approach 2: parameter space

What does the set of all possible valid final arrangements look like? How can we parameterise it?

The final positions of the tables must be in arithmetic progression. Although we have 6 6 tables, there are only 2 2 degrees of freedom. For example, we could fully specify the final positions of the tables by giving the position of any one table, and the size of the gap between them. Or (as I'll do here), we can specify how much we move the two outermost tables; we know the remaining tables are spaced equally between them.

Let's say we move the first table a distance x x to the right, and the last table a distance y y to the right. If we decide we want to move them to the left, we just change the signs of these quantities as appropriate; if we want them to stay still, we set the distances to zero.

We can now visualise the parameter space as an ( x , y ) (x,y) coordinate system. For each point ( x , y ) (x,y) , we can work out the new positions of all the tables (knowing that they're equally spaced), and calculate how far each table has moved. The total of these distances moved is the function we want to minimise.

As an example, say we don't move the end tables at all; we just adjust the middle tables so that they're spaced evenly.

Table Original position Final position Distance moved
1 1 0 0 0 0 0 0
2 2 12 12 8.2 8.2 3.8 3.8
3 3 20 20 16.4 16.4 3.6 3.6
4 4 25 25 24.6 24.6 0.4 0.4
5 5 35 35 32.8 32.8 2.2 2.2
6 6 41 41 41 41 0 0

Total movement: 10 10 (this is, incidentally, not bad, and almost certainly what I'd do in practice!)

We can define a function f ( x , y ) f(x,y) to be the total movement of all the tables corresponding to the point ( x , y ) (x,y) of our parameter space. In this case, we have found that f ( 0 , 0 ) = 10 f(0,0)=10 .

What does this function look like? If we plotted it on the z z -axis above the ( x , y ) (x,y) parameter space, we would see a surface made up of sections of planes (sort of polyhedral, but the outer planes are not bounded). This is the equivalent of the familiar V-shaped plots of modulus functions in 2D.

With a bit of thought, we can see that (at least) one of the vertices of this polyhedral surface must be the lowest point (ie, the point that represents the optimal solution). It's possible that a whole edge, or a whole face of the surface is optimal, but by checking the vertices we guarantee finding the minimum value of the function.

The edges of the surface correspond to fixing a particular table (ie a zero contribution to the total movement from that table). The vertices - where the edges meet - correspond to fixing two tables.

So, with this intuition, we now know that the optimal solution will come from picking two tables to leave in place, and moving the others. With six tables in total, there are only 15 15 pairs of tables to check; this is actually somewhat quicker than the simplex algorithm above.

Trying all possible pairs, we find the optimum occurs when we keep tables 2 2 and 6 6 in their original positions:

Table Original position Final position Distance moved
1 1 0 0 4.75 4.75 4.75 4.75
2 2 12 12 12 12 0 0
3 3 20 20 19.25 19.25 0.75 0.75
4 4 25 25 26.5 26.5 1.5 1.5
5 5 35 35 33.75 33.75 1.25 1.25
6 6 41 41 41 41 0 0

and again we have a total distance moved of 8.25 8.25 feet.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...