vendredi 1 février 2019

How to Generate a 'Future-Index' Pseudo-Random Number Without Generating Its Preceding Numbers

Context:

Let's consider a random-number set of 10 integer elements generated by one of the PRNG-C++ approaches using a fixed seed integer, i.e. const int seedMe = 31:

0 1 2 3 4 5 6 7 8 9

Question:

Assuming pseudo-random number generators generate fixed number sequences, which are determined by the seed.

  • For the known seed (seedMe) and the known set size (10), is it conceptually possible to generate the random number corresponding to the index N in advance? For example, generation of the 3rd element of the above set without generating the preceding 0 1 2.
  • If so, is there any practical example of such practice in C++?

Aim of the Question:

For known seed and set size, in my parallel computations, a 1-D random-number global-set is needed, which should be the same for each processor.

Each processor uses a subset of the global-set, and accordingly, a priori knows the global-set indices for the subset. For example, for a 2-processor computation, the first processor needs only i = [0, 4] indexed-random numbers, and the second proc i = [5, 9] indexed ones.

I wonder if we can directly and locally generate the subsets of a global-PRNG set at each processor, hence the discard of any need for parallel communication of any sort.




Aucun commentaire:

Enregistrer un commentaire