vendredi 5 octobre 2018

surjective unique uniform distributed random choice generator

How can I implement a generator function to generate some values from a domain which should be uniformly random distributed over the range of output data.

I want the randomly chosen values be unique and never be chosen again

for example if my range be:

A, B, C, D, E, F, H, I

I want get E in some iteration and for example B in next one and never get these two again.

The data is not pre-populated so pop is not a solution and can be very large in volume so pre-generating and shuffling data is not a solution too
So I want to use a generator function to generate them.

I thought about LFSR bijection mapping function but is there a better solution for this?




Aucun commentaire:

Enregistrer un commentaire