Math calculators

Random number generator

Integers with or without repeats, decimals, normally distributed numbers, dice rolls and list shuffles, reproducible with a seed.

Inputs

Results

Press Generate. Numbers are drawn in your browser and never sent anywhere.

Methodology

Conventions

  • Without a seed, numbers come from the browser's cryptographic generator (crypto.getRandomValues). Nothing is sent to a server.
  • With a seed, the mulberry32 generator gives the same numbers every time, for reproducible draws.
  • Normal draws transform a uniform draw with the inverse normal cdf; shuffles use Fisher–Yates; unique draws redraw repeats.

References

  • Knuth, The Art of Computer Programming, vol. 2, §3.4

Formulas

Normal draw
x = \mu + \sigma\,\Phi^{-1}(u),\quad u \sim U(0, 1)
Fisher–Yates
\text{for } i = n - 1 \ldots 1:\ \text{swap } a_i, a_j,\ j \sim U\{0, i\}