"Randomize" output of a Linear Feedback Shift Register for the same taps?

1.5k Views Asked by At

I'm using a (Galois) LFSR to sample a large array, ensuring that each entry is only visited once. I simply skip past the entries that exceed the array length.

With the same taps then the array entry a is naturally always followed by b.

However, I would like to be able to modify the output with a seed, causing the output for each seed to be different.

A quick and dirty method I used is:

If the current index is a, the "seed" x is 1 or larger and the max index is l:

Calculate a+x and find the next entry in the sequence from that number (a+x), continue until we have a number b in the range x < b < x + l. Calculate b-x, this is the next index.

In other words I shift the sample from the sequence by x.

This sort of works, but isn't very elegant. Are there other possibilities?


Edit: I added a few extra tags, because the comments revealed that in place of LFSRs the OP is also interested in other methods of quickly generating largish sets of permutations of an array with length up to thousands. Hopefully I did not distort the intent, JL.