Function Repository Resource:

# ArcsineLawRandomnessTest

Use the arcsine law to assess the randomness of a sequence of zeros and ones

Contributed by: Emmy/Noah Blumenthal
noahb320@gmail.com
emmyb320@bu.edu
 ResourceFunction["ArcsineLawRandomnessTest"][sequence] uses the arcsine law to test sequence for randomness and returns an associated p-value. ResourceFunction["ArcsineLawRandomnessTest"][sequence,"property"] tests sequence for randomness and returns the specified property.

## Details and Options

Properties include:
 "TestStatistic" returns the test statistic "PValue" returns the p-value associated with the test
The test works only for sequences of zeros and ones.
ResourceFunction["ArcsineLawRandomnessTest"] results are generally invalid for sequence lengths shorter than 100.
The test returns a two-tailed p-value.

## Examples

### Basic Examples (3)

Generate a sequence of random integers:

 In:= Visualize the sequence:

 In:= Out= Apply a runs-based test:

 In:= Out= In:= Out= ### Applications (2)

Generate a sequence of random integers:

 In:= Visualize the sequence:

 In:= In:= Out= Attempt to reject a non-random sequence:

 In:= Out= In:= Out= Test the randomness of rule 30:

 In:= In:= Out= In:= Out= ### Possible Issues (1)

ArcsineLawRandomnessTest requires sequences of length 100 or more:

 In:=  ### Neat Examples (1)

Visualize the sampling distribution of the test statistic:

 In:= In:= Out= Emmy Blumenthal

## Version History

• 1.0.0 – 10 July 2019