Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Conduct an empirically derived test that assesses randomness using the frequencies of serial combinations of 0s and 1s
ResourceFunction["SerialRandomnessTest"][sequence] conducts an empirically derived test using the frequencies of serial combinations of 0s and 1s in sequence and returns an associated pvalue. 

ResourceFunction["SerialRandomnessTest"][sequence,"properties"] conducts an empirically derived test and returns the specified property. 
Generate a sequence of random integers and apply a runsbased test:
In[1]:= 

Visualize the sequence:
In[2]:= 

Out[2]= 

In[3]:= 

Out[3]= 

In[4]:= 

Out[4]= 

Reject a nonrandom sequence:
In[5]:= 

In[6]:= 

Out[6]= 

In[7]:= 

Out[7]= 

In[8]:= 

Out[8]= 

Test the randomness of rule 30:
In[9]:= 

In[10]:= 

Out[10]= 

In[11]:= 

Out[11]= 

SerialRandomnessTest requires sequences of length 100 or more:
In[12]:= 

Visualize the sampling distribution of the test statistic:
In[13]:= 

In[14]:= 

Out[14]= 

In[15]:= 

Out[15]= 

In[16]:= 

Out[16]= 

This work is licensed under a Creative Commons Attribution 4.0 International License