I thought combinations usualy meant all possible (groupings? subsets?) of one or more elements of the original set. "One or more elements selected from a set without regard to the order of selection." -- dictionary.com I'm no set theory expert and dictionary.com certainly isn't the be all end all source of mathematicaly truth. So what other definition of combinations do you have AND how would you implement it in perl6 ;)
| [reply] |
Sorry for the lack of explanation. Combinations has a mathematinal definition more specialized and distinct from the usual dictionary version. Combinations are all the subsets of a set of a given size. So for the set (1,2,3,4) the combination of subsets with 2 elements is ((1,2),(1,3),(1,4),(2,3),(2,4),(3,4). The number of cominations of 4 elements chosen 2 at a time is called "4 choose 2)" or sometimes C(4,2) and in this case is equal to 6.
If one puts all the subsets generated from 4 choose 0, 4 choose 1, ..., 4 choose 4 into a set, that set of sets is called a power set of the original set.
I would implement combinations in p5 and then use the mythical p5 to p6 converter :) Just joking, but I haven't dived into p6 yet.
| [reply] |