In How Many Ways Can We Partition a Set Into Smaller Subsets So The Sum of the Numbers In Each Subset Is Equal?tHow many ways we can partition a set S into two subsets under the following restrictions?Partition a set into 2 subsetsDivide a set of $n$ elements into $k$ subsets having equal sumDivide set of numbers into twosub sets with equal totalsHow many subsets of four numbers from the set are there in which the sum of the largest and smallest number in the subset is 15?In how many ways can you partition a list?Number of ways to select subsets from a set of equal elements that have difference between partitions as 0How to partition a set into k subsets, given minimum subset size is limited by some constant?Number of ways to partition an array of numbers so that the partition sums are equal and first part numbers are lesser than second partHow many subsets of $1,2,dots,n$ have sum divisible by $4$? What about when $4$ is replaced with $16,32,3,$ or $k$?

Was murdering a slave illegal in American slavery, and if so, what punishments were given for it?

Head-internal relative clauses

How can I prevent Bash expansion from passing files starting with "-" as argument?

Is being an extrovert a necessary condition to be a manager?

Addressing an email

Are there any crystals that are theoretically possible, but haven't yet been made?

pwaS eht tirsf dna tasl setterl fo hace dorw

Managing heat dissipation in a magic wand

What were the "pills" that were added to solid waste in Apollo 7?

In How Many Ways Can We Partition a Set Into Smaller Subsets So The Sum of the Numbers In Each Subset Is Equal?

Bash - Execute two commands and get exit status 1 if first fails

Can't think of a good word or term to describe not feeling or thinking

Who is frowning in the sentence "Daisy looked at Tom frowning"?

Why did Nick Fury not hesitate in blowing up the plane he thought was carrying a nuke?

Gambler's Fallacy Dice

How does the "reverse syntax" in Middle English work?

Can the word crowd refer to just 10 people?

Is it possible to view all the attribute data in QGIS

Greek theta instead of lower case þ (Icelandic) in TexStudio

What does it mean for a program to be 32 or 64 bit?

Precedent for disabled Kings

Very serious stuff - Salesforce bug enabled "Modify All"

How to choose the correct exposure for flower photography?

Difference between good and not so good university?



In How Many Ways Can We Partition a Set Into Smaller Subsets So The Sum of the Numbers In Each Subset Is Equal?


tHow many ways we can partition a set S into two subsets under the following restrictions?Partition a set into 2 subsetsDivide a set of $n$ elements into $k$ subsets having equal sumDivide set of numbers into twosub sets with equal totalsHow many subsets of four numbers from the set are there in which the sum of the largest and smallest number in the subset is 15?In how many ways can you partition a list?Number of ways to select subsets from a set of equal elements that have difference between partitions as 0How to partition a set into k subsets, given minimum subset size is limited by some constant?Number of ways to partition an array of numbers so that the partition sums are equal and first part numbers are lesser than second partHow many subsets of $1,2,dots,n$ have sum divisible by $4$? What about when $4$ is replaced with $16,32,3,$ or $k$?













5












$begingroup$


Let $A = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9$.How many ways are there to partition this set into at least 2 subsets so the sum of the numbers in each subset is equal?



Here's what I've tried:
Let $n$ be the number of subsets and $s$ the sum of the numbers in a subset(Where all the sets are equal). Since $n*s=45$, $n$ has to divide $45$ and on the other hand, $s$ can't be smaller than $9$ so the only options for $n$ are $3$ and $5$. Now I know I can just count how many possible solutions there are given the fact that $n$ has only $2$ possible values but I was wondering is there a more elegant solution?



P.S: This actually came in a math contest and I didn't have time to count all the possible solutions so if there aren't any "better" solution, what do you think I should have done since I only had around $5$ minutes for this question.



Thanks in advance for any help!










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    This may be cheating :) but may I ask: what is the level of the math contest? If it's highschool level perhaps you're just supposed to count this in $5$ minutes, which seems tedious but just barely doable. The $n=5$ case is easy to count -- there's only one way to partition the positive numbers and then the $0$ can go with any of the $5$ sets, so there are $5$ ways total. The $n=3$ case seems tedious but doable in five minutes.
    $endgroup$
    – antkam
    4 hours ago










  • $begingroup$
    @antkam It's high school level actually. But I really dislike these types of questions; they can be easily solved by computers in a matter of milliseconds and brute force is truly the only way to solve them. A math question should have an elegant solution and not something that could be easily done using brute force.
    $endgroup$
    – Borna Ghahnoosh
    3 hours ago










  • $begingroup$
    While I mostly agree with your sentiment, there are good ways to count (e.g. the accepted Answer) and messy / error-prone ways to count, and one can argue the ability to find a clear, efficient, less error-prone way to count is a math skill. Imagine this is a programming exercise: then clearly some algorithms are better than others, right? Here you're just asked to run algorithm on paper...
    $endgroup$
    – antkam
    3 hours ago






  • 2




    $begingroup$
    Anyway, you seem interested in the general problem, so you might enjoy knowing this: with general ground set $A$, the problem is (a generalization of) something called subset-sum and is NP-hard.
    $endgroup$
    – antkam
    3 hours ago
















5












$begingroup$


Let $A = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9$.How many ways are there to partition this set into at least 2 subsets so the sum of the numbers in each subset is equal?



Here's what I've tried:
Let $n$ be the number of subsets and $s$ the sum of the numbers in a subset(Where all the sets are equal). Since $n*s=45$, $n$ has to divide $45$ and on the other hand, $s$ can't be smaller than $9$ so the only options for $n$ are $3$ and $5$. Now I know I can just count how many possible solutions there are given the fact that $n$ has only $2$ possible values but I was wondering is there a more elegant solution?



P.S: This actually came in a math contest and I didn't have time to count all the possible solutions so if there aren't any "better" solution, what do you think I should have done since I only had around $5$ minutes for this question.



Thanks in advance for any help!










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    This may be cheating :) but may I ask: what is the level of the math contest? If it's highschool level perhaps you're just supposed to count this in $5$ minutes, which seems tedious but just barely doable. The $n=5$ case is easy to count -- there's only one way to partition the positive numbers and then the $0$ can go with any of the $5$ sets, so there are $5$ ways total. The $n=3$ case seems tedious but doable in five minutes.
    $endgroup$
    – antkam
    4 hours ago










  • $begingroup$
    @antkam It's high school level actually. But I really dislike these types of questions; they can be easily solved by computers in a matter of milliseconds and brute force is truly the only way to solve them. A math question should have an elegant solution and not something that could be easily done using brute force.
    $endgroup$
    – Borna Ghahnoosh
    3 hours ago










  • $begingroup$
    While I mostly agree with your sentiment, there are good ways to count (e.g. the accepted Answer) and messy / error-prone ways to count, and one can argue the ability to find a clear, efficient, less error-prone way to count is a math skill. Imagine this is a programming exercise: then clearly some algorithms are better than others, right? Here you're just asked to run algorithm on paper...
    $endgroup$
    – antkam
    3 hours ago






  • 2




    $begingroup$
    Anyway, you seem interested in the general problem, so you might enjoy knowing this: with general ground set $A$, the problem is (a generalization of) something called subset-sum and is NP-hard.
    $endgroup$
    – antkam
    3 hours ago














5












5








5


1



$begingroup$


Let $A = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9$.How many ways are there to partition this set into at least 2 subsets so the sum of the numbers in each subset is equal?



Here's what I've tried:
Let $n$ be the number of subsets and $s$ the sum of the numbers in a subset(Where all the sets are equal). Since $n*s=45$, $n$ has to divide $45$ and on the other hand, $s$ can't be smaller than $9$ so the only options for $n$ are $3$ and $5$. Now I know I can just count how many possible solutions there are given the fact that $n$ has only $2$ possible values but I was wondering is there a more elegant solution?



P.S: This actually came in a math contest and I didn't have time to count all the possible solutions so if there aren't any "better" solution, what do you think I should have done since I only had around $5$ minutes for this question.



Thanks in advance for any help!










share|cite|improve this question











$endgroup$




Let $A = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9$.How many ways are there to partition this set into at least 2 subsets so the sum of the numbers in each subset is equal?



Here's what I've tried:
Let $n$ be the number of subsets and $s$ the sum of the numbers in a subset(Where all the sets are equal). Since $n*s=45$, $n$ has to divide $45$ and on the other hand, $s$ can't be smaller than $9$ so the only options for $n$ are $3$ and $5$. Now I know I can just count how many possible solutions there are given the fact that $n$ has only $2$ possible values but I was wondering is there a more elegant solution?



P.S: This actually came in a math contest and I didn't have time to count all the possible solutions so if there aren't any "better" solution, what do you think I should have done since I only had around $5$ minutes for this question.



Thanks in advance for any help!







combinatorics combinations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 4 hours ago







Borna Ghahnoosh

















asked 5 hours ago









Borna GhahnooshBorna Ghahnoosh

1146




1146







  • 1




    $begingroup$
    This may be cheating :) but may I ask: what is the level of the math contest? If it's highschool level perhaps you're just supposed to count this in $5$ minutes, which seems tedious but just barely doable. The $n=5$ case is easy to count -- there's only one way to partition the positive numbers and then the $0$ can go with any of the $5$ sets, so there are $5$ ways total. The $n=3$ case seems tedious but doable in five minutes.
    $endgroup$
    – antkam
    4 hours ago










  • $begingroup$
    @antkam It's high school level actually. But I really dislike these types of questions; they can be easily solved by computers in a matter of milliseconds and brute force is truly the only way to solve them. A math question should have an elegant solution and not something that could be easily done using brute force.
    $endgroup$
    – Borna Ghahnoosh
    3 hours ago










  • $begingroup$
    While I mostly agree with your sentiment, there are good ways to count (e.g. the accepted Answer) and messy / error-prone ways to count, and one can argue the ability to find a clear, efficient, less error-prone way to count is a math skill. Imagine this is a programming exercise: then clearly some algorithms are better than others, right? Here you're just asked to run algorithm on paper...
    $endgroup$
    – antkam
    3 hours ago






  • 2




    $begingroup$
    Anyway, you seem interested in the general problem, so you might enjoy knowing this: with general ground set $A$, the problem is (a generalization of) something called subset-sum and is NP-hard.
    $endgroup$
    – antkam
    3 hours ago













  • 1




    $begingroup$
    This may be cheating :) but may I ask: what is the level of the math contest? If it's highschool level perhaps you're just supposed to count this in $5$ minutes, which seems tedious but just barely doable. The $n=5$ case is easy to count -- there's only one way to partition the positive numbers and then the $0$ can go with any of the $5$ sets, so there are $5$ ways total. The $n=3$ case seems tedious but doable in five minutes.
    $endgroup$
    – antkam
    4 hours ago










  • $begingroup$
    @antkam It's high school level actually. But I really dislike these types of questions; they can be easily solved by computers in a matter of milliseconds and brute force is truly the only way to solve them. A math question should have an elegant solution and not something that could be easily done using brute force.
    $endgroup$
    – Borna Ghahnoosh
    3 hours ago










  • $begingroup$
    While I mostly agree with your sentiment, there are good ways to count (e.g. the accepted Answer) and messy / error-prone ways to count, and one can argue the ability to find a clear, efficient, less error-prone way to count is a math skill. Imagine this is a programming exercise: then clearly some algorithms are better than others, right? Here you're just asked to run algorithm on paper...
    $endgroup$
    – antkam
    3 hours ago






  • 2




    $begingroup$
    Anyway, you seem interested in the general problem, so you might enjoy knowing this: with general ground set $A$, the problem is (a generalization of) something called subset-sum and is NP-hard.
    $endgroup$
    – antkam
    3 hours ago








1




1




$begingroup$
This may be cheating :) but may I ask: what is the level of the math contest? If it's highschool level perhaps you're just supposed to count this in $5$ minutes, which seems tedious but just barely doable. The $n=5$ case is easy to count -- there's only one way to partition the positive numbers and then the $0$ can go with any of the $5$ sets, so there are $5$ ways total. The $n=3$ case seems tedious but doable in five minutes.
$endgroup$
– antkam
4 hours ago




$begingroup$
This may be cheating :) but may I ask: what is the level of the math contest? If it's highschool level perhaps you're just supposed to count this in $5$ minutes, which seems tedious but just barely doable. The $n=5$ case is easy to count -- there's only one way to partition the positive numbers and then the $0$ can go with any of the $5$ sets, so there are $5$ ways total. The $n=3$ case seems tedious but doable in five minutes.
$endgroup$
– antkam
4 hours ago












$begingroup$
@antkam It's high school level actually. But I really dislike these types of questions; they can be easily solved by computers in a matter of milliseconds and brute force is truly the only way to solve them. A math question should have an elegant solution and not something that could be easily done using brute force.
$endgroup$
– Borna Ghahnoosh
3 hours ago




$begingroup$
@antkam It's high school level actually. But I really dislike these types of questions; they can be easily solved by computers in a matter of milliseconds and brute force is truly the only way to solve them. A math question should have an elegant solution and not something that could be easily done using brute force.
$endgroup$
– Borna Ghahnoosh
3 hours ago












$begingroup$
While I mostly agree with your sentiment, there are good ways to count (e.g. the accepted Answer) and messy / error-prone ways to count, and one can argue the ability to find a clear, efficient, less error-prone way to count is a math skill. Imagine this is a programming exercise: then clearly some algorithms are better than others, right? Here you're just asked to run algorithm on paper...
$endgroup$
– antkam
3 hours ago




$begingroup$
While I mostly agree with your sentiment, there are good ways to count (e.g. the accepted Answer) and messy / error-prone ways to count, and one can argue the ability to find a clear, efficient, less error-prone way to count is a math skill. Imagine this is a programming exercise: then clearly some algorithms are better than others, right? Here you're just asked to run algorithm on paper...
$endgroup$
– antkam
3 hours ago




2




2




$begingroup$
Anyway, you seem interested in the general problem, so you might enjoy knowing this: with general ground set $A$, the problem is (a generalization of) something called subset-sum and is NP-hard.
$endgroup$
– antkam
3 hours ago





$begingroup$
Anyway, you seem interested in the general problem, so you might enjoy knowing this: with general ground set $A$, the problem is (a generalization of) something called subset-sum and is NP-hard.
$endgroup$
– antkam
3 hours ago











2 Answers
2






active

oldest

votes


















5












$begingroup$

Here is the tedious method that @antkam mentioned:



Consider the sums adding to 9. You have:



The set that contains $9$.
The set that contains $8$ must contain $1$.
The set that contains $7$ must contain $2$.
The set that contains $6$ must contain $3$ (Because it cannot contain $1$ and $2$, which are already used).
The set that contains $5$ must contain $4$ (Because $1, 3$ are both used).
There is but one way to distribute the numbers $1$ through $9$. All that is left is to choose where to put $0$. For that, there are $5$ ways (Any set can have $0$ in it).



Next, consider when the sum is $15$ ($3$ sets). We want to consider the most restrictive numbers first (As this will eliminate possibilities the fastest):
Let's write out all possible ways of summing to $15$ that contain a $9$ in non-zero digits:



$1+2+3+9,
1+5+9,
2+4+9,
6+9$



Next, do the same for $8$:



$1+2+4+8,
1+6+8,
2+5+8,
3+4+8,
7+8$



We only need to pick the first two sets (one set containing 9, one set containing 8). The rest of the digits will be in the third set. And, we can place the zero into any of the three sets, so every valid partition of the nonzero elements can be turned into three distinct partitions when we add in the zero.



$1,2,3,9$ can only pair with $7,8$: $3$ ways



$1,5,9$ can pair with $3,4,8$ or $7,8$: $6$ ways



$2,4,9$ can pair with $1,6,8$ or $7,8$: $6$ ways



$6,9$ can pair with $1,2,4,8$, $2,5,8$, $3,4,8$, or $7,8$: $12$ ways



Adding it all up, that is $5+3+6+6+12=32$ ways.






share|cite|improve this answer











$endgroup$




















    3












    $begingroup$

    I think the key is understanding that $0$ can go wherever and that every number must go somewhere.
    Set aside $0$ for the moment.



    When $n=5$ we have $s=9$. We can use an inductive reasoning as follows:




    • $9$ must be alone, so we get $9$ and that leaves $1,2,3,4,5,6,7,8$.


    • $8$ can only be paired with $1$ to reach $s=9$, so we get $1,8$ and that leaves $2,3,4,5,6,7$.


    • $7$ can only be paired with $2$ to reach $s = 9$, so we get $2,7$ and that leaves $3,4,5,6$.

    • Proceeding in this manner, we find that the subsets look like $big9, 1,8, 2,7, 3,6, 4,5big$.

    All that remains is to assign $0$ to some subset, so we get $5$ possibilities for $s=9$.




    When $n=3$ we have $s=15$ and things get slightly more complicated.
    We are still setting $0$ aside for this.



    First, notice that $9$ and $8$ must go towards different subsets.
    We will then find how to fill up the $9$ subset, and for each such manner, we'll find out how to fill up the $8$ subset.
    The remaining numbers will form their own subset.



    The idea behind this is that starting from the larger number is better because the remaining sum is smaller, so there are fewer options to consider.



    So, we have $1,2,3,4,5,6,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $6$.
    Now, proceeding as before, we find that the possibilities are $big6, 1,5, 2,4, 1,2,3big$.



    • If the $9$ susbset is $6,9$, we are left with $1,2,3,4,5,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $7$ (in order to complete the $8$ subset).
      We proceed as before and arrive at $big7, 2,5, 3,4, 1,2,4big$.
      This gives us $4$ additional possibilities before adding $0$.


    • If the $9$ susbset is $1,5,9$, we are left with $2,3,4,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
      We proceed as before and arrive at $big7, 3,4big$.
      This gives us $2$ additional possibilities before adding $0$.


    • If the $9$ susbset is $2,4,9$, we are left with $1,3,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
      We proceed as before and arrive at $big7, 1,6big$.
      This gives us $2$ additional possibilities before adding $0$.


    • Finally if the $9$ susbset is $1,2,3,9$, we are left with $4,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
      Clearly, the only way is picking a lone $7$ which gives us $1$ additional possibility before adding $0$.


    So we have $9$ possibilities without $0$. For each such configuration, we have $3$ ways to assign $0$ to a subset, which gives us $9times 3 = 27$ total possibilities in the $n=3$ case.




    In total, this gives us $27+5 = 32$ possibilities.




    Now, this is a structured way of thinking to approach this problem (tackle the large numbers to reduce leftover sum possibilities), but there is of course a more... operational approach.
    Generating functions are a handy tool for any combinatorist to have.



    One way to consider this problem if you have computational power at hand is as follows.



    When $n=3$, we consider the product



    $$prod_i=0^9 (x_1^i+x_2^i+x_3^i).tag$*$$$



    Expanding this product, we'll find a sum of monomials of the form $ccdot x_1^ax_2^bx_3^c$.
    Each such monomial can be interpreted as follows: there are $c$ ways to partition the set $0,1,2,dots,9$ such that the first subset sums to $a$, the second subset sums to $b$ and the third subset sums to $c$.



    Indeed, when expanding the product, at each step we must choose which $x_i^j$ we're taking. Choosing $x_i^j$ means assigning the element $j$ from $0,1,2,dots,9$ to the $i$-th subset.



    Since we want all our subsets to sum to $s=15$, we're then interested in the coefficient of $x_1^15x_2^15x_3^15$ in the expansion of $(*)$.
    Of course, since we also don't care about the order of our subsets, we have to divide the end result by $3!$.



    When I say we don't care about the order of our subsets, I mean that the family of subsets $big0,6,9, 7,8, 1,2,3,4,5big$ is just as good as $big7,8, 1,2,3,4,5, 0,6,9big$ or any other permutation.



    You can check with Wolfram Online Notebooks (or your choice of math software) using 1/3! * Coefficient[Product[(x^i+y^i+z^i),i,0,9], x*y*z,15] that the answer comes out to $27$, like we did when counting by hand.



    Similarly, to count the number of possibilities for $n=5$ we'd look at



    $$frac15!left[x_1^9x_2^9x_3^9x_4^9x_5^9right]left(prod_i=0^9 (x_1^i+x_2^i+x_3^i+x_4^i+x_5^i)right).$$



    You can check with 1/5! * Coefficient[Product[(a^i+b^i+c^i+d^i+e^i),i,0,9], a*b*c*d*e, 9] that the answer comes out to $5$, like we did when counting by hand.



    I will say, however, that this is not a computationally cheap or fast way to obtain the answer (if you are interested in computationally feasible ways to approach this problem, it is traditionally handled with a technique called dynamic programming).
    So, if you can afford to let the computer do the calculations for you while you're doing something else, go ahead.
    Of course, you can also expand the product by hand yourself if you prefer.



    You can also combine both methods.
    This approach clearly suffers at higher values of $n$, because the number of monomials in the product expansion grows too fast with $n$.
    On the other hand, for higher values of $n$, $s$ is lower and we see from the example that the inductive reasoning becomes simpler, with less combinations to consider.



    Finally, this approach also tackles other variations of this problem, like specifying different sums for different subsets and also generalizing to ordered subsets.






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
      $endgroup$
      – Roman Odaisky
      37 mins ago











    Your Answer








    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%2f3229913%2fin-how-many-ways-can-we-partition-a-set-into-smaller-subsets-so-the-sum-of-the-n%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









    5












    $begingroup$

    Here is the tedious method that @antkam mentioned:



    Consider the sums adding to 9. You have:



    The set that contains $9$.
    The set that contains $8$ must contain $1$.
    The set that contains $7$ must contain $2$.
    The set that contains $6$ must contain $3$ (Because it cannot contain $1$ and $2$, which are already used).
    The set that contains $5$ must contain $4$ (Because $1, 3$ are both used).
    There is but one way to distribute the numbers $1$ through $9$. All that is left is to choose where to put $0$. For that, there are $5$ ways (Any set can have $0$ in it).



    Next, consider when the sum is $15$ ($3$ sets). We want to consider the most restrictive numbers first (As this will eliminate possibilities the fastest):
    Let's write out all possible ways of summing to $15$ that contain a $9$ in non-zero digits:



    $1+2+3+9,
    1+5+9,
    2+4+9,
    6+9$



    Next, do the same for $8$:



    $1+2+4+8,
    1+6+8,
    2+5+8,
    3+4+8,
    7+8$



    We only need to pick the first two sets (one set containing 9, one set containing 8). The rest of the digits will be in the third set. And, we can place the zero into any of the three sets, so every valid partition of the nonzero elements can be turned into three distinct partitions when we add in the zero.



    $1,2,3,9$ can only pair with $7,8$: $3$ ways



    $1,5,9$ can pair with $3,4,8$ or $7,8$: $6$ ways



    $2,4,9$ can pair with $1,6,8$ or $7,8$: $6$ ways



    $6,9$ can pair with $1,2,4,8$, $2,5,8$, $3,4,8$, or $7,8$: $12$ ways



    Adding it all up, that is $5+3+6+6+12=32$ ways.






    share|cite|improve this answer











    $endgroup$

















      5












      $begingroup$

      Here is the tedious method that @antkam mentioned:



      Consider the sums adding to 9. You have:



      The set that contains $9$.
      The set that contains $8$ must contain $1$.
      The set that contains $7$ must contain $2$.
      The set that contains $6$ must contain $3$ (Because it cannot contain $1$ and $2$, which are already used).
      The set that contains $5$ must contain $4$ (Because $1, 3$ are both used).
      There is but one way to distribute the numbers $1$ through $9$. All that is left is to choose where to put $0$. For that, there are $5$ ways (Any set can have $0$ in it).



      Next, consider when the sum is $15$ ($3$ sets). We want to consider the most restrictive numbers first (As this will eliminate possibilities the fastest):
      Let's write out all possible ways of summing to $15$ that contain a $9$ in non-zero digits:



      $1+2+3+9,
      1+5+9,
      2+4+9,
      6+9$



      Next, do the same for $8$:



      $1+2+4+8,
      1+6+8,
      2+5+8,
      3+4+8,
      7+8$



      We only need to pick the first two sets (one set containing 9, one set containing 8). The rest of the digits will be in the third set. And, we can place the zero into any of the three sets, so every valid partition of the nonzero elements can be turned into three distinct partitions when we add in the zero.



      $1,2,3,9$ can only pair with $7,8$: $3$ ways



      $1,5,9$ can pair with $3,4,8$ or $7,8$: $6$ ways



      $2,4,9$ can pair with $1,6,8$ or $7,8$: $6$ ways



      $6,9$ can pair with $1,2,4,8$, $2,5,8$, $3,4,8$, or $7,8$: $12$ ways



      Adding it all up, that is $5+3+6+6+12=32$ ways.






      share|cite|improve this answer











      $endgroup$















        5












        5








        5





        $begingroup$

        Here is the tedious method that @antkam mentioned:



        Consider the sums adding to 9. You have:



        The set that contains $9$.
        The set that contains $8$ must contain $1$.
        The set that contains $7$ must contain $2$.
        The set that contains $6$ must contain $3$ (Because it cannot contain $1$ and $2$, which are already used).
        The set that contains $5$ must contain $4$ (Because $1, 3$ are both used).
        There is but one way to distribute the numbers $1$ through $9$. All that is left is to choose where to put $0$. For that, there are $5$ ways (Any set can have $0$ in it).



        Next, consider when the sum is $15$ ($3$ sets). We want to consider the most restrictive numbers first (As this will eliminate possibilities the fastest):
        Let's write out all possible ways of summing to $15$ that contain a $9$ in non-zero digits:



        $1+2+3+9,
        1+5+9,
        2+4+9,
        6+9$



        Next, do the same for $8$:



        $1+2+4+8,
        1+6+8,
        2+5+8,
        3+4+8,
        7+8$



        We only need to pick the first two sets (one set containing 9, one set containing 8). The rest of the digits will be in the third set. And, we can place the zero into any of the three sets, so every valid partition of the nonzero elements can be turned into three distinct partitions when we add in the zero.



        $1,2,3,9$ can only pair with $7,8$: $3$ ways



        $1,5,9$ can pair with $3,4,8$ or $7,8$: $6$ ways



        $2,4,9$ can pair with $1,6,8$ or $7,8$: $6$ ways



        $6,9$ can pair with $1,2,4,8$, $2,5,8$, $3,4,8$, or $7,8$: $12$ ways



        Adding it all up, that is $5+3+6+6+12=32$ ways.






        share|cite|improve this answer











        $endgroup$



        Here is the tedious method that @antkam mentioned:



        Consider the sums adding to 9. You have:



        The set that contains $9$.
        The set that contains $8$ must contain $1$.
        The set that contains $7$ must contain $2$.
        The set that contains $6$ must contain $3$ (Because it cannot contain $1$ and $2$, which are already used).
        The set that contains $5$ must contain $4$ (Because $1, 3$ are both used).
        There is but one way to distribute the numbers $1$ through $9$. All that is left is to choose where to put $0$. For that, there are $5$ ways (Any set can have $0$ in it).



        Next, consider when the sum is $15$ ($3$ sets). We want to consider the most restrictive numbers first (As this will eliminate possibilities the fastest):
        Let's write out all possible ways of summing to $15$ that contain a $9$ in non-zero digits:



        $1+2+3+9,
        1+5+9,
        2+4+9,
        6+9$



        Next, do the same for $8$:



        $1+2+4+8,
        1+6+8,
        2+5+8,
        3+4+8,
        7+8$



        We only need to pick the first two sets (one set containing 9, one set containing 8). The rest of the digits will be in the third set. And, we can place the zero into any of the three sets, so every valid partition of the nonzero elements can be turned into three distinct partitions when we add in the zero.



        $1,2,3,9$ can only pair with $7,8$: $3$ ways



        $1,5,9$ can pair with $3,4,8$ or $7,8$: $6$ ways



        $2,4,9$ can pair with $1,6,8$ or $7,8$: $6$ ways



        $6,9$ can pair with $1,2,4,8$, $2,5,8$, $3,4,8$, or $7,8$: $12$ ways



        Adding it all up, that is $5+3+6+6+12=32$ ways.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited 4 hours ago









        Borna Ghahnoosh

        1146




        1146










        answered 4 hours ago









        InterstellarProbeInterstellarProbe

        3,996931




        3,996931





















            3












            $begingroup$

            I think the key is understanding that $0$ can go wherever and that every number must go somewhere.
            Set aside $0$ for the moment.



            When $n=5$ we have $s=9$. We can use an inductive reasoning as follows:




            • $9$ must be alone, so we get $9$ and that leaves $1,2,3,4,5,6,7,8$.


            • $8$ can only be paired with $1$ to reach $s=9$, so we get $1,8$ and that leaves $2,3,4,5,6,7$.


            • $7$ can only be paired with $2$ to reach $s = 9$, so we get $2,7$ and that leaves $3,4,5,6$.

            • Proceeding in this manner, we find that the subsets look like $big9, 1,8, 2,7, 3,6, 4,5big$.

            All that remains is to assign $0$ to some subset, so we get $5$ possibilities for $s=9$.




            When $n=3$ we have $s=15$ and things get slightly more complicated.
            We are still setting $0$ aside for this.



            First, notice that $9$ and $8$ must go towards different subsets.
            We will then find how to fill up the $9$ subset, and for each such manner, we'll find out how to fill up the $8$ subset.
            The remaining numbers will form their own subset.



            The idea behind this is that starting from the larger number is better because the remaining sum is smaller, so there are fewer options to consider.



            So, we have $1,2,3,4,5,6,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $6$.
            Now, proceeding as before, we find that the possibilities are $big6, 1,5, 2,4, 1,2,3big$.



            • If the $9$ susbset is $6,9$, we are left with $1,2,3,4,5,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $7$ (in order to complete the $8$ subset).
              We proceed as before and arrive at $big7, 2,5, 3,4, 1,2,4big$.
              This gives us $4$ additional possibilities before adding $0$.


            • If the $9$ susbset is $1,5,9$, we are left with $2,3,4,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 3,4big$.
              This gives us $2$ additional possibilities before adding $0$.


            • If the $9$ susbset is $2,4,9$, we are left with $1,3,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 1,6big$.
              This gives us $2$ additional possibilities before adding $0$.


            • Finally if the $9$ susbset is $1,2,3,9$, we are left with $4,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              Clearly, the only way is picking a lone $7$ which gives us $1$ additional possibility before adding $0$.


            So we have $9$ possibilities without $0$. For each such configuration, we have $3$ ways to assign $0$ to a subset, which gives us $9times 3 = 27$ total possibilities in the $n=3$ case.




            In total, this gives us $27+5 = 32$ possibilities.




            Now, this is a structured way of thinking to approach this problem (tackle the large numbers to reduce leftover sum possibilities), but there is of course a more... operational approach.
            Generating functions are a handy tool for any combinatorist to have.



            One way to consider this problem if you have computational power at hand is as follows.



            When $n=3$, we consider the product



            $$prod_i=0^9 (x_1^i+x_2^i+x_3^i).tag$*$$$



            Expanding this product, we'll find a sum of monomials of the form $ccdot x_1^ax_2^bx_3^c$.
            Each such monomial can be interpreted as follows: there are $c$ ways to partition the set $0,1,2,dots,9$ such that the first subset sums to $a$, the second subset sums to $b$ and the third subset sums to $c$.



            Indeed, when expanding the product, at each step we must choose which $x_i^j$ we're taking. Choosing $x_i^j$ means assigning the element $j$ from $0,1,2,dots,9$ to the $i$-th subset.



            Since we want all our subsets to sum to $s=15$, we're then interested in the coefficient of $x_1^15x_2^15x_3^15$ in the expansion of $(*)$.
            Of course, since we also don't care about the order of our subsets, we have to divide the end result by $3!$.



            When I say we don't care about the order of our subsets, I mean that the family of subsets $big0,6,9, 7,8, 1,2,3,4,5big$ is just as good as $big7,8, 1,2,3,4,5, 0,6,9big$ or any other permutation.



            You can check with Wolfram Online Notebooks (or your choice of math software) using 1/3! * Coefficient[Product[(x^i+y^i+z^i),i,0,9], x*y*z,15] that the answer comes out to $27$, like we did when counting by hand.



            Similarly, to count the number of possibilities for $n=5$ we'd look at



            $$frac15!left[x_1^9x_2^9x_3^9x_4^9x_5^9right]left(prod_i=0^9 (x_1^i+x_2^i+x_3^i+x_4^i+x_5^i)right).$$



            You can check with 1/5! * Coefficient[Product[(a^i+b^i+c^i+d^i+e^i),i,0,9], a*b*c*d*e, 9] that the answer comes out to $5$, like we did when counting by hand.



            I will say, however, that this is not a computationally cheap or fast way to obtain the answer (if you are interested in computationally feasible ways to approach this problem, it is traditionally handled with a technique called dynamic programming).
            So, if you can afford to let the computer do the calculations for you while you're doing something else, go ahead.
            Of course, you can also expand the product by hand yourself if you prefer.



            You can also combine both methods.
            This approach clearly suffers at higher values of $n$, because the number of monomials in the product expansion grows too fast with $n$.
            On the other hand, for higher values of $n$, $s$ is lower and we see from the example that the inductive reasoning becomes simpler, with less combinations to consider.



            Finally, this approach also tackles other variations of this problem, like specifying different sums for different subsets and also generalizing to ordered subsets.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
              $endgroup$
              – Roman Odaisky
              37 mins ago















            3












            $begingroup$

            I think the key is understanding that $0$ can go wherever and that every number must go somewhere.
            Set aside $0$ for the moment.



            When $n=5$ we have $s=9$. We can use an inductive reasoning as follows:




            • $9$ must be alone, so we get $9$ and that leaves $1,2,3,4,5,6,7,8$.


            • $8$ can only be paired with $1$ to reach $s=9$, so we get $1,8$ and that leaves $2,3,4,5,6,7$.


            • $7$ can only be paired with $2$ to reach $s = 9$, so we get $2,7$ and that leaves $3,4,5,6$.

            • Proceeding in this manner, we find that the subsets look like $big9, 1,8, 2,7, 3,6, 4,5big$.

            All that remains is to assign $0$ to some subset, so we get $5$ possibilities for $s=9$.




            When $n=3$ we have $s=15$ and things get slightly more complicated.
            We are still setting $0$ aside for this.



            First, notice that $9$ and $8$ must go towards different subsets.
            We will then find how to fill up the $9$ subset, and for each such manner, we'll find out how to fill up the $8$ subset.
            The remaining numbers will form their own subset.



            The idea behind this is that starting from the larger number is better because the remaining sum is smaller, so there are fewer options to consider.



            So, we have $1,2,3,4,5,6,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $6$.
            Now, proceeding as before, we find that the possibilities are $big6, 1,5, 2,4, 1,2,3big$.



            • If the $9$ susbset is $6,9$, we are left with $1,2,3,4,5,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $7$ (in order to complete the $8$ subset).
              We proceed as before and arrive at $big7, 2,5, 3,4, 1,2,4big$.
              This gives us $4$ additional possibilities before adding $0$.


            • If the $9$ susbset is $1,5,9$, we are left with $2,3,4,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 3,4big$.
              This gives us $2$ additional possibilities before adding $0$.


            • If the $9$ susbset is $2,4,9$, we are left with $1,3,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 1,6big$.
              This gives us $2$ additional possibilities before adding $0$.


            • Finally if the $9$ susbset is $1,2,3,9$, we are left with $4,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              Clearly, the only way is picking a lone $7$ which gives us $1$ additional possibility before adding $0$.


            So we have $9$ possibilities without $0$. For each such configuration, we have $3$ ways to assign $0$ to a subset, which gives us $9times 3 = 27$ total possibilities in the $n=3$ case.




            In total, this gives us $27+5 = 32$ possibilities.




            Now, this is a structured way of thinking to approach this problem (tackle the large numbers to reduce leftover sum possibilities), but there is of course a more... operational approach.
            Generating functions are a handy tool for any combinatorist to have.



            One way to consider this problem if you have computational power at hand is as follows.



            When $n=3$, we consider the product



            $$prod_i=0^9 (x_1^i+x_2^i+x_3^i).tag$*$$$



            Expanding this product, we'll find a sum of monomials of the form $ccdot x_1^ax_2^bx_3^c$.
            Each such monomial can be interpreted as follows: there are $c$ ways to partition the set $0,1,2,dots,9$ such that the first subset sums to $a$, the second subset sums to $b$ and the third subset sums to $c$.



            Indeed, when expanding the product, at each step we must choose which $x_i^j$ we're taking. Choosing $x_i^j$ means assigning the element $j$ from $0,1,2,dots,9$ to the $i$-th subset.



            Since we want all our subsets to sum to $s=15$, we're then interested in the coefficient of $x_1^15x_2^15x_3^15$ in the expansion of $(*)$.
            Of course, since we also don't care about the order of our subsets, we have to divide the end result by $3!$.



            When I say we don't care about the order of our subsets, I mean that the family of subsets $big0,6,9, 7,8, 1,2,3,4,5big$ is just as good as $big7,8, 1,2,3,4,5, 0,6,9big$ or any other permutation.



            You can check with Wolfram Online Notebooks (or your choice of math software) using 1/3! * Coefficient[Product[(x^i+y^i+z^i),i,0,9], x*y*z,15] that the answer comes out to $27$, like we did when counting by hand.



            Similarly, to count the number of possibilities for $n=5$ we'd look at



            $$frac15!left[x_1^9x_2^9x_3^9x_4^9x_5^9right]left(prod_i=0^9 (x_1^i+x_2^i+x_3^i+x_4^i+x_5^i)right).$$



            You can check with 1/5! * Coefficient[Product[(a^i+b^i+c^i+d^i+e^i),i,0,9], a*b*c*d*e, 9] that the answer comes out to $5$, like we did when counting by hand.



            I will say, however, that this is not a computationally cheap or fast way to obtain the answer (if you are interested in computationally feasible ways to approach this problem, it is traditionally handled with a technique called dynamic programming).
            So, if you can afford to let the computer do the calculations for you while you're doing something else, go ahead.
            Of course, you can also expand the product by hand yourself if you prefer.



            You can also combine both methods.
            This approach clearly suffers at higher values of $n$, because the number of monomials in the product expansion grows too fast with $n$.
            On the other hand, for higher values of $n$, $s$ is lower and we see from the example that the inductive reasoning becomes simpler, with less combinations to consider.



            Finally, this approach also tackles other variations of this problem, like specifying different sums for different subsets and also generalizing to ordered subsets.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
              $endgroup$
              – Roman Odaisky
              37 mins ago













            3












            3








            3





            $begingroup$

            I think the key is understanding that $0$ can go wherever and that every number must go somewhere.
            Set aside $0$ for the moment.



            When $n=5$ we have $s=9$. We can use an inductive reasoning as follows:




            • $9$ must be alone, so we get $9$ and that leaves $1,2,3,4,5,6,7,8$.


            • $8$ can only be paired with $1$ to reach $s=9$, so we get $1,8$ and that leaves $2,3,4,5,6,7$.


            • $7$ can only be paired with $2$ to reach $s = 9$, so we get $2,7$ and that leaves $3,4,5,6$.

            • Proceeding in this manner, we find that the subsets look like $big9, 1,8, 2,7, 3,6, 4,5big$.

            All that remains is to assign $0$ to some subset, so we get $5$ possibilities for $s=9$.




            When $n=3$ we have $s=15$ and things get slightly more complicated.
            We are still setting $0$ aside for this.



            First, notice that $9$ and $8$ must go towards different subsets.
            We will then find how to fill up the $9$ subset, and for each such manner, we'll find out how to fill up the $8$ subset.
            The remaining numbers will form their own subset.



            The idea behind this is that starting from the larger number is better because the remaining sum is smaller, so there are fewer options to consider.



            So, we have $1,2,3,4,5,6,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $6$.
            Now, proceeding as before, we find that the possibilities are $big6, 1,5, 2,4, 1,2,3big$.



            • If the $9$ susbset is $6,9$, we are left with $1,2,3,4,5,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $7$ (in order to complete the $8$ subset).
              We proceed as before and arrive at $big7, 2,5, 3,4, 1,2,4big$.
              This gives us $4$ additional possibilities before adding $0$.


            • If the $9$ susbset is $1,5,9$, we are left with $2,3,4,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 3,4big$.
              This gives us $2$ additional possibilities before adding $0$.


            • If the $9$ susbset is $2,4,9$, we are left with $1,3,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 1,6big$.
              This gives us $2$ additional possibilities before adding $0$.


            • Finally if the $9$ susbset is $1,2,3,9$, we are left with $4,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              Clearly, the only way is picking a lone $7$ which gives us $1$ additional possibility before adding $0$.


            So we have $9$ possibilities without $0$. For each such configuration, we have $3$ ways to assign $0$ to a subset, which gives us $9times 3 = 27$ total possibilities in the $n=3$ case.




            In total, this gives us $27+5 = 32$ possibilities.




            Now, this is a structured way of thinking to approach this problem (tackle the large numbers to reduce leftover sum possibilities), but there is of course a more... operational approach.
            Generating functions are a handy tool for any combinatorist to have.



            One way to consider this problem if you have computational power at hand is as follows.



            When $n=3$, we consider the product



            $$prod_i=0^9 (x_1^i+x_2^i+x_3^i).tag$*$$$



            Expanding this product, we'll find a sum of monomials of the form $ccdot x_1^ax_2^bx_3^c$.
            Each such monomial can be interpreted as follows: there are $c$ ways to partition the set $0,1,2,dots,9$ such that the first subset sums to $a$, the second subset sums to $b$ and the third subset sums to $c$.



            Indeed, when expanding the product, at each step we must choose which $x_i^j$ we're taking. Choosing $x_i^j$ means assigning the element $j$ from $0,1,2,dots,9$ to the $i$-th subset.



            Since we want all our subsets to sum to $s=15$, we're then interested in the coefficient of $x_1^15x_2^15x_3^15$ in the expansion of $(*)$.
            Of course, since we also don't care about the order of our subsets, we have to divide the end result by $3!$.



            When I say we don't care about the order of our subsets, I mean that the family of subsets $big0,6,9, 7,8, 1,2,3,4,5big$ is just as good as $big7,8, 1,2,3,4,5, 0,6,9big$ or any other permutation.



            You can check with Wolfram Online Notebooks (or your choice of math software) using 1/3! * Coefficient[Product[(x^i+y^i+z^i),i,0,9], x*y*z,15] that the answer comes out to $27$, like we did when counting by hand.



            Similarly, to count the number of possibilities for $n=5$ we'd look at



            $$frac15!left[x_1^9x_2^9x_3^9x_4^9x_5^9right]left(prod_i=0^9 (x_1^i+x_2^i+x_3^i+x_4^i+x_5^i)right).$$



            You can check with 1/5! * Coefficient[Product[(a^i+b^i+c^i+d^i+e^i),i,0,9], a*b*c*d*e, 9] that the answer comes out to $5$, like we did when counting by hand.



            I will say, however, that this is not a computationally cheap or fast way to obtain the answer (if you are interested in computationally feasible ways to approach this problem, it is traditionally handled with a technique called dynamic programming).
            So, if you can afford to let the computer do the calculations for you while you're doing something else, go ahead.
            Of course, you can also expand the product by hand yourself if you prefer.



            You can also combine both methods.
            This approach clearly suffers at higher values of $n$, because the number of monomials in the product expansion grows too fast with $n$.
            On the other hand, for higher values of $n$, $s$ is lower and we see from the example that the inductive reasoning becomes simpler, with less combinations to consider.



            Finally, this approach also tackles other variations of this problem, like specifying different sums for different subsets and also generalizing to ordered subsets.






            share|cite|improve this answer











            $endgroup$



            I think the key is understanding that $0$ can go wherever and that every number must go somewhere.
            Set aside $0$ for the moment.



            When $n=5$ we have $s=9$. We can use an inductive reasoning as follows:




            • $9$ must be alone, so we get $9$ and that leaves $1,2,3,4,5,6,7,8$.


            • $8$ can only be paired with $1$ to reach $s=9$, so we get $1,8$ and that leaves $2,3,4,5,6,7$.


            • $7$ can only be paired with $2$ to reach $s = 9$, so we get $2,7$ and that leaves $3,4,5,6$.

            • Proceeding in this manner, we find that the subsets look like $big9, 1,8, 2,7, 3,6, 4,5big$.

            All that remains is to assign $0$ to some subset, so we get $5$ possibilities for $s=9$.




            When $n=3$ we have $s=15$ and things get slightly more complicated.
            We are still setting $0$ aside for this.



            First, notice that $9$ and $8$ must go towards different subsets.
            We will then find how to fill up the $9$ subset, and for each such manner, we'll find out how to fill up the $8$ subset.
            The remaining numbers will form their own subset.



            The idea behind this is that starting from the larger number is better because the remaining sum is smaller, so there are fewer options to consider.



            So, we have $1,2,3,4,5,6,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $6$.
            Now, proceeding as before, we find that the possibilities are $big6, 1,5, 2,4, 1,2,3big$.



            • If the $9$ susbset is $6,9$, we are left with $1,2,3,4,5,7$ and we have to figure out in how many ways we can pick elements from it to reach a sum of $7$ (in order to complete the $8$ subset).
              We proceed as before and arrive at $big7, 2,5, 3,4, 1,2,4big$.
              This gives us $4$ additional possibilities before adding $0$.


            • If the $9$ susbset is $1,5,9$, we are left with $2,3,4,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 3,4big$.
              This gives us $2$ additional possibilities before adding $0$.


            • If the $9$ susbset is $2,4,9$, we are left with $1,3,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              We proceed as before and arrive at $big7, 1,6big$.
              This gives us $2$ additional possibilities before adding $0$.


            • Finally if the $9$ susbset is $1,2,3,9$, we are left with $4,5,6,7$ and we have to figure out in how many we can pick elements from it to reach a sum of $7$.
              Clearly, the only way is picking a lone $7$ which gives us $1$ additional possibility before adding $0$.


            So we have $9$ possibilities without $0$. For each such configuration, we have $3$ ways to assign $0$ to a subset, which gives us $9times 3 = 27$ total possibilities in the $n=3$ case.




            In total, this gives us $27+5 = 32$ possibilities.




            Now, this is a structured way of thinking to approach this problem (tackle the large numbers to reduce leftover sum possibilities), but there is of course a more... operational approach.
            Generating functions are a handy tool for any combinatorist to have.



            One way to consider this problem if you have computational power at hand is as follows.



            When $n=3$, we consider the product



            $$prod_i=0^9 (x_1^i+x_2^i+x_3^i).tag$*$$$



            Expanding this product, we'll find a sum of monomials of the form $ccdot x_1^ax_2^bx_3^c$.
            Each such monomial can be interpreted as follows: there are $c$ ways to partition the set $0,1,2,dots,9$ such that the first subset sums to $a$, the second subset sums to $b$ and the third subset sums to $c$.



            Indeed, when expanding the product, at each step we must choose which $x_i^j$ we're taking. Choosing $x_i^j$ means assigning the element $j$ from $0,1,2,dots,9$ to the $i$-th subset.



            Since we want all our subsets to sum to $s=15$, we're then interested in the coefficient of $x_1^15x_2^15x_3^15$ in the expansion of $(*)$.
            Of course, since we also don't care about the order of our subsets, we have to divide the end result by $3!$.



            When I say we don't care about the order of our subsets, I mean that the family of subsets $big0,6,9, 7,8, 1,2,3,4,5big$ is just as good as $big7,8, 1,2,3,4,5, 0,6,9big$ or any other permutation.



            You can check with Wolfram Online Notebooks (or your choice of math software) using 1/3! * Coefficient[Product[(x^i+y^i+z^i),i,0,9], x*y*z,15] that the answer comes out to $27$, like we did when counting by hand.



            Similarly, to count the number of possibilities for $n=5$ we'd look at



            $$frac15!left[x_1^9x_2^9x_3^9x_4^9x_5^9right]left(prod_i=0^9 (x_1^i+x_2^i+x_3^i+x_4^i+x_5^i)right).$$



            You can check with 1/5! * Coefficient[Product[(a^i+b^i+c^i+d^i+e^i),i,0,9], a*b*c*d*e, 9] that the answer comes out to $5$, like we did when counting by hand.



            I will say, however, that this is not a computationally cheap or fast way to obtain the answer (if you are interested in computationally feasible ways to approach this problem, it is traditionally handled with a technique called dynamic programming).
            So, if you can afford to let the computer do the calculations for you while you're doing something else, go ahead.
            Of course, you can also expand the product by hand yourself if you prefer.



            You can also combine both methods.
            This approach clearly suffers at higher values of $n$, because the number of monomials in the product expansion grows too fast with $n$.
            On the other hand, for higher values of $n$, $s$ is lower and we see from the example that the inductive reasoning becomes simpler, with less combinations to consider.



            Finally, this approach also tackles other variations of this problem, like specifying different sums for different subsets and also generalizing to ordered subsets.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited 2 hours ago

























            answered 2 hours ago









            FimpellizieriFimpellizieri

            17.5k11836




            17.5k11836











            • $begingroup$
              I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
              $endgroup$
              – Roman Odaisky
              37 mins ago
















            • $begingroup$
              I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
              $endgroup$
              – Roman Odaisky
              37 mins ago















            $begingroup$
            I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
            $endgroup$
            – Roman Odaisky
            37 mins ago




            $begingroup$
            I wonder if symmetric polynomial theory would be of any help here. It doesn’t seem to simplify things all that much though...
            $endgroup$
            – Roman Odaisky
            37 mins ago

















            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%2f3229913%2fin-how-many-ways-can-we-partition-a-set-into-smaller-subsets-so-the-sum-of-the-n%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

            19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу

            Israel Cuprins Etimologie | Istorie | Geografie | Politică | Demografie | Educație | Economie | Cultură | Note explicative | Note bibliografice | Bibliografie | Legături externe | Meniu de navigaresite web oficialfacebooktweeterGoogle+Instagramcanal YouTubeInstagramtextmodificaremodificarewww.technion.ac.ilnew.huji.ac.ilwww.weizmann.ac.ilwww1.biu.ac.ilenglish.tau.ac.ilwww.haifa.ac.ilin.bgu.ac.ilwww.openu.ac.ilwww.ariel.ac.ilCIA FactbookHarta Israelului"Negotiating Jerusalem," Palestine–Israel JournalThe Schizoid Nature of Modern Hebrew: A Slavic Language in Search of a Semitic Past„Arabic in Israel: an official language and a cultural bridge”„Latest Population Statistics for Israel”„Israel Population”„Tables”„Report for Selected Countries and Subjects”Human Development Report 2016: Human Development for Everyone„Distribution of family income - Gini index”The World FactbookJerusalem Law„Israel”„Israel”„Zionist Leaders: David Ben-Gurion 1886–1973”„The status of Jerusalem”„Analysis: Kadima's big plans”„Israel's Hard-Learned Lessons”„The Legacy of Undefined Borders, Tel Aviv Notes No. 40, 5 iunie 2002”„Israel Journal: A Land Without Borders”„Population”„Israel closes decade with population of 7.5 million”Time Series-DataBank„Selected Statistics on Jerusalem Day 2007 (Hebrew)”Golan belongs to Syria, Druze protestGlobal Survey 2006: Middle East Progress Amid Global Gains in FreedomWHO: Life expectancy in Israel among highest in the worldInternational Monetary Fund, World Economic Outlook Database, April 2011: Nominal GDP list of countries. Data for the year 2010.„Israel's accession to the OECD”Popular Opinion„On the Move”Hosea 12:5„Walking the Bible Timeline”„Palestine: History”„Return to Zion”An invention called 'the Jewish people' – Haaretz – Israel NewsoriginalJewish and Non-Jewish Population of Palestine-Israel (1517–2004)ImmigrationJewishvirtuallibrary.orgChapter One: The Heralders of Zionism„The birth of modern Israel: A scrap of paper that changed history”„League of Nations: The Mandate for Palestine, 24 iulie 1922”The Population of Palestine Prior to 1948originalBackground Paper No. 47 (ST/DPI/SER.A/47)History: Foreign DominationTwo Hundred and Seventh Plenary Meeting„Israel (Labor Zionism)”Population, by Religion and Population GroupThe Suez CrisisAdolf EichmannJustice Ministry Reply to Amnesty International Report„The Interregnum”Israel Ministry of Foreign Affairs – The Palestinian National Covenant- July 1968Research on terrorism: trends, achievements & failuresThe Routledge Atlas of the Arab–Israeli conflict: The Complete History of the Struggle and the Efforts to Resolve It"George Habash, Palestinian Terrorism Tactician, Dies at 82."„1973: Arab states attack Israeli forces”Agranat Commission„Has Israel Annexed East Jerusalem?”original„After 4 Years, Intifada Still Smolders”From the End of the Cold War to 2001originalThe Oslo Accords, 1993Israel-PLO Recognition – Exchange of Letters between PM Rabin and Chairman Arafat – Sept 9- 1993Foundation for Middle East PeaceSources of Population Growth: Total Israeli Population and Settler Population, 1991–2003original„Israel marks Rabin assassination”The Wye River Memorandumoriginal„West Bank barrier route disputed, Israeli missile kills 2”"Permanent Ceasefire to Be Based on Creation Of Buffer Zone Free of Armed Personnel Other than UN, Lebanese Forces"„Hezbollah kills 8 soldiers, kidnaps two in offensive on northern border”„Olmert confirms peace talks with Syria”„Battleground Gaza: Israeli ground forces invade the strip”„IDF begins Gaza troop withdrawal, hours after ending 3-week offensive”„THE LAND: Geography and Climate”„Area of districts, sub-districts, natural regions and lakes”„Israel - Geography”„Makhteshim Country”Israel and the Palestinian Territories„Makhtesh Ramon”„The Living Dead Sea”„Temperatures reach record high in Pakistan”„Climate Extremes In Israel”Israel in figures„Deuteronom”„JNF: 240 million trees planted since 1901”„Vegetation of Israel and Neighboring Countries”Environmental Law in Israel„Executive branch”„Israel's election process explained”„The Electoral System in Israel”„Constitution for Israel”„All 120 incoming Knesset members”„Statul ISRAEL”„The Judiciary: The Court System”„Israel's high court unique in region”„Israel and the International Criminal Court: A Legal Battlefield”„Localities and population, by population group, district, sub-district and natural region”„Israel: Districts, Major Cities, Urban Localities & Metropolitan Areas”„Israel-Egypt Relations: Background & Overview of Peace Treaty”„Solana to Haaretz: New Rules of War Needed for Age of Terror”„Israel's Announcement Regarding Settlements”„United Nations Security Council Resolution 497”„Security Council resolution 478 (1980) on the status of Jerusalem”„Arabs will ask U.N. to seek razing of Israeli wall”„Olmert: Willing to trade land for peace”„Mapping Peace between Syria and Israel”„Egypt: Israel must accept the land-for-peace formula”„Israel: Age structure from 2005 to 2015”„Global, regional, and national disability-adjusted life years (DALYs) for 306 diseases and injuries and healthy life expectancy (HALE) for 188 countries, 1990–2013: quantifying the epidemiological transition”10.1016/S0140-6736(15)61340-X„World Health Statistics 2014”„Life expectancy for Israeli men world's 4th highest”„Family Structure and Well-Being Across Israel's Diverse Population”„Fertility among Jewish and Muslim Women in Israel, by Level of Religiosity, 1979-2009”„Israel leaders in birth rate, but poverty major challenge”„Ethnic Groups”„Israel's population: Over 8.5 million”„Israel - Ethnic groups”„Jews, by country of origin and age”„Minority Communities in Israel: Background & Overview”„Israel”„Language in Israel”„Selected Data from the 2011 Social Survey on Mastery of the Hebrew Language and Usage of Languages”„Religions”„5 facts about Israeli Druze, a unique religious and ethnic group”„Israël”Israel Country Study Guide„Haredi city in Negev – blessing or curse?”„New town Harish harbors hopes of being more than another Pleasantville”„List of localities, in alphabetical order”„Muncitorii români, doriți în Israel”„Prietenia româno-israeliană la nevoie se cunoaște”„The Higher Education System in Israel”„Middle East”„Academic Ranking of World Universities 2016”„Israel”„Israel”„Jewish Nobel Prize Winners”„All Nobel Prizes in Literature”„All Nobel Peace Prizes”„All Prizes in Economic Sciences”„All Nobel Prizes in Chemistry”„List of Fields Medallists”„Sakharov Prize”„Țara care și-a sfidat "destinul" și se bate umăr la umăr cu Silicon Valley”„Apple's R&D center in Israel grew to about 800 employees”„Tim Cook: Apple's Herzliya R&D center second-largest in world”„Lecții de economie de la Israel”„Land use”Israel Investment and Business GuideA Country Study: IsraelCentral Bureau of StatisticsFlorin Diaconu, „Kadima: Flexibilitate și pragmatism, dar nici un compromis în chestiuni vitale", în Revista Institutului Diplomatic Român, anul I, numărul I, semestrul I, 2006, pp. 71-72Florin Diaconu, „Likud: Dreapta israeliană constant opusă retrocedării teritoriilor cureite prin luptă în 1967", în Revista Institutului Diplomatic Român, anul I, numărul I, semestrul I, 2006, pp. 73-74MassadaIsraelul a crescut in 50 de ani cât alte state intr-un mileniuIsrael Government PortalIsraelIsraelIsraelmmmmmXX451232cb118646298(data)4027808-634110000 0004 0372 0767n7900328503691455-bb46-37e3-91d2-cb064a35ffcc1003570400564274ge1294033523775214929302638955X146498911146498911

            Кастелфранко ди Сопра Становништво Референце Спољашње везе Мени за навигацију43°37′18″ СГШ; 11°33′32″ ИГД / 43.62156° СГШ; 11.55885° ИГД / 43.62156; 11.5588543°37′18″ СГШ; 11°33′32″ ИГД / 43.62156° СГШ; 11.55885° ИГД / 43.62156; 11.558853179688„The GeoNames geographical database”„Istituto Nazionale di Statistica”проширитиууWorldCat156923403n850174324558639-1cb14643287r(подаци)