Is it possible to get the true generating function of a PRNG?

72 Views Asked by At

Since every sequence of pseudo-random numbers must be generated by deterministic means, it has to follow some underlying mathematical expression (function-like I guess). Suposse you intend to get this underlying expression in order to predict the output of the PRNG. Even if you could predict the next pseudo-random number that the expression will generate every single time for a billion iterations (say $n$), you could never be sure that the process will not backfire at any given moment, as a consequence of the underlying expression being defined by some piecewise function of the kind:

$$ \forall x; g(x) = \delta$$ $$g'(x) = \left\{ \begin{array}{ll} \delta & \text{if}\quad x < n \\ \delta' & \text{if}\quad x \geq n \end{array} \right.$$

Where $\delta$ and $\delta'$ are distinct mathematical expressions as a function of x and $n$ is an arbitrarily large threshold. I have to attempt such a feat (predicting the next random number that a PRNG will output) with machine learning tools, and this observation, although perhaps of triviality, may be of importance, at least to clear out that I will not be able to find any definite solutions to the task, only partial and working solutions.

My issue is that I lack solid or even basic knowledge of the fundamentals of mathematical proving, and I am not even sure if the above counts as a rigurous proof, or if there is a way to formally express the thought. My inquiry would be to know if I am mistaken in my assessment and, otherwise, to obtain a formal proof to include this in my work in a respectable manner. Any thoughts and remarks are welcomed.

1

There are 1 best solutions below

0
On

A PRNG keeps some internal state, call it $s_n$ at time $n$, and return values $v_n$:

$\begin{align*} s_{n + 1} &= g(s_n) \\ v_n &= f(s_n) \end{align*}$

For some PRNGs, $v_n$ is just $s_n$, but most of them have $s_n$ much larger (much more bits) than $v_n$.

Typically the innards of the PRNG are known (i.e., you know $f, g$), so given enough values $v_k$ the state at some time $n$ is determined, and then you can compute any other values. But "good" PRNGs (even more so ones for cryptographic use) are built so that the above, while possible in principle, is computationally unfeasible (as far as current knowledge goes, anyway).