Is there a better alternative to using run tables for testing for randomness in a sample?
Currently, for statistical process control charting, I am testing the number of runs identified in a sample (essentially the number of times the sample crosses the average, plus one) against a standard table of significantly high or low run counts given a particular sample size:
n Low High 10 2 9 11 2 9 12 2 11 13 2 11 14 3 13 . . . 46 15 32 . . . 50 17 34
For example, if a sample of size 11 has less than 2 runs or more than 9 runs, then it can be said that that sample exhibits special cause variation (i.e. is not random).
I'm trying to approach this programmatically and having some formulaic approach rather than attempting to lookup values in a finite table would be a huge help.