I tried print out 128 last bits (128 math.random calls), but I do not
see the pattern. How does the prediction work ?
You can try it on lua 5.4.0-work1
function last128()
for i=1,128 do io.write(math.random(0) & 1) end
end
It's not trivial. There's not a visible pattern but you can do math to reverse-engineer the internal state with that data. I don't know the technique myself.
/s/ Adam
If what you are saying is true, period of last128() is also 2^128 - 1, all unique.
Each last128() map 1-to-1 to 2^128 - 1 internal states.
one last128() pattern will never occurs. (all zeroes ?)