I have given a permutation let
2 3 1 5 4 that is if initially my string is 1 2 3 4 5
the after one permutation it will become
- 1 2 3 4 5
- 3 1 2 5 4
that is the number in first position will go to 2 nd position ,the number in 2 nd position will go to 3rd position
now i need find that how many round i need to go back to 1 2 3 4 5 again for this permutation it will be 6
- 1 2 3 4 5
- 3 1 2 5 4
- 2 3 1 4 5
- 1 2 3 5 4
- 3 1 2 4 5
- 2 3 1 5 4
- 1 2 3 4 5.
my solution is in the given permutation i need to find the number of cycles and the answer will be the lcm of length of all the cycles for that i need to find the number of cycles in the permutation.for example her it is 2 cycles 2 3 1 5 4 - one is 2 3 1 -length 3 another is 5 4 -length 2 so turn is 6 please suggest some way and also suggest if my answer is correct ??
I think your intiution about cycles is correct 1,2 and 3 do appear at their positions after 3 changes, and 4 and 5 after 2 changes. So minimum changes would be lcm(3,2)=6.Yes your answer is correct.And any other method would probably be longer than this.