MathGroup Archive 2002

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

Search the Archive

something fishy in mathematica random generation?

  • To: mathgroup at
  • Subject: [mg33097] something fishy in mathematica random generation?
  • From: KIMIC Weijnitz Peter <micweij at>
  • Date: Sun, 3 Mar 2002 06:30:16 -0500 (EST)
  • Sender: owner-wri-mathgroup at

I hope someone can explain this.

A characteristic of a truly random behavior is that events tend to
E.g. a  molecular collision is more likely to occur just after the most
recent collision.
or, in a bit stream, a bit error is more likely to occur just after the
most recent error if the errors are generated by random noise.
I simulated this with a generated vector with ones and zeroes with a
given probability using Random and RandomSeed in Mathematica 3.01. and I
found something peculiar with the random generation in Mathemathica, 

Just run these lines and see for yourself:

SeedRandom[1111111 ] (*change this number to get another random

vec1=Table[Random[Real,{0,1000}],{10^6}];              (*reduce this
vector length if you get memory problem*)
vec2=Map[If[#<44,1,0]&,vec1];                          (*threshhold for
ones=Flatten[Position[vec2,1]];                        (*vector of index
positions for ones *)
Length[ones]/10.^6                                     (*check for the
average of ones*)
(*subtracts ones[[i]]-ones[[i+1]]*)


It is the plot that seems a bit strange to me, I get the expected
decreasing exponential behavior in 
the probability of the interval length between ones. 

But, (this is the question) in all different simulations I have made
with different RandomSeed[], average 
of ones, different vector length, the interval of 24 have a lower
frequency than expected. 

If this behavior persists when you test, what is the reason?
If not, why do I get it, I have tried it on two computers.

hehe.. if you reverse 24 you get 42???
Peter W

  • Prev by Date: mathematical problem
  • Next by Date: Re: Intersection[...,SameTest] ?
  • Previous by thread: mathematical problem
  • Next by thread: Re: something fishy in mathematica random generation?