I am not sure if this is even possible theoretically; but if so, I would like to know how to do this in Python.
I want to generate a large random permutation cheaply. For example, let's say that I want a permutation on range(10**9). I want the permutation to be homogeneous (i.e., I want the numbers everywhere without any apparent structure.) I want to have a function available to get the nth element in the permutation for each n, and I want to have one more function available to get the index of each number in the permutation.
And the big, final condition is the following: I want to do all this without saving all the elements of the permutation. (Which can be a huge space.) I want every element to be accessible, but I don't want to store all the elements, for example rangein Python 3.
Is it possible?
source
share