Symbolic Combinations and Permutations question.
|
01-13-2015, 01:17 AM
Post: #2
|
|||
|
|||
RE: Symbolic Combinations and Permutations question.
I don't know of any one built-in command that would do that, but the Prime, being fully programmable, allows you do something along these lines
EXPORT YOURNAME(n) BEGIN LOCAL a,l:={},ll:={},j:=1,k:=1; a:=SIZE(n); FOR j FROM 1 TO a-1 DO FOR k FROM j+1 TO a DO l:={{n(j),n(k)}}; ll:=CONCAT(ll,l); END; END; RETURN ll; END; This will give you your desired pairs of combinations, and the code can be extended to return triplets, quadruplets, etc. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Symbolic Combinations and Permutations question. - John P - 01-12-2015, 07:38 PM
RE: Symbolic Combinations and Permutations question. - Helge Gabert - 01-13-2015 01:17 AM
RE: Symbolic Combinations and Permutations question. - John P - 01-13-2015, 02:09 AM
RE: Symbolic Combinations and Permutations question. - Han - 01-13-2015, 02:53 AM
RE: Symbolic Combinations and Permutations question. - John P - 01-13-2015, 03:57 AM
|
User(s) browsing this thread: 2 Guest(s)