Fundamentally you want to make a random permutation, but not spend linear memory on it, as you would if you did it by shuffling.