|
![](/i/fill.gif) |
On 22/06/2011 06:50 PM, Warp wrote:
> Invisible<voi### [at] dev null> wrote:
>> This is great if you just want to produce a really long stream of random
>> numbers. But are there any PRNGs out there which offer random (!) access
>> to the stream of numbers? In other words, the ability to compute the Nth
>> random number without needing to compute any of the preceding ones?
>
> You could use a hashing function to convert N to a pseudorandom number,
> and it should work exactly as you describe.
Yeah, that's about what I figured.
You could use a cryptographic hash function, but these usually provide
strong guarantees about secrecy, etc. which aren't required if you just
want psuedo-random numbers for simulation purposes. I'm wondering if
anybody has looked specifically at functions which are cheap to compute
but still look "reasonably random".
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |