# Randomness

## What is randomness?

The quality or state of lacking a pattern or principle of organization; unpredictability.

A sequence of events is said to be random if it lacks any patterns or predictability. Some examples of randomness would be the rolling of dice or flipping a coin. However, the frequency of outcomes over a large number of events can be predicatable; for example, over many throws of 2 die, we know that the sum of 7 will occur twice as often as a 4.

Check out this YouTube video by CrashCourse on Randomness:

DiceApp.io uses the JavaScript "Math.random()" function to generate the "random" dice throws. Technically, these are only pseudo-random and are implemented using a pseudo-random number generator (PRNG).

## What is pseudorandomness?

(of a number, a sequence of numbers, or any digital data) satisfying one or more statistical tests for randomness but produced by a definite mathematical procedure.

A pseudo-random number is derived from an internal state, altered by a fixed algorithm for every new number. Therefore for every given initial state, the sequence of "random" numbers is deterministic.