How to test if two sets of random numbers might be from the same random number generator?  I have a sequence of sets of random numbers, with each set generated
by an unknown random number generator. I am assuming that in the
sequence, the random number generator is the same one for a certain
duration, such that a few sets in a row are from the same random
number generator. In essence the sequence looks like this
a1 a2 a3 b1 b2 c1 c2 c3 c4 a4 a5 b3 ...
where a, b and c are unknown random number generators. I am looking
for a way to test if two sets of random numbers might be from the same
random number generator with a certain level of confidence. For
example test(a1, b1) = 0.0 while test(a1,a2) = 0.9
My goal is to be able to group the sets if they are from the same
random number generator, such that I get a sequence like this
[a1 a2 a3] [b1 b2] [c1 c2 c3 c4] [a4 a5] [b3 ...
I am assuming that the random number generators stay the same (i.e.
the seed is never changed).
 A: If you could do that, you would be able to distinguish the output of a random number generator from a true random sequence.  This is of course possible, but unless the random number generator is especially bad (as some historical generators were) it requires testing very large samples.  If your generators are reasonably good, you won't be able to tell the difference.
This document describes some statistical tests known to catch some standard random number generators. See page D-5 for a list of failures.
A: Some non-trivial information may be acquired, especially with not-so-great pseudo-random number generators, by applying standard compression algorithms (e.g., gzip) to chunks of output. If the ratio of compressed to not-compressed are significantly different, one infers that the sources are different, etc. Obvious benchmarks can be obtained by running compression on old email (with or without headers), the output of linear congruential generators or other bad pseudo-random number generators, etc.
A: If you want to know whether two sequences are outputs of the same computer program with different seeds, then I doubt you can do much better than enumerating all computer programs and trying them. This can't be done in practice. Some preudo-random number generators work reasonably well with one seed, and terribly with other seeds, which means the same algorithm with different seeds can produce either a sequence which looks random or Bach's suites for solo cello.
Perhaps you want the idea of a randomness test, such as Marsaglia's Diehard tests. The reason there are so many, including many silly tests, is that pseudo-random numbers which appear uniform often fail catastrophically when they are used to generate a sequence of pseudo-random numbers.
Another possible interpretation is to say that you have a particular distribution, perhaps the uniform distribution. You can test whether a sample is consistent with that distribution, e.g., with the Pearson chi-squared test. If you have two samples, you can estimate a distribution from the first sample and test whether the second sample is consistent with this. Since you talk about identifying when you switch from one generator to another in a sequence, you may want to look at what is called "structural change" or "change points" in statistics. There are automated tests for this which assume that the generators are not even uniform.
