You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I reached this repo while looking for R packages for computing multiset partitions, but I may be misunderstanding the documentation. I tried with partitionsGeneral, but I don't understand the output.
To set a common ground, let me use an example. Let's take the multiset $M=\{1,1,2,3\}$. All the possible partitions would be:
$\{1,1,2,3\}$
$\{1\},\{1,2,3\}$
$\{2\},\{1,1,3\}$
$\{3\},\{1,1,2\}$
$\{1,1\},\{2,3\}$
$\{1,2\},\{1,3\}$
$\{1\},\{1\},\{2,3\}$
$\{1\},\{2\},\{1,3\}$
$\{1\},\{3\},\{1,2\}$
$\{2\},\{3\},\{1,1\}$
$\{1\},\{1\},\{2\},\{3\}$
Is it possible to get this with this package?
The text was updated successfully, but these errors were encountered:
Currently, the partition functions in RcppAlgos are for integer partitions. For example, if you want to find all of the partitions of 5 of length 3, we would do something like:
Thanks for the pointer, but the partitions package supports set partitions, as you said, which is not the same problem as multiset partitions. Citing Knuth in The Art of Computer Programming (section 7.2.1.5),
Partitions of a multiset. The partitions of an integer and the partitions of a set are just the extreme cases of a far more general problem, the partitions of a multiset. Indeed, the partitions of $n$ are essentially the same as the partitions of $\{1 , 1 , ...,1 \}$, where there are $n$ 1s.
I was hoping that this is what I was looking for, but it's not clear to me where this is called from the R interface.
I reached this repo while looking for R packages for computing multiset partitions, but I may be misunderstanding the documentation. I tried with
partitionsGeneral
, but I don't understand the output.To set a common ground, let me use an example. Let's take the multiset$M=\{1,1,2,3\}$ . All the possible partitions would be:
Is it possible to get this with this package?
The text was updated successfully, but these errors were encountered: