Menu

#318 Distribution of RANDOM variable sequences is non-uniform

Behavioral
closed-accepted
5
2007-10-18
2006-01-15
No

Given a RANDOM variable you would expect that for every
call to GENERATE there was an equal chance of getting
any of the potential results - this appears to not be
the case and for any set of potential results there
will be certain result values which have a higher
chance of being returned and others which have a lower
chance.

As an example given potential results of 1 and 2, there
is roughly 53% chance of getting a 2 and 47% chance of
getting a 1. This type/scale of result weighting
applies to all result set sizes - giving a random
result that although "fairly random" could potentially
throw out test results in certain very specific
circumstances.

This problem is present on all platforms for the
OpenSTA 1.4.3 release and earlier.

Discussion

  • Daniel Sutcliffe

    • assigned_to: nobody --> dansut
    • status: open --> open-accepted
     
  • Bernie Velivis

    Bernie Velivis - 2007-10-18

    Logged In: YES
    user_id=1868094
    Originator: NO

    Dan wrote: "Given a RANDOM variable you would expect that for every call to GENERATE there was an equal chance of getting any of the potential results".

    This is not true. True random number generators will generate duplicates quite often. However this does tend to even out over time (larger ranges and more samples both lead to more uniform distributions).

    The randomness of a set of numbers can be quantified by calculating the standard deviation. I generated 100 random numbers in SCL and using the Excel STDEVA function calculated a standard deviation of 28. I also created a list of 100 numbers using the excel rand() function and for it I calculated a standard deviation of 31 (slightly more random). Both lists contained many duplicates.

    If you want to generate a list of pseudo random numbers with no repeating values, generate it outside of SCL, randomize its order, and import the numbers into a list of integers and use the NEXT command to access them sequentially

     
  • Bernie Velivis

    Bernie Velivis - 2007-10-18
    • status: open-accepted --> closed-accepted
     

Log in to post a comment.