Jump to content

Recommended Posts

Posted

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

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy