Search code examples
randomstatisticsrandom-walk

Can you construct a deterministic infinite RNG with just a few known parameters?


I'm currently using a cone-based random walk with reflections at the boundaries (denoted R[n]), with the following properties:

  • R[n] is always in a user defined range (called the boundaries) [a, b] (or [-a, a] if that's easier)
  • R[0] is defined by the user
  • |R[n]-R[n-1]|<d for some d <= b - a (this is the cone property)
  • If the generated R[n] falls outside the boundaries, reflect it across the nearest boundary so that no probability mass is accumulated at the edge

You can see a visualization of this process here (R[0] is "R" in the graphic): R in the graphic is R[0]

As you can see, the red points are reflections, and the dashed lines represent the "cone"

This is very nice process for several reasons:

  • It uniformly walks the range
  • It has a well defined expected value, namely (b-a)/2
  • It's not quite as chaotic as Uni[a, b], which is nice for modelling real world drifts in e.g., sensor error.

However, the one flaw of this method is that to reconstruct the walk, you need to record every single point of the walk. I'd like to have a process that has these properties, but can also be regenerated using just a few initial parameters.

Is this possible?


Solution

  • You can do it with a "few" parameters provided at least one of those parameters has an infinite number of bits. For an infinite PRNG you need it to be capable of having an infinite number of possible states.

    Given that your computer only has a finite memory then you will have to content yourself with a large, but finite, number of states. Once the PRNG has cycled through all possible states it will start to repeat because it is a deterministic machine.