- You have a set X of letters
- Randomly select a letter L from X (using e.g. randperm)
- Put that letter L at position k in the sequence of letters S
- Remove L from X
- Get the letter at position S(k-2) and put that back into X
- Return to 1 until you filled the whole array
- select 20 random positions i (using randperm)
- Set the letters at positions i+2 to the letters at position i (S(i+2) = S(i))