Is there an $11$-element circular permutation of ${1,2,…,12}$ with all $|a_i-a_{i+1}|$ distinct?
$begingroup$
Can you choose $11$ different numbers among them so that the numbers $|a_1-a_2|, |a_2-a_3|,ldots,|a_{10}-a_{11}|,|a_{11}-a_{1}|$ are all different. The smartest thing that my dumbest mind could accomplish is that all those differences are $1,2,3,...,11$. From this, there are two ways - construct an example which is quite painful - but I did it for $n=4,5$ and tried for $6$ so I couldn't find example for $3$, so may be there something about $6$ and its multiplicators? another way - prove by something, may be algebra or properties of numbers of $1,2,3,ldots,11$ (sum of squares so we could get rid of modulus), try to prove that there always will be at least two equal differences and so on. Can you give me some hint?
combinatorics permutations contest-math
$endgroup$
|
show 8 more comments
$begingroup$
Can you choose $11$ different numbers among them so that the numbers $|a_1-a_2|, |a_2-a_3|,ldots,|a_{10}-a_{11}|,|a_{11}-a_{1}|$ are all different. The smartest thing that my dumbest mind could accomplish is that all those differences are $1,2,3,...,11$. From this, there are two ways - construct an example which is quite painful - but I did it for $n=4,5$ and tried for $6$ so I couldn't find example for $3$, so may be there something about $6$ and its multiplicators? another way - prove by something, may be algebra or properties of numbers of $1,2,3,ldots,11$ (sum of squares so we could get rid of modulus), try to prove that there always will be at least two equal differences and so on. Can you give me some hint?
combinatorics permutations contest-math
$endgroup$
2
$begingroup$
pigeonhole desn't work directly there
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:15
3
$begingroup$
@jmoravitz could you show me how to apply it, please?
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:27
1
$begingroup$
Have you tried to see what happens when you start with fewer numbers - four or five say?
$endgroup$
– Mark Bennet
Dec 8 '18 at 16:31
1
$begingroup$
The question is quite similar to this one, although $66$ falls within their bound.
$endgroup$
– Jam
Dec 8 '18 at 18:34
1
$begingroup$
@Jam we can add the number we didn't took, say between $1,12$ and so we don't change the sum of differences.
$endgroup$
– Yanko
Dec 8 '18 at 18:45
|
show 8 more comments
$begingroup$
Can you choose $11$ different numbers among them so that the numbers $|a_1-a_2|, |a_2-a_3|,ldots,|a_{10}-a_{11}|,|a_{11}-a_{1}|$ are all different. The smartest thing that my dumbest mind could accomplish is that all those differences are $1,2,3,...,11$. From this, there are two ways - construct an example which is quite painful - but I did it for $n=4,5$ and tried for $6$ so I couldn't find example for $3$, so may be there something about $6$ and its multiplicators? another way - prove by something, may be algebra or properties of numbers of $1,2,3,ldots,11$ (sum of squares so we could get rid of modulus), try to prove that there always will be at least two equal differences and so on. Can you give me some hint?
combinatorics permutations contest-math
$endgroup$
Can you choose $11$ different numbers among them so that the numbers $|a_1-a_2|, |a_2-a_3|,ldots,|a_{10}-a_{11}|,|a_{11}-a_{1}|$ are all different. The smartest thing that my dumbest mind could accomplish is that all those differences are $1,2,3,...,11$. From this, there are two ways - construct an example which is quite painful - but I did it for $n=4,5$ and tried for $6$ so I couldn't find example for $3$, so may be there something about $6$ and its multiplicators? another way - prove by something, may be algebra or properties of numbers of $1,2,3,ldots,11$ (sum of squares so we could get rid of modulus), try to prove that there always will be at least two equal differences and so on. Can you give me some hint?
combinatorics permutations contest-math
combinatorics permutations contest-math
edited Dec 15 '18 at 18:18
Jam
4,95021431
4,95021431
asked Dec 8 '18 at 16:09
Anuar KuanyshAnuar Kuanysh
122
122
2
$begingroup$
pigeonhole desn't work directly there
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:15
3
$begingroup$
@jmoravitz could you show me how to apply it, please?
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:27
1
$begingroup$
Have you tried to see what happens when you start with fewer numbers - four or five say?
$endgroup$
– Mark Bennet
Dec 8 '18 at 16:31
1
$begingroup$
The question is quite similar to this one, although $66$ falls within their bound.
$endgroup$
– Jam
Dec 8 '18 at 18:34
1
$begingroup$
@Jam we can add the number we didn't took, say between $1,12$ and so we don't change the sum of differences.
$endgroup$
– Yanko
Dec 8 '18 at 18:45
|
show 8 more comments
2
$begingroup$
pigeonhole desn't work directly there
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:15
3
$begingroup$
@jmoravitz could you show me how to apply it, please?
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:27
1
$begingroup$
Have you tried to see what happens when you start with fewer numbers - four or five say?
$endgroup$
– Mark Bennet
Dec 8 '18 at 16:31
1
$begingroup$
The question is quite similar to this one, although $66$ falls within their bound.
$endgroup$
– Jam
Dec 8 '18 at 18:34
1
$begingroup$
@Jam we can add the number we didn't took, say between $1,12$ and so we don't change the sum of differences.
$endgroup$
– Yanko
Dec 8 '18 at 18:45
2
2
$begingroup$
pigeonhole desn't work directly there
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:15
$begingroup$
pigeonhole desn't work directly there
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:15
3
3
$begingroup$
@jmoravitz could you show me how to apply it, please?
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:27
$begingroup$
@jmoravitz could you show me how to apply it, please?
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:27
1
1
$begingroup$
Have you tried to see what happens when you start with fewer numbers - four or five say?
$endgroup$
– Mark Bennet
Dec 8 '18 at 16:31
$begingroup$
Have you tried to see what happens when you start with fewer numbers - four or five say?
$endgroup$
– Mark Bennet
Dec 8 '18 at 16:31
1
1
$begingroup$
The question is quite similar to this one, although $66$ falls within their bound.
$endgroup$
– Jam
Dec 8 '18 at 18:34
$begingroup$
The question is quite similar to this one, although $66$ falls within their bound.
$endgroup$
– Jam
Dec 8 '18 at 18:34
1
1
$begingroup$
@Jam we can add the number we didn't took, say between $1,12$ and so we don't change the sum of differences.
$endgroup$
– Yanko
Dec 8 '18 at 18:45
$begingroup$
@Jam we can add the number we didn't took, say between $1,12$ and so we don't change the sum of differences.
$endgroup$
– Yanko
Dec 8 '18 at 18:45
|
show 8 more comments
2 Answers
2
active
oldest
votes
$begingroup$
I haven't been able to do this by any reasonable method. I worked out that the sum of the numbers that are bigger than both their neighbors (considering the numbers as arranged on a circle) minus the sum of the numbers that are smaller than both their neighbors must be $33,$ but I wasn't able to turn that to account.
I started to do it by brute force, but I was afraid of making a mistake, so I wrote a simple-minded python script to do it. I figured it would take longer to write an intelligent script than it would to write and run the dumb one.
I also listed the elements that were larger than both of their neighbors and the elements smaller than both their neighbors. In all cases there were $5$ of each. I don't know what, if anything can be made of that.
There are $208$ solutions.
Here's the script
from itertools import permutations
N = 12
def uniqueDiffs(x):
y = x+(x[0],)
a = [abs(y[t]-y[(t+1)]) for t in range(N-1)]
return len(set(a))==N-1
def minors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] > y[i] < y[i+1]])
def majors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] < y[i] > y[i+1]])
good =
S= range(1,N+1)
start = (1,N)
S = set(range(2,N))
for x in S:
T=S.copy()
T.remove(x)
for p in permutations(T):
s = start + p
if uniqueDiffs(s):
good.append(s)
print(len(good), "solutions")
for g in good:
print(g, minors(g), majors(g))
Here's the first solution it printed
(1, 12, 2, 7, 8, 6, 9, 5, 11, 3, 10)
I don't imagine anyone wants to see the other $207.$
P.S.
I got to wondering what values other than $12$ work. The problem makes no sense for $N<4.$ I tested for $4le Nle13$ and found that there are solutions only for $N=4,5,8,9,12,13.$ Also, in all cases the number of elements larger than both their neighbors ("majors") is the same as the number of elements smaller than both their neighbors ("minors"), but this number is not necessarily the same in all solutions. For $N=13,$ there are solution with $5$ majors and $5$ minors, and also solutions with $6$ of each. It is of course, tempting to guess that the problem can be solved only when $Nequiv0pmod{4}$ or $Nequiv1pmod{4},$ but I have far too little data. I will have to write a more intelligent program before trying to test larger cases.
P.P.S
By considering the difference of the majors and the minrs it's easy to show that the problem is impossible when $Nequiv2pmod{4}$ or $Nequiv3pmod{4}$
$endgroup$
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
1
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
1
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
|
show 2 more comments
$begingroup$
@Saulspatz has shown an example but I've found a methodical approach to finding one that could be done by hand in a few minutes to give you an answer in a competition. It could also be easily computerised.
Start by laying out a grid with columns, $D=1,2,ldots11$, representing the particular differences you can have between successive elements in a circular permutation. Then lay out the rows, $B=12,11,ldots1$ and entries $A$, representing successive pairs of elements which would give you the particular $B-A=D$. Then do this again for another $B=12,11,ldots1$ but representing the successive pairs of elements that give you $B-A=-D$. It should look like the following figure.
I'll be highlighting chosen cells in yellow, and highlighting impossible cells in red. Now we can introduce the rules. We want one of each $D$, so each column needs exactly $1$ yellow. No $B$ can be followed by more than one $A$ (but must be followed by something) so exactly one yellow per row. No $A$ can follow more than one $B$ so once an $A$ is highlighted, all other equal $A$'s are removed from the grid. We are also only picking $11$ elements so we have to remove all $B$'s and $A$'s for a particular number (I've chosen $6$). Let's begin by removing all $B=6$ rows and $A=6$ cells.
Since there are multiple choices that thin out at the right, I'll be going for the topmost possible cell while moving left to right. We can then pick the cell $B=12,A=1$ such that $D=11$. This means we have to remove all other $B=12$'s, all $A=1$'s and all $D=11$'s. Hence:
We can continue with this approach and generate the sequences:
$$begin{aligned}(&12,1)\(2,&12,1)\(11,2,&12,1)\(3,11,2,&12,1)\(10,3,11,2,&12,1)\(4,10,3,11,2,&12,1)\(9,4,10,3,11,2,&12,1)end{aligned}$$
But now we run into a slight problem shown in the next figure. After we've chosen that $4$ follows $9$, we're left with the following chart. For $D=4$, if we pick $B=5$, $A=9$, we will have to remove $B=1$, $A=5$ since it is also $D=4$. In which case we will fail, since we will have no cell for $B=1$. Hence, we must pick $B=1$, $A=5$.
We can then proceed as normal and get the following chart. This gives us the sequence $(9,4,10,3,11,2,12,1,5,8,7)$, which proves the result.
$endgroup$
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
1
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
1
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3031290%2fis-there-an-11-element-circular-permutation-of-1-2-12-with-all-a-i%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
I haven't been able to do this by any reasonable method. I worked out that the sum of the numbers that are bigger than both their neighbors (considering the numbers as arranged on a circle) minus the sum of the numbers that are smaller than both their neighbors must be $33,$ but I wasn't able to turn that to account.
I started to do it by brute force, but I was afraid of making a mistake, so I wrote a simple-minded python script to do it. I figured it would take longer to write an intelligent script than it would to write and run the dumb one.
I also listed the elements that were larger than both of their neighbors and the elements smaller than both their neighbors. In all cases there were $5$ of each. I don't know what, if anything can be made of that.
There are $208$ solutions.
Here's the script
from itertools import permutations
N = 12
def uniqueDiffs(x):
y = x+(x[0],)
a = [abs(y[t]-y[(t+1)]) for t in range(N-1)]
return len(set(a))==N-1
def minors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] > y[i] < y[i+1]])
def majors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] < y[i] > y[i+1]])
good =
S= range(1,N+1)
start = (1,N)
S = set(range(2,N))
for x in S:
T=S.copy()
T.remove(x)
for p in permutations(T):
s = start + p
if uniqueDiffs(s):
good.append(s)
print(len(good), "solutions")
for g in good:
print(g, minors(g), majors(g))
Here's the first solution it printed
(1, 12, 2, 7, 8, 6, 9, 5, 11, 3, 10)
I don't imagine anyone wants to see the other $207.$
P.S.
I got to wondering what values other than $12$ work. The problem makes no sense for $N<4.$ I tested for $4le Nle13$ and found that there are solutions only for $N=4,5,8,9,12,13.$ Also, in all cases the number of elements larger than both their neighbors ("majors") is the same as the number of elements smaller than both their neighbors ("minors"), but this number is not necessarily the same in all solutions. For $N=13,$ there are solution with $5$ majors and $5$ minors, and also solutions with $6$ of each. It is of course, tempting to guess that the problem can be solved only when $Nequiv0pmod{4}$ or $Nequiv1pmod{4},$ but I have far too little data. I will have to write a more intelligent program before trying to test larger cases.
P.P.S
By considering the difference of the majors and the minrs it's easy to show that the problem is impossible when $Nequiv2pmod{4}$ or $Nequiv3pmod{4}$
$endgroup$
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
1
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
1
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
|
show 2 more comments
$begingroup$
I haven't been able to do this by any reasonable method. I worked out that the sum of the numbers that are bigger than both their neighbors (considering the numbers as arranged on a circle) minus the sum of the numbers that are smaller than both their neighbors must be $33,$ but I wasn't able to turn that to account.
I started to do it by brute force, but I was afraid of making a mistake, so I wrote a simple-minded python script to do it. I figured it would take longer to write an intelligent script than it would to write and run the dumb one.
I also listed the elements that were larger than both of their neighbors and the elements smaller than both their neighbors. In all cases there were $5$ of each. I don't know what, if anything can be made of that.
There are $208$ solutions.
Here's the script
from itertools import permutations
N = 12
def uniqueDiffs(x):
y = x+(x[0],)
a = [abs(y[t]-y[(t+1)]) for t in range(N-1)]
return len(set(a))==N-1
def minors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] > y[i] < y[i+1]])
def majors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] < y[i] > y[i+1]])
good =
S= range(1,N+1)
start = (1,N)
S = set(range(2,N))
for x in S:
T=S.copy()
T.remove(x)
for p in permutations(T):
s = start + p
if uniqueDiffs(s):
good.append(s)
print(len(good), "solutions")
for g in good:
print(g, minors(g), majors(g))
Here's the first solution it printed
(1, 12, 2, 7, 8, 6, 9, 5, 11, 3, 10)
I don't imagine anyone wants to see the other $207.$
P.S.
I got to wondering what values other than $12$ work. The problem makes no sense for $N<4.$ I tested for $4le Nle13$ and found that there are solutions only for $N=4,5,8,9,12,13.$ Also, in all cases the number of elements larger than both their neighbors ("majors") is the same as the number of elements smaller than both their neighbors ("minors"), but this number is not necessarily the same in all solutions. For $N=13,$ there are solution with $5$ majors and $5$ minors, and also solutions with $6$ of each. It is of course, tempting to guess that the problem can be solved only when $Nequiv0pmod{4}$ or $Nequiv1pmod{4},$ but I have far too little data. I will have to write a more intelligent program before trying to test larger cases.
P.P.S
By considering the difference of the majors and the minrs it's easy to show that the problem is impossible when $Nequiv2pmod{4}$ or $Nequiv3pmod{4}$
$endgroup$
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
1
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
1
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
|
show 2 more comments
$begingroup$
I haven't been able to do this by any reasonable method. I worked out that the sum of the numbers that are bigger than both their neighbors (considering the numbers as arranged on a circle) minus the sum of the numbers that are smaller than both their neighbors must be $33,$ but I wasn't able to turn that to account.
I started to do it by brute force, but I was afraid of making a mistake, so I wrote a simple-minded python script to do it. I figured it would take longer to write an intelligent script than it would to write and run the dumb one.
I also listed the elements that were larger than both of their neighbors and the elements smaller than both their neighbors. In all cases there were $5$ of each. I don't know what, if anything can be made of that.
There are $208$ solutions.
Here's the script
from itertools import permutations
N = 12
def uniqueDiffs(x):
y = x+(x[0],)
a = [abs(y[t]-y[(t+1)]) for t in range(N-1)]
return len(set(a))==N-1
def minors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] > y[i] < y[i+1]])
def majors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] < y[i] > y[i+1]])
good =
S= range(1,N+1)
start = (1,N)
S = set(range(2,N))
for x in S:
T=S.copy()
T.remove(x)
for p in permutations(T):
s = start + p
if uniqueDiffs(s):
good.append(s)
print(len(good), "solutions")
for g in good:
print(g, minors(g), majors(g))
Here's the first solution it printed
(1, 12, 2, 7, 8, 6, 9, 5, 11, 3, 10)
I don't imagine anyone wants to see the other $207.$
P.S.
I got to wondering what values other than $12$ work. The problem makes no sense for $N<4.$ I tested for $4le Nle13$ and found that there are solutions only for $N=4,5,8,9,12,13.$ Also, in all cases the number of elements larger than both their neighbors ("majors") is the same as the number of elements smaller than both their neighbors ("minors"), but this number is not necessarily the same in all solutions. For $N=13,$ there are solution with $5$ majors and $5$ minors, and also solutions with $6$ of each. It is of course, tempting to guess that the problem can be solved only when $Nequiv0pmod{4}$ or $Nequiv1pmod{4},$ but I have far too little data. I will have to write a more intelligent program before trying to test larger cases.
P.P.S
By considering the difference of the majors and the minrs it's easy to show that the problem is impossible when $Nequiv2pmod{4}$ or $Nequiv3pmod{4}$
$endgroup$
I haven't been able to do this by any reasonable method. I worked out that the sum of the numbers that are bigger than both their neighbors (considering the numbers as arranged on a circle) minus the sum of the numbers that are smaller than both their neighbors must be $33,$ but I wasn't able to turn that to account.
I started to do it by brute force, but I was afraid of making a mistake, so I wrote a simple-minded python script to do it. I figured it would take longer to write an intelligent script than it would to write and run the dumb one.
I also listed the elements that were larger than both of their neighbors and the elements smaller than both their neighbors. In all cases there were $5$ of each. I don't know what, if anything can be made of that.
There are $208$ solutions.
Here's the script
from itertools import permutations
N = 12
def uniqueDiffs(x):
y = x+(x[0],)
a = [abs(y[t]-y[(t+1)]) for t in range(N-1)]
return len(set(a))==N-1
def minors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] > y[i] < y[i+1]])
def majors(x):
y = (x[-1],) + x + (x[0],)
return sorted([y[i] for i in range(1,N) if y[i-1] < y[i] > y[i+1]])
good =
S= range(1,N+1)
start = (1,N)
S = set(range(2,N))
for x in S:
T=S.copy()
T.remove(x)
for p in permutations(T):
s = start + p
if uniqueDiffs(s):
good.append(s)
print(len(good), "solutions")
for g in good:
print(g, minors(g), majors(g))
Here's the first solution it printed
(1, 12, 2, 7, 8, 6, 9, 5, 11, 3, 10)
I don't imagine anyone wants to see the other $207.$
P.S.
I got to wondering what values other than $12$ work. The problem makes no sense for $N<4.$ I tested for $4le Nle13$ and found that there are solutions only for $N=4,5,8,9,12,13.$ Also, in all cases the number of elements larger than both their neighbors ("majors") is the same as the number of elements smaller than both their neighbors ("minors"), but this number is not necessarily the same in all solutions. For $N=13,$ there are solution with $5$ majors and $5$ minors, and also solutions with $6$ of each. It is of course, tempting to guess that the problem can be solved only when $Nequiv0pmod{4}$ or $Nequiv1pmod{4},$ but I have far too little data. I will have to write a more intelligent program before trying to test larger cases.
P.P.S
By considering the difference of the majors and the minrs it's easy to show that the problem is impossible when $Nequiv2pmod{4}$ or $Nequiv3pmod{4}$
edited Dec 9 '18 at 14:27
answered Dec 8 '18 at 20:12
saulspatzsaulspatz
14.2k21329
14.2k21329
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
1
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
1
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
|
show 2 more comments
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
1
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
1
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
$begingroup$
The expected number of elements in an $n$-element circular permutation greater than both their neighbours is shown to be $n/3$ in this question.
$endgroup$
– Jam
Dec 8 '18 at 20:16
1
1
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
The answer is yes?! 4 hours have been wasted.
$endgroup$
– Yanko
Dec 8 '18 at 20:22
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz Good answer. I wasn't expecting there to be an example and my python script wasn't optimised at all so it kept overflowing.
$endgroup$
– Jam
Dec 8 '18 at 20:23
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
$begingroup$
@saulspatz In my answer below, I've come up with a method that could possibly be adapted to give a faster program.
$endgroup$
– Jam
Dec 8 '18 at 22:01
1
1
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
$begingroup$
@Jam When we add up all the differences, we have $1+cdots+11=66$ In computing this sum, the majors are added twice, and the minors are subtracted twice. Any number that is neither a major nor a minor is added once and subtracted once.
$endgroup$
– saulspatz
Dec 15 '18 at 20:27
|
show 2 more comments
$begingroup$
@Saulspatz has shown an example but I've found a methodical approach to finding one that could be done by hand in a few minutes to give you an answer in a competition. It could also be easily computerised.
Start by laying out a grid with columns, $D=1,2,ldots11$, representing the particular differences you can have between successive elements in a circular permutation. Then lay out the rows, $B=12,11,ldots1$ and entries $A$, representing successive pairs of elements which would give you the particular $B-A=D$. Then do this again for another $B=12,11,ldots1$ but representing the successive pairs of elements that give you $B-A=-D$. It should look like the following figure.
I'll be highlighting chosen cells in yellow, and highlighting impossible cells in red. Now we can introduce the rules. We want one of each $D$, so each column needs exactly $1$ yellow. No $B$ can be followed by more than one $A$ (but must be followed by something) so exactly one yellow per row. No $A$ can follow more than one $B$ so once an $A$ is highlighted, all other equal $A$'s are removed from the grid. We are also only picking $11$ elements so we have to remove all $B$'s and $A$'s for a particular number (I've chosen $6$). Let's begin by removing all $B=6$ rows and $A=6$ cells.
Since there are multiple choices that thin out at the right, I'll be going for the topmost possible cell while moving left to right. We can then pick the cell $B=12,A=1$ such that $D=11$. This means we have to remove all other $B=12$'s, all $A=1$'s and all $D=11$'s. Hence:
We can continue with this approach and generate the sequences:
$$begin{aligned}(&12,1)\(2,&12,1)\(11,2,&12,1)\(3,11,2,&12,1)\(10,3,11,2,&12,1)\(4,10,3,11,2,&12,1)\(9,4,10,3,11,2,&12,1)end{aligned}$$
But now we run into a slight problem shown in the next figure. After we've chosen that $4$ follows $9$, we're left with the following chart. For $D=4$, if we pick $B=5$, $A=9$, we will have to remove $B=1$, $A=5$ since it is also $D=4$. In which case we will fail, since we will have no cell for $B=1$. Hence, we must pick $B=1$, $A=5$.
We can then proceed as normal and get the following chart. This gives us the sequence $(9,4,10,3,11,2,12,1,5,8,7)$, which proves the result.
$endgroup$
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
1
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
1
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
add a comment |
$begingroup$
@Saulspatz has shown an example but I've found a methodical approach to finding one that could be done by hand in a few minutes to give you an answer in a competition. It could also be easily computerised.
Start by laying out a grid with columns, $D=1,2,ldots11$, representing the particular differences you can have between successive elements in a circular permutation. Then lay out the rows, $B=12,11,ldots1$ and entries $A$, representing successive pairs of elements which would give you the particular $B-A=D$. Then do this again for another $B=12,11,ldots1$ but representing the successive pairs of elements that give you $B-A=-D$. It should look like the following figure.
I'll be highlighting chosen cells in yellow, and highlighting impossible cells in red. Now we can introduce the rules. We want one of each $D$, so each column needs exactly $1$ yellow. No $B$ can be followed by more than one $A$ (but must be followed by something) so exactly one yellow per row. No $A$ can follow more than one $B$ so once an $A$ is highlighted, all other equal $A$'s are removed from the grid. We are also only picking $11$ elements so we have to remove all $B$'s and $A$'s for a particular number (I've chosen $6$). Let's begin by removing all $B=6$ rows and $A=6$ cells.
Since there are multiple choices that thin out at the right, I'll be going for the topmost possible cell while moving left to right. We can then pick the cell $B=12,A=1$ such that $D=11$. This means we have to remove all other $B=12$'s, all $A=1$'s and all $D=11$'s. Hence:
We can continue with this approach and generate the sequences:
$$begin{aligned}(&12,1)\(2,&12,1)\(11,2,&12,1)\(3,11,2,&12,1)\(10,3,11,2,&12,1)\(4,10,3,11,2,&12,1)\(9,4,10,3,11,2,&12,1)end{aligned}$$
But now we run into a slight problem shown in the next figure. After we've chosen that $4$ follows $9$, we're left with the following chart. For $D=4$, if we pick $B=5$, $A=9$, we will have to remove $B=1$, $A=5$ since it is also $D=4$. In which case we will fail, since we will have no cell for $B=1$. Hence, we must pick $B=1$, $A=5$.
We can then proceed as normal and get the following chart. This gives us the sequence $(9,4,10,3,11,2,12,1,5,8,7)$, which proves the result.
$endgroup$
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
1
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
1
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
add a comment |
$begingroup$
@Saulspatz has shown an example but I've found a methodical approach to finding one that could be done by hand in a few minutes to give you an answer in a competition. It could also be easily computerised.
Start by laying out a grid with columns, $D=1,2,ldots11$, representing the particular differences you can have between successive elements in a circular permutation. Then lay out the rows, $B=12,11,ldots1$ and entries $A$, representing successive pairs of elements which would give you the particular $B-A=D$. Then do this again for another $B=12,11,ldots1$ but representing the successive pairs of elements that give you $B-A=-D$. It should look like the following figure.
I'll be highlighting chosen cells in yellow, and highlighting impossible cells in red. Now we can introduce the rules. We want one of each $D$, so each column needs exactly $1$ yellow. No $B$ can be followed by more than one $A$ (but must be followed by something) so exactly one yellow per row. No $A$ can follow more than one $B$ so once an $A$ is highlighted, all other equal $A$'s are removed from the grid. We are also only picking $11$ elements so we have to remove all $B$'s and $A$'s for a particular number (I've chosen $6$). Let's begin by removing all $B=6$ rows and $A=6$ cells.
Since there are multiple choices that thin out at the right, I'll be going for the topmost possible cell while moving left to right. We can then pick the cell $B=12,A=1$ such that $D=11$. This means we have to remove all other $B=12$'s, all $A=1$'s and all $D=11$'s. Hence:
We can continue with this approach and generate the sequences:
$$begin{aligned}(&12,1)\(2,&12,1)\(11,2,&12,1)\(3,11,2,&12,1)\(10,3,11,2,&12,1)\(4,10,3,11,2,&12,1)\(9,4,10,3,11,2,&12,1)end{aligned}$$
But now we run into a slight problem shown in the next figure. After we've chosen that $4$ follows $9$, we're left with the following chart. For $D=4$, if we pick $B=5$, $A=9$, we will have to remove $B=1$, $A=5$ since it is also $D=4$. In which case we will fail, since we will have no cell for $B=1$. Hence, we must pick $B=1$, $A=5$.
We can then proceed as normal and get the following chart. This gives us the sequence $(9,4,10,3,11,2,12,1,5,8,7)$, which proves the result.
$endgroup$
@Saulspatz has shown an example but I've found a methodical approach to finding one that could be done by hand in a few minutes to give you an answer in a competition. It could also be easily computerised.
Start by laying out a grid with columns, $D=1,2,ldots11$, representing the particular differences you can have between successive elements in a circular permutation. Then lay out the rows, $B=12,11,ldots1$ and entries $A$, representing successive pairs of elements which would give you the particular $B-A=D$. Then do this again for another $B=12,11,ldots1$ but representing the successive pairs of elements that give you $B-A=-D$. It should look like the following figure.
I'll be highlighting chosen cells in yellow, and highlighting impossible cells in red. Now we can introduce the rules. We want one of each $D$, so each column needs exactly $1$ yellow. No $B$ can be followed by more than one $A$ (but must be followed by something) so exactly one yellow per row. No $A$ can follow more than one $B$ so once an $A$ is highlighted, all other equal $A$'s are removed from the grid. We are also only picking $11$ elements so we have to remove all $B$'s and $A$'s for a particular number (I've chosen $6$). Let's begin by removing all $B=6$ rows and $A=6$ cells.
Since there are multiple choices that thin out at the right, I'll be going for the topmost possible cell while moving left to right. We can then pick the cell $B=12,A=1$ such that $D=11$. This means we have to remove all other $B=12$'s, all $A=1$'s and all $D=11$'s. Hence:
We can continue with this approach and generate the sequences:
$$begin{aligned}(&12,1)\(2,&12,1)\(11,2,&12,1)\(3,11,2,&12,1)\(10,3,11,2,&12,1)\(4,10,3,11,2,&12,1)\(9,4,10,3,11,2,&12,1)end{aligned}$$
But now we run into a slight problem shown in the next figure. After we've chosen that $4$ follows $9$, we're left with the following chart. For $D=4$, if we pick $B=5$, $A=9$, we will have to remove $B=1$, $A=5$ since it is also $D=4$. In which case we will fail, since we will have no cell for $B=1$. Hence, we must pick $B=1$, $A=5$.
We can then proceed as normal and get the following chart. This gives us the sequence $(9,4,10,3,11,2,12,1,5,8,7)$, which proves the result.
edited Dec 10 '18 at 17:39
answered Dec 8 '18 at 21:54
JamJam
4,95021431
4,95021431
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
1
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
1
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
add a comment |
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
1
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
1
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
$begingroup$
In retrospect, it's a bit neater if the rows and columns are $B,A$ and the entries are $D$. In terms of making this into a code, you could try making a list of the cells, $(B,A,D)$, then systematically going through the decision tree of possible cells you can select and recording whether you end up with a valid list. I haven't yet found out how to write this. I think it should be fairly fast but would probably use a fair amount of memory since it needs to go back on itself in the decision tree.
$endgroup$
– Jam
Dec 9 '18 at 0:01
1
1
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
This could be coded as a backtrack program. Rather than picking the number to exclude at the start, I would just stop once we've picked $n-1$ numbers, provided of course, that it's a solution. Do you have any experience with backtracking?
$endgroup$
– saulspatz
Dec 10 '18 at 17:32
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
$begingroup$
@saulspatz I don't - my programming knowledge is quite limited. I tried to write a program to do it yesterday but wasn't yet able to get it working.
$endgroup$
– Jam
Dec 10 '18 at 17:37
1
1
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
$begingroup$
Here are some examples of backtracking. When I get a chance, I'll write a python script and post it.
$endgroup$
– saulspatz
Dec 10 '18 at 17:41
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3031290%2fis-there-an-11-element-circular-permutation-of-1-2-12-with-all-a-i%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
pigeonhole desn't work directly there
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:15
3
$begingroup$
@jmoravitz could you show me how to apply it, please?
$endgroup$
– Anuar Kuanysh
Dec 8 '18 at 16:27
1
$begingroup$
Have you tried to see what happens when you start with fewer numbers - four or five say?
$endgroup$
– Mark Bennet
Dec 8 '18 at 16:31
1
$begingroup$
The question is quite similar to this one, although $66$ falls within their bound.
$endgroup$
– Jam
Dec 8 '18 at 18:34
1
$begingroup$
@Jam we can add the number we didn't took, say between $1,12$ and so we don't change the sum of differences.
$endgroup$
– Yanko
Dec 8 '18 at 18:45