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$?

Difference between good and not so good university?

Is my company merging branches wrong?

On a piano, are the effects of holding notes and the sustain pedal the same for a single chord?

Gambler's Fallacy Dice

Can a Warforged have a ranged weapon affixed to them like an armblade?

Why were early aviators' trousers flared at the thigh?

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

In Dutch history two people are referred to as "William III"; are there any more cases where this happens?

How could Dwarves prevent sand from filling up their settlements

How could the B-29 bomber back up under its own power?

How can sister protect herself from impulse purchases with a credit card?

Why does string strummed with finger sound different from the one strummed with pick?

How do you play the middle D and F in this passage?

Addressing an email

Why didn't Daenerys' advisers suggest assassinating Cersei?

Bash Read: Reading comma separated list, last element is missed

Precedent for disabled Kings

Does a windmilling propeller create more drag than a stopped propeller in an engine out scenario

What does this 'x' mean on the stem of the voice's note, above the notehead?

Managing heat dissipation in a magic wand

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

How do we explain the use of a software on a math paper?

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

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



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
    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
    2 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
    2 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
    2 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
    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
    2 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
    2 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
    2 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 3 hours ago







Borna Ghahnoosh

















asked 4 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
    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
    2 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
    2 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
    2 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
    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
    2 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
    2 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
    2 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
3 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
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
2 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
2 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
2 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
2 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
2 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
2 hours ago











2 Answers
2






active

oldest

votes


















4












$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$




















    0












    $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$













      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









      4












      $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$

















        4












        $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$















          4












          4








          4





          $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 3 hours ago









          Borna Ghahnoosh

          1146




          1146










          answered 3 hours ago









          InterstellarProbeInterstellarProbe

          3,986931




          3,986931





















              0












              $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$

















                0












                $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$















                  0












                  0








                  0





                  $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 1 hour ago

























                  answered 1 hour ago









                  FimpellizieriFimpellizieri

                  17.5k11836




                  17.5k11836



























                      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

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單