My question is essentially if:
double d = random.nextDouble() * 2 (generates a number from 0 to 1 and multiplies by 2)
is equivalent to:
random.nextDouble(2) (generates a number from 0 to 2)
I was wondering just for the theory of it. Does multiplying a randomly generated number affect its uniform distribution in any way?
It absolutely does.
In case you did not notice,
dwill always be multiple of two. while in second case number will be evenly distributed between [0,2).Even if you multiply two truly random variable,probability distribution gets changed. See Understanding "randomness"