Suppose we have a necklace of n beads.Each bead is labeled with an integer and the sum of all these labels is n − 1 .Can we cut the necklace to form a string whose consecutive labels x 1 , x 2 , … , x n satisfy i = 1 ∑ k x i ≤ k − 1 for k = 1 , 2 , … , n ?
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.
What do you mean by the backslash of S\~\{x_1,x_2,\dots ,x_{K-1}\} ? Is it division or a typo?
Log in to reply
I mean the complement of { x 1 , x 2 , . . . , x K − 1 } in S .
Let y i = x i − 1 . If we label the beads with the y i , then the labels sum to − 1 , and we want to string them out so that the partial sums are always at most − 1 .
Here is an algorithm for finding the place to cut. Pick a random bead to start at, call it bead 1, and write down the partial sums as we go around. Call those sums s 1 , s 2 , … , s n = − 1 . Now, cut just after the bead a that produced the largest partial sum s a . (If multiple beads produce the same largest partial sum s a , cut after the last one.) The partial sums of the resulting series will all be negative: if b > a , the ( b − a ) th partial sum of your string will be s b − s a , and if b ≤ a , the ( n − a + b ) th partial sum will be − 1 + s b − s a . These partial sums will always be negative integers by construction, so they'll always be ≤ − 1 .
Here's an example: suppose my y i are 2 , − 1 , 1 , 4 , − 2 , 1 , 1 , − 4 , − 3 , 0 , 1 , − 1 . The corresponding partial sums are 2 , 1 , 2 , 6 , 4 , 5 , 6 , 2 , − 1 , − 1 , 0 , − 1 . Cut after the seventh bead (the bead that produced the last 6 ). Then the partial sums of the resulting string are − 4 , − 7 , − 7 , − 6 , − 7 and then − 5 , − 6 , − 5 , − 1 , − 3 , − 2 , − 1 .
I solved this problem by remembering the brainteaser about starting with an empty tank and driving in a circular loop with gas stations along the way, with just enough gas in the stations to make it around once. The proof above is reminiscent of the proof that you can always find a gas station to start at in order to make it around the loop without running out of gas.
Problem Loading...
Note Loading...
Set Loading...
Let S be the set of all bead values. If x ≥ 1 for all x ∈ S , then ∑ x ∈ S x ≥ n > n − 1 . Thus we can find x 1 ∈ S with x 1 ≤ 0 .
Suppose that 2 ≤ K ≤ n and we have found distinct x 1 , x 2 , . . . , x K − 1 ∈ S such that ∑ j = 1 q x j ≤ q − 1 for all 1 ≤ q ≤ K − 1 . If it were true that x + ∑ j = 1 K − 1 x j ≥ K for all x ∈ S \ { x 1 , x 2 , . . . , x K − 1 } , then n − 1 ( n − K ) j = 1 ∑ K − 1 x j j = 1 ∑ K − 1 x j = x ∈ S ∑ x = j = 1 ∑ K − 1 x j + x ∈ { x 1 , x 2 , . . . , x K − 1 } ∑ x ≥ j = 1 ∑ K − 1 x j + ( n + 1 − K ) ( K − j = 1 ∑ K − 1 x j ) = K ( n + 1 − K ) − ( n − K ) j = 1 ∑ K − 1 x j ≥ K ( n + 1 − K ) − ( n − 1 ) = ( K − 1 ) ( n − K ) + 1 ≥ K − 1 + n − K 1 > K − 2 which is a contradiction. Thus we can find x K ∈ S \ { x 1 , x 2 , . . . , x K − 1 } such that ∑ j = 1 K x j ≤ K − 1 . Hence, by induction, we can label the elements S as x 1 , x 2 , . . . x n such that ∑ j = 1 k x j ≤ k − 1 for all 1 ≤ k ≤ n .