Minimum distance between sequence a and all permutations of another sequence b
Let $a$ and $b$ be finite sequences of length $n$, i.e. $a=(a_1,a_2,...,a_n), b=(b_1,b_2,...,b_n)$. I want to calculate the minimum of the distances (in an Lp norm) between $a$ and all permutations of $b$. Let $Pi_n$ be the space of all permutations of $n$ numbers, then I am looking for
$d = text{min}_{piinPi_n} ||a - (b_{pi(1)},b_{pi(2)},...,b_{pi(n)})||_p$
Is there an efficient method or optimization algorithm (something better than trying out all $n!$ permutations of b) to calculate $d$ and find the corresponding permutation $pi$?
linear-algebra combinatorics optimization combinations discrete-optimization
add a comment |
Let $a$ and $b$ be finite sequences of length $n$, i.e. $a=(a_1,a_2,...,a_n), b=(b_1,b_2,...,b_n)$. I want to calculate the minimum of the distances (in an Lp norm) between $a$ and all permutations of $b$. Let $Pi_n$ be the space of all permutations of $n$ numbers, then I am looking for
$d = text{min}_{piinPi_n} ||a - (b_{pi(1)},b_{pi(2)},...,b_{pi(n)})||_p$
Is there an efficient method or optimization algorithm (something better than trying out all $n!$ permutations of b) to calculate $d$ and find the corresponding permutation $pi$?
linear-algebra combinatorics optimization combinations discrete-optimization
4
You might find this question helpful! stackoverflow.com/questions/54041397/…
– Calvin Godfrey
yesterday
Calvin's linked post answers your question for $p=2$. I suspect that for any $L_p$ norm, the answer will be the same.
– Omnomnomnom
yesterday
1
@Omnomnomnom I strongly doubt that. They are clearly not identical for the $L_infty$ norm.
– LinAlg
yesterday
1
@LinAlg I don't think I see what you mean. Is there an example of a list $b$ sorted in ascending order, and a list $a$ such that you can do better than putting $a$ in ascending order?
– Omnomnomnom
yesterday
thanks - and it's funny that the same question got asked (almost) at the same time!
– appletree
15 hours ago
add a comment |
Let $a$ and $b$ be finite sequences of length $n$, i.e. $a=(a_1,a_2,...,a_n), b=(b_1,b_2,...,b_n)$. I want to calculate the minimum of the distances (in an Lp norm) between $a$ and all permutations of $b$. Let $Pi_n$ be the space of all permutations of $n$ numbers, then I am looking for
$d = text{min}_{piinPi_n} ||a - (b_{pi(1)},b_{pi(2)},...,b_{pi(n)})||_p$
Is there an efficient method or optimization algorithm (something better than trying out all $n!$ permutations of b) to calculate $d$ and find the corresponding permutation $pi$?
linear-algebra combinatorics optimization combinations discrete-optimization
Let $a$ and $b$ be finite sequences of length $n$, i.e. $a=(a_1,a_2,...,a_n), b=(b_1,b_2,...,b_n)$. I want to calculate the minimum of the distances (in an Lp norm) between $a$ and all permutations of $b$. Let $Pi_n$ be the space of all permutations of $n$ numbers, then I am looking for
$d = text{min}_{piinPi_n} ||a - (b_{pi(1)},b_{pi(2)},...,b_{pi(n)})||_p$
Is there an efficient method or optimization algorithm (something better than trying out all $n!$ permutations of b) to calculate $d$ and find the corresponding permutation $pi$?
linear-algebra combinatorics optimization combinations discrete-optimization
linear-algebra combinatorics optimization combinations discrete-optimization
asked yesterday
appletree
262
262
4
You might find this question helpful! stackoverflow.com/questions/54041397/…
– Calvin Godfrey
yesterday
Calvin's linked post answers your question for $p=2$. I suspect that for any $L_p$ norm, the answer will be the same.
– Omnomnomnom
yesterday
1
@Omnomnomnom I strongly doubt that. They are clearly not identical for the $L_infty$ norm.
– LinAlg
yesterday
1
@LinAlg I don't think I see what you mean. Is there an example of a list $b$ sorted in ascending order, and a list $a$ such that you can do better than putting $a$ in ascending order?
– Omnomnomnom
yesterday
thanks - and it's funny that the same question got asked (almost) at the same time!
– appletree
15 hours ago
add a comment |
4
You might find this question helpful! stackoverflow.com/questions/54041397/…
– Calvin Godfrey
yesterday
Calvin's linked post answers your question for $p=2$. I suspect that for any $L_p$ norm, the answer will be the same.
– Omnomnomnom
yesterday
1
@Omnomnomnom I strongly doubt that. They are clearly not identical for the $L_infty$ norm.
– LinAlg
yesterday
1
@LinAlg I don't think I see what you mean. Is there an example of a list $b$ sorted in ascending order, and a list $a$ such that you can do better than putting $a$ in ascending order?
– Omnomnomnom
yesterday
thanks - and it's funny that the same question got asked (almost) at the same time!
– appletree
15 hours ago
4
4
You might find this question helpful! stackoverflow.com/questions/54041397/…
– Calvin Godfrey
yesterday
You might find this question helpful! stackoverflow.com/questions/54041397/…
– Calvin Godfrey
yesterday
Calvin's linked post answers your question for $p=2$. I suspect that for any $L_p$ norm, the answer will be the same.
– Omnomnomnom
yesterday
Calvin's linked post answers your question for $p=2$. I suspect that for any $L_p$ norm, the answer will be the same.
– Omnomnomnom
yesterday
1
1
@Omnomnomnom I strongly doubt that. They are clearly not identical for the $L_infty$ norm.
– LinAlg
yesterday
@Omnomnomnom I strongly doubt that. They are clearly not identical for the $L_infty$ norm.
– LinAlg
yesterday
1
1
@LinAlg I don't think I see what you mean. Is there an example of a list $b$ sorted in ascending order, and a list $a$ such that you can do better than putting $a$ in ascending order?
– Omnomnomnom
yesterday
@LinAlg I don't think I see what you mean. Is there an example of a list $b$ sorted in ascending order, and a list $a$ such that you can do better than putting $a$ in ascending order?
– Omnomnomnom
yesterday
thanks - and it's funny that the same question got asked (almost) at the same time!
– appletree
15 hours ago
thanks - and it's funny that the same question got asked (almost) at the same time!
– appletree
15 hours ago
add a comment |
2 Answers
2
active
oldest
votes
If $pge 1$, then the minimum is attained by rearranging $b$ so that it is "order isomorphic" to $a$, meaning that $b_i-b_j$ has the same sign as $a_i-a_j$ for all $i,j$. To see this, suppose that $a_i<a_j$ and $b_i<b_j$. Using the convexity of the function $f(x)=|x|^p$, you can show that
$$
|a_i-b_i|^p+|a_j-b_j|^ple |a_i-b_j|^p+|a_j-b_i|^p
$$
Therefore, if $a_i$ is matched with $b_j$ and $a_j$ with $b_i$, it is more efficient to swap $b_i$ and $b_j$. This means if $b$ is optimal, it must have no such out-of-order matching.
When $p<1$, the function $|x^p|$ is no longer convex, so the same local swapping rule does not always hold. In fact, it is sometimes reversed. Here are some observations:
If $a_1<a_2<b_1<b_2$, then it is more efficient to match $a_1$ with $b_2$ and $a_2$ with $b_1$ (this is the opposite of the $pge 1$ case).
If $a_1<b_1<b_2<a_2$, then it is more efficient to match $a_1$ with $b_1$ and $a_2 $ with $b_2$ (this is the same as the $pge 1$ case).
If $a_1<b_1<a_2<b_2$, then the optimal matching depends on the values of $a_1,a_2,b_1$ and $b_2$. For example, when $a_2-b_1$ is very small, it is optimal to pair $a_1$ with $b_2$, but as $a_2-b_1$ increases to $infty$ while $b_1-a_1$ and $b_2-a_2$ remain constant, then eventually the opposite matching is better.
I am not sure if these observations translate into an algorithm.
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
add a comment |
An attempt to prove the inequality from Mike's answer. Feel free to correct this proof or fill in any gaps; I suspect that it's flawed.
Claim: if $a_1<a_2$ and $b_1<b_2$ are positive reals and $f$ is a non-negative, increasing, convex function over $[0,infty)$, then
$$
f(|a_1 - b_1|) + f(|a_2 - b_2|) leq f(|a_1 - b_2|) + f(|a_2 - b_1|)
$$
Proof: We note that $g(x) = f(|x|)$ is convex over $Bbb R$. So, for any $k>0$ and $a,b in Bbb R$, we have
$$
f(a - k) + f(b+k) geq f(a) + f(b)
$$
(This step seems shaky. I think this holds if $aleq b$ but not in general, which means that perhaps the rest of the proof needs to be broken into several cases)
It follows that
$$
f(|a_1 - b_2|) + f(|a_2 - b_1|) = \
f(|(a_1 - b_1) - (b_2 - b_1)|) + f(|(a_2 - b_2) + (b_2 - b_1)|) =\
g((a_1 - b_1) - (b_2 - b_1)) + g((a_2 - b_2) + (b_2 - b_1)) geq\
g(a_1 - b_1) + g(a_2 - b_2) = \
f(|a_1 - b_1|) + f(|a_2 - b_2|)
$$
as desired.
1
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
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%2f3062029%2fminimum-distance-between-sequence-a-and-all-permutations-of-another-sequence-b%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
If $pge 1$, then the minimum is attained by rearranging $b$ so that it is "order isomorphic" to $a$, meaning that $b_i-b_j$ has the same sign as $a_i-a_j$ for all $i,j$. To see this, suppose that $a_i<a_j$ and $b_i<b_j$. Using the convexity of the function $f(x)=|x|^p$, you can show that
$$
|a_i-b_i|^p+|a_j-b_j|^ple |a_i-b_j|^p+|a_j-b_i|^p
$$
Therefore, if $a_i$ is matched with $b_j$ and $a_j$ with $b_i$, it is more efficient to swap $b_i$ and $b_j$. This means if $b$ is optimal, it must have no such out-of-order matching.
When $p<1$, the function $|x^p|$ is no longer convex, so the same local swapping rule does not always hold. In fact, it is sometimes reversed. Here are some observations:
If $a_1<a_2<b_1<b_2$, then it is more efficient to match $a_1$ with $b_2$ and $a_2$ with $b_1$ (this is the opposite of the $pge 1$ case).
If $a_1<b_1<b_2<a_2$, then it is more efficient to match $a_1$ with $b_1$ and $a_2 $ with $b_2$ (this is the same as the $pge 1$ case).
If $a_1<b_1<a_2<b_2$, then the optimal matching depends on the values of $a_1,a_2,b_1$ and $b_2$. For example, when $a_2-b_1$ is very small, it is optimal to pair $a_1$ with $b_2$, but as $a_2-b_1$ increases to $infty$ while $b_1-a_1$ and $b_2-a_2$ remain constant, then eventually the opposite matching is better.
I am not sure if these observations translate into an algorithm.
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
add a comment |
If $pge 1$, then the minimum is attained by rearranging $b$ so that it is "order isomorphic" to $a$, meaning that $b_i-b_j$ has the same sign as $a_i-a_j$ for all $i,j$. To see this, suppose that $a_i<a_j$ and $b_i<b_j$. Using the convexity of the function $f(x)=|x|^p$, you can show that
$$
|a_i-b_i|^p+|a_j-b_j|^ple |a_i-b_j|^p+|a_j-b_i|^p
$$
Therefore, if $a_i$ is matched with $b_j$ and $a_j$ with $b_i$, it is more efficient to swap $b_i$ and $b_j$. This means if $b$ is optimal, it must have no such out-of-order matching.
When $p<1$, the function $|x^p|$ is no longer convex, so the same local swapping rule does not always hold. In fact, it is sometimes reversed. Here are some observations:
If $a_1<a_2<b_1<b_2$, then it is more efficient to match $a_1$ with $b_2$ and $a_2$ with $b_1$ (this is the opposite of the $pge 1$ case).
If $a_1<b_1<b_2<a_2$, then it is more efficient to match $a_1$ with $b_1$ and $a_2 $ with $b_2$ (this is the same as the $pge 1$ case).
If $a_1<b_1<a_2<b_2$, then the optimal matching depends on the values of $a_1,a_2,b_1$ and $b_2$. For example, when $a_2-b_1$ is very small, it is optimal to pair $a_1$ with $b_2$, but as $a_2-b_1$ increases to $infty$ while $b_1-a_1$ and $b_2-a_2$ remain constant, then eventually the opposite matching is better.
I am not sure if these observations translate into an algorithm.
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
add a comment |
If $pge 1$, then the minimum is attained by rearranging $b$ so that it is "order isomorphic" to $a$, meaning that $b_i-b_j$ has the same sign as $a_i-a_j$ for all $i,j$. To see this, suppose that $a_i<a_j$ and $b_i<b_j$. Using the convexity of the function $f(x)=|x|^p$, you can show that
$$
|a_i-b_i|^p+|a_j-b_j|^ple |a_i-b_j|^p+|a_j-b_i|^p
$$
Therefore, if $a_i$ is matched with $b_j$ and $a_j$ with $b_i$, it is more efficient to swap $b_i$ and $b_j$. This means if $b$ is optimal, it must have no such out-of-order matching.
When $p<1$, the function $|x^p|$ is no longer convex, so the same local swapping rule does not always hold. In fact, it is sometimes reversed. Here are some observations:
If $a_1<a_2<b_1<b_2$, then it is more efficient to match $a_1$ with $b_2$ and $a_2$ with $b_1$ (this is the opposite of the $pge 1$ case).
If $a_1<b_1<b_2<a_2$, then it is more efficient to match $a_1$ with $b_1$ and $a_2 $ with $b_2$ (this is the same as the $pge 1$ case).
If $a_1<b_1<a_2<b_2$, then the optimal matching depends on the values of $a_1,a_2,b_1$ and $b_2$. For example, when $a_2-b_1$ is very small, it is optimal to pair $a_1$ with $b_2$, but as $a_2-b_1$ increases to $infty$ while $b_1-a_1$ and $b_2-a_2$ remain constant, then eventually the opposite matching is better.
I am not sure if these observations translate into an algorithm.
If $pge 1$, then the minimum is attained by rearranging $b$ so that it is "order isomorphic" to $a$, meaning that $b_i-b_j$ has the same sign as $a_i-a_j$ for all $i,j$. To see this, suppose that $a_i<a_j$ and $b_i<b_j$. Using the convexity of the function $f(x)=|x|^p$, you can show that
$$
|a_i-b_i|^p+|a_j-b_j|^ple |a_i-b_j|^p+|a_j-b_i|^p
$$
Therefore, if $a_i$ is matched with $b_j$ and $a_j$ with $b_i$, it is more efficient to swap $b_i$ and $b_j$. This means if $b$ is optimal, it must have no such out-of-order matching.
When $p<1$, the function $|x^p|$ is no longer convex, so the same local swapping rule does not always hold. In fact, it is sometimes reversed. Here are some observations:
If $a_1<a_2<b_1<b_2$, then it is more efficient to match $a_1$ with $b_2$ and $a_2$ with $b_1$ (this is the opposite of the $pge 1$ case).
If $a_1<b_1<b_2<a_2$, then it is more efficient to match $a_1$ with $b_1$ and $a_2 $ with $b_2$ (this is the same as the $pge 1$ case).
If $a_1<b_1<a_2<b_2$, then the optimal matching depends on the values of $a_1,a_2,b_1$ and $b_2$. For example, when $a_2-b_1$ is very small, it is optimal to pair $a_1$ with $b_2$, but as $a_2-b_1$ increases to $infty$ while $b_1-a_1$ and $b_2-a_2$ remain constant, then eventually the opposite matching is better.
I am not sure if these observations translate into an algorithm.
answered 10 hours ago
Mike Earnest
20.5k11950
20.5k11950
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
add a comment |
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
These observations translate into the same algorithm given on the linked page for $p=2$ (from Ivo's answer)
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
That is, the algorithm works for $p in [1,infty]$
– Omnomnomnom
7 hours ago
add a comment |
An attempt to prove the inequality from Mike's answer. Feel free to correct this proof or fill in any gaps; I suspect that it's flawed.
Claim: if $a_1<a_2$ and $b_1<b_2$ are positive reals and $f$ is a non-negative, increasing, convex function over $[0,infty)$, then
$$
f(|a_1 - b_1|) + f(|a_2 - b_2|) leq f(|a_1 - b_2|) + f(|a_2 - b_1|)
$$
Proof: We note that $g(x) = f(|x|)$ is convex over $Bbb R$. So, for any $k>0$ and $a,b in Bbb R$, we have
$$
f(a - k) + f(b+k) geq f(a) + f(b)
$$
(This step seems shaky. I think this holds if $aleq b$ but not in general, which means that perhaps the rest of the proof needs to be broken into several cases)
It follows that
$$
f(|a_1 - b_2|) + f(|a_2 - b_1|) = \
f(|(a_1 - b_1) - (b_2 - b_1)|) + f(|(a_2 - b_2) + (b_2 - b_1)|) =\
g((a_1 - b_1) - (b_2 - b_1)) + g((a_2 - b_2) + (b_2 - b_1)) geq\
g(a_1 - b_1) + g(a_2 - b_2) = \
f(|a_1 - b_1|) + f(|a_2 - b_2|)
$$
as desired.
1
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
add a comment |
An attempt to prove the inequality from Mike's answer. Feel free to correct this proof or fill in any gaps; I suspect that it's flawed.
Claim: if $a_1<a_2$ and $b_1<b_2$ are positive reals and $f$ is a non-negative, increasing, convex function over $[0,infty)$, then
$$
f(|a_1 - b_1|) + f(|a_2 - b_2|) leq f(|a_1 - b_2|) + f(|a_2 - b_1|)
$$
Proof: We note that $g(x) = f(|x|)$ is convex over $Bbb R$. So, for any $k>0$ and $a,b in Bbb R$, we have
$$
f(a - k) + f(b+k) geq f(a) + f(b)
$$
(This step seems shaky. I think this holds if $aleq b$ but not in general, which means that perhaps the rest of the proof needs to be broken into several cases)
It follows that
$$
f(|a_1 - b_2|) + f(|a_2 - b_1|) = \
f(|(a_1 - b_1) - (b_2 - b_1)|) + f(|(a_2 - b_2) + (b_2 - b_1)|) =\
g((a_1 - b_1) - (b_2 - b_1)) + g((a_2 - b_2) + (b_2 - b_1)) geq\
g(a_1 - b_1) + g(a_2 - b_2) = \
f(|a_1 - b_1|) + f(|a_2 - b_2|)
$$
as desired.
1
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
add a comment |
An attempt to prove the inequality from Mike's answer. Feel free to correct this proof or fill in any gaps; I suspect that it's flawed.
Claim: if $a_1<a_2$ and $b_1<b_2$ are positive reals and $f$ is a non-negative, increasing, convex function over $[0,infty)$, then
$$
f(|a_1 - b_1|) + f(|a_2 - b_2|) leq f(|a_1 - b_2|) + f(|a_2 - b_1|)
$$
Proof: We note that $g(x) = f(|x|)$ is convex over $Bbb R$. So, for any $k>0$ and $a,b in Bbb R$, we have
$$
f(a - k) + f(b+k) geq f(a) + f(b)
$$
(This step seems shaky. I think this holds if $aleq b$ but not in general, which means that perhaps the rest of the proof needs to be broken into several cases)
It follows that
$$
f(|a_1 - b_2|) + f(|a_2 - b_1|) = \
f(|(a_1 - b_1) - (b_2 - b_1)|) + f(|(a_2 - b_2) + (b_2 - b_1)|) =\
g((a_1 - b_1) - (b_2 - b_1)) + g((a_2 - b_2) + (b_2 - b_1)) geq\
g(a_1 - b_1) + g(a_2 - b_2) = \
f(|a_1 - b_1|) + f(|a_2 - b_2|)
$$
as desired.
An attempt to prove the inequality from Mike's answer. Feel free to correct this proof or fill in any gaps; I suspect that it's flawed.
Claim: if $a_1<a_2$ and $b_1<b_2$ are positive reals and $f$ is a non-negative, increasing, convex function over $[0,infty)$, then
$$
f(|a_1 - b_1|) + f(|a_2 - b_2|) leq f(|a_1 - b_2|) + f(|a_2 - b_1|)
$$
Proof: We note that $g(x) = f(|x|)$ is convex over $Bbb R$. So, for any $k>0$ and $a,b in Bbb R$, we have
$$
f(a - k) + f(b+k) geq f(a) + f(b)
$$
(This step seems shaky. I think this holds if $aleq b$ but not in general, which means that perhaps the rest of the proof needs to be broken into several cases)
It follows that
$$
f(|a_1 - b_2|) + f(|a_2 - b_1|) = \
f(|(a_1 - b_1) - (b_2 - b_1)|) + f(|(a_2 - b_2) + (b_2 - b_1)|) =\
g((a_1 - b_1) - (b_2 - b_1)) + g((a_2 - b_2) + (b_2 - b_1)) geq\
g(a_1 - b_1) + g(a_2 - b_2) = \
f(|a_1 - b_1|) + f(|a_2 - b_2|)
$$
as desired.
answered 7 hours ago
community wiki
Omnomnomnom
1
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
add a comment |
1
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
1
1
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
It holds for $a le b$ indeed (for $a>b$ the opposite holds). Proof: $exists tin(0,1): t(a-k) + (1-t) (b+k) = a$. Multiply by -1, add (a-k) and (b+k) then for the same $t$ we have $(1-t)(a-k) + t(b+k)=b$. Then due to convexity, $f(a)le tf(a-k) + (1-t) f(b+k)$ and $f(b)le (1-t) f(a-k) + t f(b+k)$. Summing both inequalities gives your inequality.
– appletree
4 hours ago
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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%2f3062029%2fminimum-distance-between-sequence-a-and-all-permutations-of-another-sequence-b%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
4
You might find this question helpful! stackoverflow.com/questions/54041397/…
– Calvin Godfrey
yesterday
Calvin's linked post answers your question for $p=2$. I suspect that for any $L_p$ norm, the answer will be the same.
– Omnomnomnom
yesterday
1
@Omnomnomnom I strongly doubt that. They are clearly not identical for the $L_infty$ norm.
– LinAlg
yesterday
1
@LinAlg I don't think I see what you mean. Is there an example of a list $b$ sorted in ascending order, and a list $a$ such that you can do better than putting $a$ in ascending order?
– Omnomnomnom
yesterday
thanks - and it's funny that the same question got asked (almost) at the same time!
– appletree
15 hours ago