An variant of Knuth shuffle
问题 This is a very hard but interesting probability question related to Knuth shuffle. When looping for each element, the swap is performed for the current element with any random element from the whole array (not within the elements left), then what is the probabilty of the original i th element ending up at the j th position? 回答1: The Knuth shuffle is as follows (in Python, but it could be pseudocode) for i in range(len(v)): swap(v, i, randrange(i, len(v)) The naïve shuffle is very similar, but