MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Differences in Random Numbers


Mark Coleman wrote:
> 
> Greetings,
> 
> My understanding is that the built-in Mathematica command Random[ ] will
> produce a uniformly distributed pseudo-random number in the range 0 to
> 1. Based on my read of the documentation, this should be equivalent to
> calling Random[UniformDistribution[0,1]] (after loading
> Statistics`ContinuousDistributions of course)). Is this correct?


The source code say

UniformDistribution/: Random[UniformDistribution[min_:0, max_:1]] :=
		Random[Real, {min, max}]


> 
> I ask this question because of some unusual results I obtained while
> testing another (fairly complex) program that makes use of uniform
> random variates. I initially used the Random[UniformDistribution[0,1]]
> function call and obtained final results of the complex program that
> were quire a bit different from the test case that I have been using to
> verify my code. When I switched to the simple Random[ ] call, my
> results looked much better. Sorry if this seems vague, but I found this
> behavior somewhat anomalous and wanted to be sure I understood the
> differences, in any, between these two methods of generating random
> variates.


Just try it out

SeedRandom[1234];
Table[Random[], {10}]

and

SeedRandom[1234];
Table[Random[UniformDistribution[0, 1]], {10}]

will produce the same list.

Regards
  Jens


  • Prev by Date: Re: Playing multiple sounds in sequence
  • Next by Date: Re: ReplaceList -- Unexpected Answer
  • Previous by thread: Re: Differences in Random Numbers
  • Next by thread: ND Solver problem