#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Options

# Random number generator

Created page Random number generator.

On that page I posted an implementation of the ran algorithm from numerical recipes, in Java, which is quite different from the C++ implementation in the book.

Now here is the question: The C++ code itself is not open source, but sold under a commercial, single user license. The algorithm used is described in the book. The Java implementation is, as I said before, different from the C++ code in many respects, but the algorithm itself is the same, of course.

Does anyone have any idea if this violates the copyright of the authors? In Europe the answer would be no, I guess, but then the Europeans have a different attitude towards software patents and copyright.

• Options
1.
edited October 2010

Previously you've talked about correlations between values output by the PRNG. You probably know this, but in case two other big issues are:

1. The period must be much, much longer than the number of "numbers requested" $N$ during a run if you want to do multiple runs with a different seed to "validate" that a result isn't atypically influenced by the particular random sequence. Basically you need it to be long enough so that if you select "number of runs" $R$ random seeds then the probability of any of the $R$ blocks of length $N$ overlap anywhere is negligible.

2. No matter how much internal state you've got, the number of distinct starting points is limited by the number of different seeds your initialisation routine can create. This is particularly important if you're trying to generate "reproducible" random numbers using a deterministic initialisation procedure.

Comment Source:Previously you've talked about correlations between values output by the PRNG. You probably know this, but in case two other big issues are: 1. The period must be much, much longer than the number of "numbers requested" $N$ during a run if you want to do multiple runs with a different seed to "validate" that a result isn't atypically influenced by the particular random sequence. Basically you need it to be long enough so that if you select "number of runs" $R$ random seeds then the probability of any of the $R$ blocks of length $N$ overlap anywhere is negligible. 2. No matter how much internal state you've got, the number of distinct starting points is limited by the number of different seeds your initialisation routine can create. This is particularly important if you're trying to generate "reproducible" random numbers using a deterministic initialisation procedure.
• Options
2.

You probably know this, but in case two other big issues are:...

Yes, I know, but thanks nevertheless - any help is welcome! I'll include your remark.

I started with the remark about correlations, because there seem to be quite a few web pages that don't mention it, or even get it wrong.

Comment Source:<blockquote> <p> You probably know this, but in case two other big issues are:... </p> </blockquote> Yes, I know, but thanks nevertheless - any help is welcome! I'll include your remark. I started with the remark about correlations, because there seem to be quite a few web pages that don't mention it, or even get it wrong.
• Options
3.

Great stuff, guys!

Comment Source:Great stuff, guys!