Compute permutation cycles of sets
Hello. Just to start, I am asking about something that I don't fully understand the terminology around yet so I will try but I apologize if there is some confusion. I am trying to find all the possible combinations of these sets (included below) which I started doing by hand but I would like to automate it with matlab to speed finding all the combinations.
a (1 3 2 4)(5 7 6 8)
b (1 4 2 3)(5 8 6 7)
c (1 5 2 6)(3 8 4 7)
d (1 8 2 7)(3 6 4 5)
e (1 6 2 5)(3 7 4 8)
f (1 7 2 8)(3 5 4 6)
g (1 2)(3 4)(5 6)(7 8)
Just in case I am mixing up the terminology, here is an example of what I am trying to do.
ac = (1 3 2 4)(5 7 6 8)(1 5 2 6)(3 8 4 7) = (1 8 2 7)(3 6 4 5) = d
I was looking at the perms() function but I am not sure how to use it to accomplish this type of result.
Thank you for any help and suggestions.
2 个评论
回答(1 个)
- https://en.wikipedia.org/wiki/Cyclic_permutation
- https://en.wikipedia.org/wiki/Permutation#Cycle_notation
- https://en.wikipedia.org/wiki/Permutation#Cycle_notation:~:text=unless%20otherwise%20specified.-,Two%2Dline,-notation%5Bedit
- https://www.mathworks.com/help/matlab/ref/combinations.html
0 个评论
另请参阅
类别
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!