# Why does SeedRandom with same seed used twice produce such different results?

I have occasionally used RandomSeed[100] twice in the code and noticed behaviour that I don't understand.

Consider:

Clear[X, tmp, tmp1]
SeedRandom[100];
X = RandomVariate[UniformDistribution[{-1, 1}], 1000];
tmp = RandomVariate[BernoulliDistribution[#]] & /@ LogisticSigmoid[X];

SeedRandom[100];
tmp1 = RandomVariate[BernoulliDistribution[#]] & /@ LogisticSigmoid[X];


Then if we plot both responses, they are very different - tmp produces correct (blue) result, but tmp1 (orange) produces strange outcome:

ListPlot[{

EDIT As @JimB correctly admits, it appears that tmp1 produces 0's whenever X is negative and 1's whenever X is positive. And it appears to be happening only when the same seed is used, i.e. 100 in the example.
• You're not executing the same statements after setting the seed. You need a X1 = RandomVariate[UniformDistribution[{-1, 1}], 1000]; right before defining tmp1. And the definition of tmp1 also needs X changed to X1. – JimB May 13 at 19:46
• @JimB, I know that, but why this other statement generates such picture (I would expect that it would just made another version of distribution but it simply set all 1s for positive and all 0s for negative values without randomness as in the tmp case given similar X. – garej May 13 at 19:50
• I see now. So it appears that tmp1 produces 0's whenever X is negative and 1's whenever X is positive. I think a table showing that would make the issue clearer. And it appears to be happening only when the same seed is used. Maybe this is exactly what you were stating but it wasn't clear to me. – JimB May 13 at 20:14
• It looks like RandomVariate on different distributions use the same underlying random number generator. In other words, when using the same seed, random numbers generated from different distributions will be correlated. I think it's worth reporting to support, since if nothing else, the documentation ought to list this as a possible issue. – Carl Woll May 13 at 20:15