Giter VIP home page Giter VIP logo

ine5425x3's Introduction

X3

Implementation of a Pseudo random number generator that generates variates following:

  • An uniform distribution
  • An exponential distribution
  • An erlang distribution
  • A normal distribution
  • A gamma distribution
  • A beta distribution
  • A weibull distribution
  • A logNormal distribution
  • A triangular distribution
  • A discrete probability distribution

Quickstart

To compile the program just run the compile script. It will compile the executable INE5425 to the bin folder.

Why use PRNG instead of TRNG?

A great advantage of PRNGs (Pseudo Random Number Generators) over TRNGs (True Random Number Generators) is that you can reproduce the same sequence of numbers in another time by simply knowing the starting point of the sequence (also known as the seed) - thus it is also periodic and the sequence will repeat itself in due time.

You can be sure that the sequence of numbers produced by a Pseudo-RNG, though periodic, the time to reproduce the same sequence will eventually take a really long time that unless you acquire the actual algorithms, the correct sequence will be very difficult (almost impossible) to crack.

Why use XOR-Shift instead of LCG?

In some cases it is useful to use fewer operations and still achieve an acceptable degree of randomness. To do this, we need to find a small combination of bitwise operations that meet certain randomness criteria and pass certain statistical tests. One solution proposed by George Marsaglia is in the form of Xorshift.

In Xorshift the resulting numbers can be considered equally random, that is, their randomness is independent of their position. Marsaglia showed that a generator involving three shifts and three XOR operations satisfy various statistical tests of randomness (including ones that poorer generators such as LCGs fail).

This project is avaliable on Github.

ine5425x3's People

Contributors

henrds avatar jacyara avatar rnoliosc avatar

Stargazers

Roman avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.