Random suffix permutation
and corresponding Lyndon word


A same applet for all kinds of words is available.
Reference

J.-P. Duval and A. Lefebvre, Words over an ordered alphabet and suffix permutations, RAIRO/Theoretical Informatics and Applications 36, 249--259, 2002
 
Arnaud Lefebvre