Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Compute N-th results of random number generators

License

Notifications You must be signed in to change notification settings

Rupt/julia-random-generator-hashes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random sequences? Nah, just hash functions

Random number generators produce deterministic sequences. That's useful. It can also be useful to jump straight to the N-th item in the sequence. Such N-th item functions exist for many existing generators.

This repository implements N-th item functions for a few 64-bit generators:

Usage

  • Add this local package through the Julia CLI with julia > ] > add ..
  • Run the automated checks with make test.
  • Run some basic timing measurements with make bench. This needs BenchmarkTools, installed for example with julia > ] > add BenchmarkTools.

Historical note

I originally planned this project to:

  1. Challenge random number generators with powerful, learned tests, and
  2. experience Julia.

The following claims motivate Item 1:

  • Surprisingly simple random number generators claim to pass all existing statistical tests.
  • I distrust all existing statistical tests. Test batteries were hand-crafted to target weak historical generators, and they uniformly misuse p-values.

In performing Item 2, I learned that there are better tools for achieving point 1, so I conclude this project with just the N-th item functions. Of course this "better" word is meaningless. Concretely, I mean that there are language ecosystems that offer non-global namespaces without textual include directives, faster compilation, faster execution (with or without compilation), stronger semantic guarantees (with regards to typing and immutability), fewer syntactic gimmicks, and more mature libraries. Julia is a great demonstration of LLVM's capabilities, but it is not alone.

About

Compute N-th results of random number generators

Resources

License

Stars

Watchers

Forks