News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

RNG math

Started by asmfan, May 27, 2006, 01:11:09 PM

Previous topic - Next topic

asmfan

I'm currently interested in random numbers generators made in software. Could you direct me to links on math that stands behind all good RNGs, or all generators are empirical made, Statistically tested and just used as is?
Thanks
Russia is a weird place

Ossa

Everyone seems to be interested in random numbers lately!

Anyway, the two references that I have posted most, are the following:


  • The Handbook of Applied Cryptography - has a good chapter (chapter 5) on pseudo-random number generators (which are cryptographically secure) - http://www.cacr.math.uwaterloo.ca/hac/
  • Agner Fog's page... as well as code, there are several explanations of the theory for both uniform and non-uniform distributions (I used one of the uniform to non-uniform conversion algorithms for a project a little while ago) - http://www.agner.org/random/

I also use another cryptography book that I picked up about 10 years ago (which was *way* too mathematically complicated for me back then (I was 12), but that I mostly understand now). You will find that all GOOD crypto books require a very good grasp of maths to understand, but very little to be able to write the algorithm in code.

Basically, you'll find that there are fast weak random algorithms and slow very random algorithms... it depends on which you want as to what you should investigate.

Ossa
Website (very old): ossa.the-wot.co.uk

Mark Jones

I don't know why it's historically so difficult to find this post, but see:
http://www.masm32.com/board/index.php?topic=3616.msg30071#msg30071
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Ossa

Quote from: Mark Jones on May 27, 2006, 03:23:37 PM
I don't know why it's historically so difficult to find this post

One of several reasons I suspect:

1) No one looks for it. (I would just alter Agner's functions myself and use them rather than searching the forum - but thats because I know where they are)... others might just be too lazy to click the seach button.

2) People actually want to find out about it and write code themselves rather than use a prepackaged "box" - not everyone here is just looking for a library to get to some end purpose - there is always the thrill and adventure that learning new things gives you.

3) I HATE using anyone else's libraries/code until it is a last resort - for insatnce, I would rather code a whole JPEG lib rather than use someone else's (not that I've ever wanted to use JPEGs). I think it's the same reason that I was attracted to ASM - you get to have full control over every aspect of the code... why would I let someone else take that? (Despite this, I always provide references to libs or someone else's code when people ask questions here, as that is what most people are looking for... I actually rather like it when that doesn't satisfy them.)

Ossa
Website (very old): ossa.the-wot.co.uk

stanhebben

4) You have full intellectual rights on your own code.

asmfan

Mark, i did it (searched) for the first. But my question mainly on mathematics and algorithms rather than implementation in asm... Because i want to get the math of this process - software generation of pseudo random numbers. It doesn't matter in what language you implement the algorithm, because algorithm is the main thing...believe me.
Russia is a weird place