Jump to content
Sign in to follow this  
JulioHerrlein

Permute Function Question

Recommended Posts

I need a function to filter the Permutations.

 

For example:

 

(gen-divide 2 (flatten (permute (pcs '4-1))))

 

Will result in:

 

((0 1) (2 3) (0 1) (3 2) (0 2) (1 3) (0 2) (3 1) (0 3) (1 2) (0 3) (2 1) (1 0)
 (2 3) (1 0) (3 2) (1 2) (0 3) (1 2) (3 0) (1 3) (0 2) (1 3) (2 0) (2 0) (1 3)
 (2 0) (3 1) (2 1) (0 3) (2 1) (3 0) (2 3) (0 1) (2 3) (1 0) (3 0) (1 2) (3 0)
 (2 1) (3 1) (0 2) (3 1) (2 0) (3 2) (0 1) (3 2) (1 0))

 

But I don't mind with the order, since I'll make chords out of it, so

 

((0 1) (2 3) or (0 1) (3 2) or (1 0) (2 3)  will result in the same chord.

 

How to filter the list onto a list where the order does not matter ?

 

Best,

 

Julio

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×