Show that given a set of positive n integers, there exists a non-empty subset whose sum is divisible by n












5












$begingroup$


This is the question I've run into: Show that given a set of positive n integers, there exists a non-empty subset whose sum is divisible by n



I'm having trouble understanding how they came to the conclusion



enter image description here



the part that I'm having trouble understanding is how subtracting the two subsets results in a sum that's divisible by n given that the two subsets have the same remainder










share|cite|improve this question









$endgroup$












  • $begingroup$
    If $xequiv y pmod n$ then $x-y equiv 0 pmod n$
    $endgroup$
    – steven gregory
    May 6 '18 at 3:27
















5












$begingroup$


This is the question I've run into: Show that given a set of positive n integers, there exists a non-empty subset whose sum is divisible by n



I'm having trouble understanding how they came to the conclusion



enter image description here



the part that I'm having trouble understanding is how subtracting the two subsets results in a sum that's divisible by n given that the two subsets have the same remainder










share|cite|improve this question









$endgroup$












  • $begingroup$
    If $xequiv y pmod n$ then $x-y equiv 0 pmod n$
    $endgroup$
    – steven gregory
    May 6 '18 at 3:27














5












5








5


2



$begingroup$


This is the question I've run into: Show that given a set of positive n integers, there exists a non-empty subset whose sum is divisible by n



I'm having trouble understanding how they came to the conclusion



enter image description here



the part that I'm having trouble understanding is how subtracting the two subsets results in a sum that's divisible by n given that the two subsets have the same remainder










share|cite|improve this question









$endgroup$




This is the question I've run into: Show that given a set of positive n integers, there exists a non-empty subset whose sum is divisible by n



I'm having trouble understanding how they came to the conclusion



enter image description here



the part that I'm having trouble understanding is how subtracting the two subsets results in a sum that's divisible by n given that the two subsets have the same remainder







pigeonhole-principle






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked May 6 '18 at 3:12









testinggnitset sertestinggnitset ser

465




465












  • $begingroup$
    If $xequiv y pmod n$ then $x-y equiv 0 pmod n$
    $endgroup$
    – steven gregory
    May 6 '18 at 3:27


















  • $begingroup$
    If $xequiv y pmod n$ then $x-y equiv 0 pmod n$
    $endgroup$
    – steven gregory
    May 6 '18 at 3:27
















$begingroup$
If $xequiv y pmod n$ then $x-y equiv 0 pmod n$
$endgroup$
– steven gregory
May 6 '18 at 3:27




$begingroup$
If $xequiv y pmod n$ then $x-y equiv 0 pmod n$
$endgroup$
– steven gregory
May 6 '18 at 3:27










2 Answers
2






active

oldest

votes


















4












$begingroup$

Via modular arithmetic this is very easy, and something you can check (if you're familiar with this). Otherwise, one can show the following result via the division algorithm (i.e. just straight division with quotient and remainder):




If $a$ and $b$ have the same remainder when divided by $n$, then $a-b$ is divisible by $n$.




The proof is as follows. Let $r$ be the common remainder of $a$ and $b$ when divided by $n$. The division algorithm gives integers $q,p$ such that $a=qn+r$ and $b=pn+r$. Thus, we get $$a-b=(qn+r)-(pn+r)=(qn-pn)+(r-r)=(q-p)n$$
so $n$ divides $a-b$.



Note that the above result is more general, and can be applied to your situation by having $a=S_j$ and $b=S_i$. It doesn't really matter that the $S_i$ and $S_j$ are sums of integers when applying the statement I just proved; as far as we care they are just some integers $a$ and $b$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    But this is $a-b$ not $a+b$
    $endgroup$
    – kelalaka
    Jan 3 at 16:41










  • $begingroup$
    @kelalaka yes, and this is what we want for this question. We want $a-b$.
    $endgroup$
    – Dave
    Jan 3 at 17:43










  • $begingroup$
    I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
    $endgroup$
    – kelalaka
    Jan 3 at 17:47












  • $begingroup$
    @kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
    $endgroup$
    – Dave
    Jan 3 at 17:52



















2












$begingroup$

Let $p<q$, if $S_p = sum_{i=1}^p s_i equiv r pmod{n}$



and $S_q = sum_{i=1}^q s_i equiv r pmod{n}$



then we have $S_q-S_p=sum_{i=p+1}^q s_i equiv r-r equiv 0 pmod{n}$



where we have use the property that if $a equiv b pmod{n}$ and $c equiv d pmod{n}$, then we have $a-c equiv b-d pmod{n}$



If you are not familiar with modulo arithmetic, view it as if $a = nk+r$ and $c = nt+r$, then $a-c = n(k-t)$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
    $endgroup$
    – testinggnitset ser
    May 6 '18 at 3:37











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2768602%2fshow-that-given-a-set-of-positive-n-integers-there-exists-a-non-empty-subset-wh%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









4












$begingroup$

Via modular arithmetic this is very easy, and something you can check (if you're familiar with this). Otherwise, one can show the following result via the division algorithm (i.e. just straight division with quotient and remainder):




If $a$ and $b$ have the same remainder when divided by $n$, then $a-b$ is divisible by $n$.




The proof is as follows. Let $r$ be the common remainder of $a$ and $b$ when divided by $n$. The division algorithm gives integers $q,p$ such that $a=qn+r$ and $b=pn+r$. Thus, we get $$a-b=(qn+r)-(pn+r)=(qn-pn)+(r-r)=(q-p)n$$
so $n$ divides $a-b$.



Note that the above result is more general, and can be applied to your situation by having $a=S_j$ and $b=S_i$. It doesn't really matter that the $S_i$ and $S_j$ are sums of integers when applying the statement I just proved; as far as we care they are just some integers $a$ and $b$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    But this is $a-b$ not $a+b$
    $endgroup$
    – kelalaka
    Jan 3 at 16:41










  • $begingroup$
    @kelalaka yes, and this is what we want for this question. We want $a-b$.
    $endgroup$
    – Dave
    Jan 3 at 17:43










  • $begingroup$
    I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
    $endgroup$
    – kelalaka
    Jan 3 at 17:47












  • $begingroup$
    @kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
    $endgroup$
    – Dave
    Jan 3 at 17:52
















4












$begingroup$

Via modular arithmetic this is very easy, and something you can check (if you're familiar with this). Otherwise, one can show the following result via the division algorithm (i.e. just straight division with quotient and remainder):




If $a$ and $b$ have the same remainder when divided by $n$, then $a-b$ is divisible by $n$.




The proof is as follows. Let $r$ be the common remainder of $a$ and $b$ when divided by $n$. The division algorithm gives integers $q,p$ such that $a=qn+r$ and $b=pn+r$. Thus, we get $$a-b=(qn+r)-(pn+r)=(qn-pn)+(r-r)=(q-p)n$$
so $n$ divides $a-b$.



Note that the above result is more general, and can be applied to your situation by having $a=S_j$ and $b=S_i$. It doesn't really matter that the $S_i$ and $S_j$ are sums of integers when applying the statement I just proved; as far as we care they are just some integers $a$ and $b$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    But this is $a-b$ not $a+b$
    $endgroup$
    – kelalaka
    Jan 3 at 16:41










  • $begingroup$
    @kelalaka yes, and this is what we want for this question. We want $a-b$.
    $endgroup$
    – Dave
    Jan 3 at 17:43










  • $begingroup$
    I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
    $endgroup$
    – kelalaka
    Jan 3 at 17:47












  • $begingroup$
    @kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
    $endgroup$
    – Dave
    Jan 3 at 17:52














4












4








4





$begingroup$

Via modular arithmetic this is very easy, and something you can check (if you're familiar with this). Otherwise, one can show the following result via the division algorithm (i.e. just straight division with quotient and remainder):




If $a$ and $b$ have the same remainder when divided by $n$, then $a-b$ is divisible by $n$.




The proof is as follows. Let $r$ be the common remainder of $a$ and $b$ when divided by $n$. The division algorithm gives integers $q,p$ such that $a=qn+r$ and $b=pn+r$. Thus, we get $$a-b=(qn+r)-(pn+r)=(qn-pn)+(r-r)=(q-p)n$$
so $n$ divides $a-b$.



Note that the above result is more general, and can be applied to your situation by having $a=S_j$ and $b=S_i$. It doesn't really matter that the $S_i$ and $S_j$ are sums of integers when applying the statement I just proved; as far as we care they are just some integers $a$ and $b$.






share|cite|improve this answer









$endgroup$



Via modular arithmetic this is very easy, and something you can check (if you're familiar with this). Otherwise, one can show the following result via the division algorithm (i.e. just straight division with quotient and remainder):




If $a$ and $b$ have the same remainder when divided by $n$, then $a-b$ is divisible by $n$.




The proof is as follows. Let $r$ be the common remainder of $a$ and $b$ when divided by $n$. The division algorithm gives integers $q,p$ such that $a=qn+r$ and $b=pn+r$. Thus, we get $$a-b=(qn+r)-(pn+r)=(qn-pn)+(r-r)=(q-p)n$$
so $n$ divides $a-b$.



Note that the above result is more general, and can be applied to your situation by having $a=S_j$ and $b=S_i$. It doesn't really matter that the $S_i$ and $S_j$ are sums of integers when applying the statement I just proved; as far as we care they are just some integers $a$ and $b$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered May 6 '18 at 3:24









DaveDave

9,06311033




9,06311033












  • $begingroup$
    But this is $a-b$ not $a+b$
    $endgroup$
    – kelalaka
    Jan 3 at 16:41










  • $begingroup$
    @kelalaka yes, and this is what we want for this question. We want $a-b$.
    $endgroup$
    – Dave
    Jan 3 at 17:43










  • $begingroup$
    I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
    $endgroup$
    – kelalaka
    Jan 3 at 17:47












  • $begingroup$
    @kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
    $endgroup$
    – Dave
    Jan 3 at 17:52


















  • $begingroup$
    But this is $a-b$ not $a+b$
    $endgroup$
    – kelalaka
    Jan 3 at 16:41










  • $begingroup$
    @kelalaka yes, and this is what we want for this question. We want $a-b$.
    $endgroup$
    – Dave
    Jan 3 at 17:43










  • $begingroup$
    I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
    $endgroup$
    – kelalaka
    Jan 3 at 17:47












  • $begingroup$
    @kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
    $endgroup$
    – Dave
    Jan 3 at 17:52
















$begingroup$
But this is $a-b$ not $a+b$
$endgroup$
– kelalaka
Jan 3 at 16:41




$begingroup$
But this is $a-b$ not $a+b$
$endgroup$
– kelalaka
Jan 3 at 16:41












$begingroup$
@kelalaka yes, and this is what we want for this question. We want $a-b$.
$endgroup$
– Dave
Jan 3 at 17:43




$begingroup$
@kelalaka yes, and this is what we want for this question. We want $a-b$.
$endgroup$
– Dave
Jan 3 at 17:43












$begingroup$
I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
$endgroup$
– kelalaka
Jan 3 at 17:47






$begingroup$
I'm confused. The OP requested sum is divisible but all the answers are $a-b$. I'm trying to prove $a+b$.
$endgroup$
– kelalaka
Jan 3 at 17:47














$begingroup$
@kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
$endgroup$
– Dave
Jan 3 at 17:52




$begingroup$
@kelalaka I think you should read the proof in the question more carefully. Each of the $S_i$'s are sums of the elements in the set, so $S_j-S_i$ is also a sum of elements in the set when $ineq j$. Then in my answer I denote $a=S_j$ and $b=S_i$, so $a-b$ is a sum of elements in the given set.
$endgroup$
– Dave
Jan 3 at 17:52











2












$begingroup$

Let $p<q$, if $S_p = sum_{i=1}^p s_i equiv r pmod{n}$



and $S_q = sum_{i=1}^q s_i equiv r pmod{n}$



then we have $S_q-S_p=sum_{i=p+1}^q s_i equiv r-r equiv 0 pmod{n}$



where we have use the property that if $a equiv b pmod{n}$ and $c equiv d pmod{n}$, then we have $a-c equiv b-d pmod{n}$



If you are not familiar with modulo arithmetic, view it as if $a = nk+r$ and $c = nt+r$, then $a-c = n(k-t)$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
    $endgroup$
    – testinggnitset ser
    May 6 '18 at 3:37
















2












$begingroup$

Let $p<q$, if $S_p = sum_{i=1}^p s_i equiv r pmod{n}$



and $S_q = sum_{i=1}^q s_i equiv r pmod{n}$



then we have $S_q-S_p=sum_{i=p+1}^q s_i equiv r-r equiv 0 pmod{n}$



where we have use the property that if $a equiv b pmod{n}$ and $c equiv d pmod{n}$, then we have $a-c equiv b-d pmod{n}$



If you are not familiar with modulo arithmetic, view it as if $a = nk+r$ and $c = nt+r$, then $a-c = n(k-t)$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
    $endgroup$
    – testinggnitset ser
    May 6 '18 at 3:37














2












2








2





$begingroup$

Let $p<q$, if $S_p = sum_{i=1}^p s_i equiv r pmod{n}$



and $S_q = sum_{i=1}^q s_i equiv r pmod{n}$



then we have $S_q-S_p=sum_{i=p+1}^q s_i equiv r-r equiv 0 pmod{n}$



where we have use the property that if $a equiv b pmod{n}$ and $c equiv d pmod{n}$, then we have $a-c equiv b-d pmod{n}$



If you are not familiar with modulo arithmetic, view it as if $a = nk+r$ and $c = nt+r$, then $a-c = n(k-t)$.






share|cite|improve this answer









$endgroup$



Let $p<q$, if $S_p = sum_{i=1}^p s_i equiv r pmod{n}$



and $S_q = sum_{i=1}^q s_i equiv r pmod{n}$



then we have $S_q-S_p=sum_{i=p+1}^q s_i equiv r-r equiv 0 pmod{n}$



where we have use the property that if $a equiv b pmod{n}$ and $c equiv d pmod{n}$, then we have $a-c equiv b-d pmod{n}$



If you are not familiar with modulo arithmetic, view it as if $a = nk+r$ and $c = nt+r$, then $a-c = n(k-t)$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered May 6 '18 at 3:17









Siong Thye GohSiong Thye Goh

103k1468119




103k1468119












  • $begingroup$
    thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
    $endgroup$
    – testinggnitset ser
    May 6 '18 at 3:37


















  • $begingroup$
    thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
    $endgroup$
    – testinggnitset ser
    May 6 '18 at 3:37
















$begingroup$
thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
$endgroup$
– testinggnitset ser
May 6 '18 at 3:37




$begingroup$
thanks for taking time to write this answer too! you can probably tell my math skills aren't that great so the bottom one made more sense to me for now with a bit more explanation without the modular arithmetic route :|
$endgroup$
– testinggnitset ser
May 6 '18 at 3:37


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2768602%2fshow-that-given-a-set-of-positive-n-integers-there-exists-a-non-empty-subset-wh%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅