Geoff

35 Reputation

8 Badges

0 years, 233 days

MaplePrimes Activity


These are questions asked by Geoff

Groupings([a, b, ..., n], k)

Is there a built-in function in Maple that generates all possible groupings of the elements [a, b, ..., n] taken k at a time?

Example:

Groupings([a,b,c,d], 2)

Expected output:

[[[[a, b], c], d], [a, [[b, c], d]], [[a, [b, c]], d], [a, [b, [c, d]]], [[a, b], [c, d]]]

Page 1 of 1