Skip to main content

RandTest

A light package for quick and accurate determinations of the randomness of a sequence.

Overview

Identifying random patterns, and conversely, ordered patterns, is a major tool with applicability to a wide variety of fields, from mathematical analysis to cybersecurity. Random Test looks for randomness in sequences of numbers by searching for patterns which are inherently unpredictable. It uses an exponentially-decaying moment prediction to determine the net deviation between the predicted and actual elements of a sequence. In tests, this led to a net predictive accuracy of 99.85% for nonrandom sequences and 96.82% for random sequences. Additionally, this package is able to provide these predictions in under a millisecond for sequences shorter than 10 elements and under 100 milliseconds for sequences shorter than 1000 elements.

Requirements

RandTest is built for Python 3. It has only one requirement:

- Numpy

Installation

To download randtest, use PyPI via pip:

$ pip install randtest

Alternatively, you can clone this Github repository and build from source:

$ git clone https://github.com/sudo-rushil/randtest
$ cd randtest
$ python setup.py install

Verify your installation by running

>>> import randtest
>>> randtest.random_score([0, 1, 2, 3])
'False'

Examples

RandTest is extremely simple to use. You only need to input either a list or a 1D Numpy array of numbers. The prediction returns False if the sequence is ordered and True if the sequence is random.

import numpy as np
import randtest as rt

ordered_sequence = np.arange(10)
random_sequence = np.random.randint(10, size=10)

print(rt.random_score(ordered_sequence))

print(rt.random_score(random_sequence))

False

True

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

randtest-0.3.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file randtest-0.3.tar.gz.

File metadata

  • Download URL: randtest-0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for randtest-0.3.tar.gz
Algorithm Hash digest
SHA256 6552b36c5f262764f2310de187f3abff6ad2f5f8a8e39078a200be61a564ac22
MD5 f432e71dba6c96c08809d64df60c6383
BLAKE2b-256 d6e5ec177fe4f0f305ed1382e429344f11496637974445c3b31be58f598c11fb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7

1 file

0.6

1 file

0.5

1 file

0.4

1 file

This release

0.3 This release

1 file

0.2

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page