Post Reply 
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Symbolic Combinations and Permutations question. - Helge Gabert - 01-13-2015 01:17 AM



User(s) browsing this thread: 2 Guest(s)