0
$\begingroup$

Consider the set of integers $\left\{1,2,...,100\right\}$. Let $\left\{x_1,x_2,...,x_{100}\right\}$ be some arbitrary arrangement of the integers $\left\{1,2,...,100\right\}$, where all of the $x_i$ are different. Find the smallest possible value of the sum

$$S=|x_2-x_1|+|x_3-x_2|+...+|x_{100}-x_{99}|+|x_1-x_{100}|$$

I opine the arbitrary set to be the original one itself, to have the least value od some. But, I am not sure what will happen in case we swipe a few terms, although I have tried some examples for that.

  • 0
    Have you tried to solve the problem with $100$ replaced with smaller values (e.g., 1,2,3,etc.)? That's a good way to start many problems.2017-01-16

2 Answers 2

1

Hint: Consider $1,\ldots,100$ as vertices of a graph, arranged on the number line, with edges $\{x_1, x_2\}, \{x_2, x_3\}, \ldots, \{x_{99},x_{100}\}$, $\{x_{100}, x_1\}$. Show that for each $i$ from $1$ to $99$ there are at least two edges joining $\{1,...i\}$ to $\{i+1, \ldots, 100\}$. What does that say about your sum?

  • 0
    Can you elaborate on what this shows? All I see is that it says you must have one term of the sum >1, in which case this term must be 99, but I don't see how this helps account for in-between cases, say, where some of the terms are 2's.2017-01-16
  • 1
    Your sum can be considered as the sum for $i$ from $1$ to $99$ of the number of edges joining $\{1,\ldots,i\}$ to $\{i+1,\ldots,100\}$. Since each of those contributions is at least $2$, the sum is at least $2 \cdot 99 = 198$.2017-01-17
  • 0
    i guess im not clear as to why you can represent the sum just as the number of edges joining the two sets for each i, because you're double counting in many cases, say, if ${1,100}$ is an edge and every other edge looks like ${j,j+1}$.2017-01-17
1

For an intuition that confirms your initial guess, consider this:

Suppose there are houses with house numbers $1$ through $100$ spaced at equal distances along one side of a street. Each house has a mailbox adjacent to the street so that someone walking past the house on the street can deliver mail to that house without taking any extra steps. Starting at one of the houses and traveling on foot, you must deliver at least one piece of mail to each of the houses and then return to your starting point. How far must you walk?

Measure the distance as a multiple of the distance between houses, for example to walk from house $2$ to house $3$ is distance $1,$ but to walk from house $2$ to house $32$ is distance $30.$ So if you visit the houses in the sequence $x_1, x_2, x_3, \ldots, x_{100},$ then $\lvert x_2 - x_1 \rvert$ is the distance you will walk to go from house $x_1$ to house $x_2,$ and $|x_2-x_1|+|x_3-x_2|+...+|x_{100}-x_{99}|+|x_1-x_{100}|$ is the total distance you will walk to deliver all the mail and return to your starting point.

To deliver the mail, you can start at any house you like, but eventually you must reach either house $1$ or house $100.$ Once you have reached one of those houses, you must someone get to the other one, and then from that house you must somehow get back to where you started. So if you delivered mail only at houses $x_1,$ $1,$ and $100,$ where $1 \leq x_1 \leq 100,$ you would have to walk at least a distance $$|100-x_1|+|100-1|+|x_1-1| = (100 - x_1) + 99 + (x_1 - 1) = 198.$$

It is possible to deliver all the mail while walking only a distance $198$ (for example, deliver to houses $1,2,\ldots,100$ in sequence, that is, use "the original set" as mentioned in your question), but since the act of stopping to deliver mail does not reduce the distance to the next house, you cannot reduce the distance any less and still deliver mail to house $1$ and to house $100$ and return to your starting place.

You have many choices for how to deliver the mail while walking only a distance $198.$ You can start at any house you like, and initially walk either up the street or down the street, and as you pass each house the first time (other than houses $1$ or $100$) you can either deliver the mail then or not deliver the mail then. You will have to walk to each house a second time anyway, and then you can deliver the mail if you did not do so the first time. But if your path changes direction more than twice, it should be clear that you will end up walking the same part of the street more than two times and your total distance will be greater than $198.$


That is a very informal, "hand-wavy" statement of the problem, of course. Graph theory, for example as used in Robert Israel's answer, gives you rigorous arguments that can really prove (not just "intuit") the solution of the problem.