Partition a set into n subsets with elements with sum equal to m

429 Views Asked by At

For example, given the set $a_n = \frac{n}{20}$ for $\,n \in \{1,\,2,\,\dots,\,19\}$, I would like to get all possible partitions of this set in 4 subsets such that the sum of their elements is always equal to 1.

Would you be so kind to write an algorithm in Mathematica, Matlab, or even in Excel?

Thank you very much!

Manuela

1

There are 1 best solutions below

2
On BEST ANSWER

This is simply not possible. If such a partitioning were indeed possible, then, by adding all $4$ subsets together, we would get that $\underbrace{1+1+1+1}_4=\sum_{n=1}^{19}\dfrac n{20}=\dfrac1{20}\sum_{n=1}^{19}n=\dfrac1{20}\cdot\dfrac{20\cdot19}2=\dfrac{19}2\neq4$. See Faulhaber's formulas for more details.