|
|
|
|
|
by byronvickers
960 days ago
|
|
Weird to see this show up on HN - I was just looking at this page a couple of days ago. I have a little puzzle I've been trying to solve in my spare time; maybe someone here can point me in the right direction. The puzzle is: given a float from Math.random(), suppose you know only whether it is greater than it is then 0.5 (i.e you only see the result of a coin flip which depends on Math.random()). What is a practical method to reverse out the state of the xorshift+ generator, given multiple such successive observations of the output? Any input appreciated! |
|
There are a series of challenges called "fastrology" from PlaidCTF 2023, which is about predicting Math.random() given some partial output (e.g. Math.floor(Math.random() * k)) with several variants. You can try to find writeups for that challenges, those solvers should be easy to adapt to predicting Math.random()>0.5 .