Solving a "twisty puzzle" on $S_{20}$
$(TRTLTR)^{17}=(1,2)$, an adjacent transposition (product from right to left). Together with the cycle $R$, it generates $S_{20}$. So it's always possible to solve the puzzle.
- The other adjacent transpositions: $(i,i+1)=L^{i-1}(1,2)R^{i-1}$ for $1<i<20$ and $(20,1)=R(1,2)L$.
- The transpositions $(1,i)$ are built as follows: $(1,3)=(1,2)(2,3)(1,2)$, then $(1,4)=(1,3)(3,4)(1,3)$, etc.
- The general transposition $(i,j)=(1,i)(1,j)(1,i)$.
- Now that all transpositions are built, a general cycle $(a_1,a_2,\dots,a_p)=(a_1,a_2)(a_2,a_3)\cdots(a_{p-1},a_p)$.
- Now that all cycles are built, use the cycle decomposition of any permutation.
The procedure is systematic, but does not necessarily produce the shortest sequence of products of $L, T$ and $R$ to achieve a given permutation.