In your example, the inputs are an ordered set and null sets aren’t allowed?

I think would have expected to see an unordered result:

{ p } { q r } { s }
{ p } { q s } { r }
{ p q } { r } { s }
{ p r } { q } { s }
{ p s } { q } { r }
{ p } { q } { r s 

If it’s an ordered set, then this would be the result?

{ p } { q r } { s }
{ p q } { r } { s }
{ p } { q } { r s }

I don’t think we have a word exactly like either, but it wouldn’t be that much 
to add it. We can help you code it, and take pull requests, or implement it 
given a good idea of the spec you are looking for. 

Your link reminds me of this blog post I wrote awhile ago. Maybe it helps. 

http://re-factor.blogspot.com/2010/05/evenly-partition-integer.html

Best,
John.

> On Apr 25, 2020, at 7:45 PM, Luca Di Sera <bloodtype.si...@gmail.com> wrote:
> 
> 
> I don't think they are the same thing.
> 
> I apologize as I seem to have forgotten to provide a correct explanation of 
> what I'm looking for.
> 
> By a partition  of a set S I mean a collection of non-empty subsets of S that 
> are disjoint and which union is S.
> 
> e.g { { p q r } { s } } is a partition of { p q r s }.
> 
> A k-partition is a partition formed by exactly k subsets.
> Thus { { p q } { r } { s } }, { { p } { q r } { s } } and { { p } { q r } { s 
> } } are the 3-partitions of { p q r s }.
> 
> ( For integer Partitions of a positive integer n, instead, we mean a multiset 
> of positive integers which sum is n it seems from what I learned today ). 
> 
> Permutations and Partitions should be different mathematical objects for the 
> small amount of knowledge I have.
> 
> Now, I have no idea if partitions can be generated from permutations or if 
> I'm missing something ( that is maybe obvious )(my knowledge is really 
> limited on combinatorics and other parts of mathematics for now ), so I 
> apologize if that is the case.
> 
> 
> Il dom 26 apr 2020, 03:15 John Benediktsson <mrj...@gmail.com> ha scritto:
>> Is “K partitions” the same as “K permutations”?
>> 
>> https://docs.factorcode.org/content/word-__lt__k-permutations__gt__,math.combinatorics.html
>> 
>> 
>> 
>>> On Apr 25, 2020, at 6:46 PM, Luca Di Sera <bloodtype.si...@gmail.com> wrote:
>>> 
>>> 
>>> I was studying Unger's Parsers and was in need of a way to generate the 
>>> k-partitions of the input string.
>>> 
>>> I wasn't able to find it neither in math.combinatorics,splitting, grouping 
>>> or by a general search.
>>> I'm currently working on implementing one myself from the integer 
>>> partitioning in this paper ( 
>>> http://www.nakano-lab.cs.gunma-u.ac.jp/Papers/e90-a_5_888.pdf ) but would 
>>> gladly use something that is already present in factor.
>>> 
>>> So, is there any word ( or simple combination of words ) that I'm somehow 
>>> missing that will let me build the k-partitions of a sequence/string?
>>> _______________________________________________
>>> Factor-talk mailing list
>>> Factor-talk@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>> _______________________________________________
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to