Well... it could not really be a bitmap for this design unless you limited it to two partitions.
That said, if I remember right, Erling Hellenäs was generating a similar data structure (to be the left argument to </. ) in the various parRuskey implementations. Thanks, -- Raul On Tue, Nov 14, 2017 at 1:37 AM, 'Skip Cave' via Programming <[email protected]> wrote: > This thread has been an interesting exploration of the many ways to > implement > "all combinations of y unique items, x items at a time". I like the idea > that these > combination verbs produce a bitmap that can be used to select from a list > of > unique items to produce the final combinations. > > Does it make sense to use this same technique to generate a partition verb > which produces a bitmap, which can then be used to partition a list of > unique items > showing "all ways to partition y objects into x partitions"? > Would the combination verbs developed previously help simplify the > partition verb? > > Partition verb rules: > 1. The par verb is a dyadic verb: x par y where x is the number of > partitions (boxes) > & y is the number of unique items to be partitioned (boxed). > > 2. The par verb should generate all the ways that y items can be > partitioned into > x partitions (containers). Each row in the output will show a different > allocation > of the y items. > > 3. The partition verb should produce a partitioned bitmap which can be used > to > select items from the list y, and place them in the appropriate partitions. > > 4. Every partition must have at least one item in it. (no empty partitions) > > 5. Every item can only appear once in each partition trial (row). > > 6. Re-ordering the items in a single partition does not create a new unique > partition. > > 5. Re-ordering partitions where the same items are still in each partition, > is not a new > partition trial. > > The result of x par y should be a bitmap such that (x par y) f list will > show > all the possible ways to partition y items in x partitions > > 2 par 3 > > ┌─────┬─────┐ > > │1 1 0 │0 0 1 │ > > ├─────┼─────┤ > > │1 0 1 │0 1 0 │ > > ├─────┼─────┤ > > │0 1 1 │1 0 0 │ > > └─────┴─────┘ > > > NB. now what is 'f': > > > (2 par 3) f 'abc' > > ┌──┬─┐ > > │ab│c│ > > ├──┼─┤ > > │ac│b│ > > ├──┼─┤ > > │bc│a│ > > └──┴─┘ > > > Skip > > Skip Cave > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
