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

            ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

            Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

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