Are there any algorithms or formulas to test the randomness of a sequence?

50 Views Asked by At

I have a sequence of numbers generated by a programmed computer using pseudorandom functions. Is there a formula which will allow me to see how random this series is?

Here is my idea, are there any more elegant approaches?

  1. State the number of elements in the array (For example, array IsThisRandom(1,2,3) returns 3 for this).
  2. Record the lowest and the highest numbers returned by each (array IsThisRandom returns 1 and 3 for this).
  3. Compare the expected number of outcomes X for element in array Y: for IsThisRandom this returns 1, 1, and 1. This can be generalized by (total number of outcomes recorded in step 1)/something else, not sure what to call it.

EDIT: if i have an array of 1 element, for example 1Array(1) , there is no way to know whether it is actually random- does certainty about randomness increase with number of elements given?