# Recommended randomness tests?



## Andrew Fergus (Mar 22, 2007)

Hi

I'm working with some values that must appear to be random and should also appear to be random when applying statistical tests.  Not being a statistics person myself I'm not sure what tests, if any, i can use.  Searching on the 'net I found references to the chi square test but I'm not sure if that is suitable for my sample nor how to use it.

Can someone with a statistics background point me in the right direction?  Following is a sample of some of my data - each string is 50 characters long and contains alphanumeric characters.

Sample:
	
	
	
	
	
	



```
DOXKBZ1LXITP18BV1CEKTG5BKTC6TACO6CVEHZ56I5ZMJVSIKL
UYYLL7AWYIZNJ75L6HXXLU6SK5Q3DRL0EGCS5SGYX5CR9SJXGG
684Q19PQOHBU2PMB7TSQNREEFWXJOROPQMN7YB7NT884MKUEIL
5KY0QQ9DKJ69B90QSHER0Q81M8CA0VJIXKQYS0UKP5TCCEQ954
```

If I analyse the frequency of characters in a sample of 75 strings of 50 characters each, I get frequency values ranging from 1.8% to 3.6% - the numbers given are the outliers, most values are between 2.3% and 3.2%.  However I think I need to test the 'runs' but am not sure how.....

Thanks in advance for any pointers
Andrew


----------



## iknowu99 (Apr 5, 2007)

http://msdn.microsoft.com/msdnmag/issues/06/09/TestRun/default.aspx


----------



## iknowu99 (Apr 18, 2008)

any success?


----------



## Andrew Fergus (Apr 18, 2008)

Hi

A lot of that was over my head and I believe the programming language was C, with which I am not familiar.  The concepts were useful but I'm not 100% sure if I have applied them correctly.  For instance, the runs test was based on two variable values (X's and O's) - I have 10 values (being 0 to 9).  A way around this is to convert the values to High/Low values and whilst I can get that aspect going, there is also a third option (i.e. Same) that is not covered by that test.  Hence my reason for not being sure about having applied it correctly.

Andrew

P.S.  This is one of the values that I am subjecting to the test:



> 17958342716512576730157498409439523238955671684983792211089761440730099586655030476888947999178200993199818
> 47899981208555423740442432391084919195525284857431840401697307982823805255325755624137612580910065434604723
> 48270680598905382953412102183620145400712674398056904409673089339756727837749824700909800748435595389848548
> 27290744717666401372513696571325603041504631699555950620991314945292407937258473561213189118929780585026157
> ...


----------



## Marbles (Apr 19, 2008)

Andrew

Would this site be any help?

http://stattrek.com/Default.aspx


----------



## Andrew Fergus (Apr 19, 2008)

Thanks Marbles but I couldn't find anything to test randomness on that site.

Thanks anyway
Andrew


----------



## erik.van.geit (Apr 20, 2008)

Hi,

Andrew, why don't you use Excel to test it?

kind regards,
Erik


----------



## Andrew Fergus (Apr 20, 2008)

Hi Erik

I'm not sure I understand.  I was using VB6 to do the calculations but I'm not sure if a) I was using the correct calculations and b) that I had correctly applied those calculations.  I'm not sure how Excel would help....?

Cheers
Andrew


----------



## erik.van.geit (Apr 21, 2008)

Excel can test - using formulas - how many of each character are terurned by your calculations. I thought that was the main question. But perhaps is was not clear to me? And you would probably have figured out that yourself, or?


----------

