[R] combinatorics
Robin Hankin
r.hankin at noc.soton.ac.uk
Fri Oct 13 16:18:56 CEST 2006
Hi
How do I generate all ways of ordering sets of indistinguishable items?
suppose I have two A's, two B's and a C.
Then I want
AABBC
AABCB
AACBC
ABABC
. . .snip...
BBAAC
. . .snip...
CBBAA
[there are 5!/(2!*2!) = 30 arrangements. Note AABBC != BBAAC]
How do I do this?
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
tel 023-8059-7743
More information about the R-help
mailing list