the caveat is that rand() is not just this particular formula. there's a bunch of other ways to generate pseudorandom numbers with varying up- and downsides. it all depends on the language and the libraries that you use. even in say C, you may get different results depending on where your standard library comes from and how old it is.

and then there's of course the whole discussion of true random vs. pseudorandom... :)


On Thu, Jul 12, 2018 at 7:51 PM, dave <dave@pawfal.org> wrote:
Good point, I've posted this here before at some point, but I always
remember the moment discovering that rand() is just:

((last_number * 214013 + 2531011) >> 16) & 0x7fff

- or famously, if you are Sony - you just use '4':

https://www.engadget.com/2010/12/29/hackers-obtain-ps3-private-cryptography-key-due-to-epic-programm/

On 12/07/18 18:00, nikita aigner wrote:
> oh, addendum to the sidenote: widely-used algorithms are typically
> already implemented in mathematics packages, so understand them means
> just knowing their limitations. this will save you a lot of headaches.
>
> On Thu, Jul 12, 2018 at 6:36 PM, nikita aigner <niki.aigner@gmail.com
> <mailto:niki.aigner@gmail.com>> wrote:
>
>     (it's been a while that i needed this...)
>     sidenote: if you want a proper gaussian, there are much better ways
>     of generating one. the box-muller transform is one simple way:
>     https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
>     <https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform> but
>     there are better ones i think. the way to do arbitrary continuous
>     distributions is as far as i know inverse transform sampling
>     (https://en.wikipedia.org/wiki/Inverse_transform_sampling
>     <https://en.wikipedia.org/wiki/Inverse_transform_sampling>) and for
>     discrete there are algorithms based on subdividing a space.
>
>     generally, when you deal with random numbers, don't neglect the
>     algorithms behind them. the artifacts from too short of a period in
>     a random number generator or distributions that are off can lead to
>     disastrous errors at least in physical modeling. this may of course
>     not hold for other applications.
>
>     On Thu, Jul 12, 2018 at 5:54 PM, Antoine Schmitt <as@gratin.org
>     <mailto:as@gratin.org>> wrote:
>
>         I use randomness to simulate reality.
>
>         Especially:
>         - I inject randomness at the lowest levels of a system to shake
>         it from the inside, like your unconscious (or your brain)
>         contains a lot of randomness
>         - I inject randomness at the outskirts of a system, to shake it
>         from the outside, like you live in an (apparently) random world,
>         though you manage to remain yourself, and it even nourishes you
>
>         Antoine
>         no totally random
>
>         _______________________________________________
>         eu-gene mailing list -- eu-gene@we.lurk.org
>         <mailto:eu-gene@we.lurk.org>
>         To unsubscribe send an email to eu-gene-leave@we.lurk.org
>         <mailto:eu-gene-leave@we.lurk.org>
>
>
>
>
>
> _______________________________________________
> eu-gene mailing list -- eu-gene@we.lurk.org
> To unsubscribe send an email to eu-gene-leave@we.lurk.org
>