{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA *pseudorandom number generator* is a tuple $(S, s_0, T, U, G)$ where:\n\n1. $S$ is a finite set, the state space;\n2. $s_0 \\in S$ is the initial state, or seed;\n3. $T \\colon S \\to S$ is a map, the transition function;\n4. $U$ is a set, the output space, usually $[0, 1)$ or a set of integers $\\set{0, \\ldots, m-1}$;\n5. $G \\colon S \\to U$ is a map, the output function.\n\nThe generator produces the states $s_i = T(s_{i-1})$ for $i \\ge 1$ and the output sequence $u_i = G(s_i)$ for $i \\ge 0$.\n\n## Remarks\n\nExample: $S = \\set{0, \\ldots, 7}$, $T(s) = (5s + 1) \\bmod 8$, $U = [0, 1)$, $G(s) = s/8$ and $s_0 = 0$; all five clauses hold, and the outputs are $0, 0.125, 0.75, 0.875, 0.5, 0.625, 0.25, 0.375$, then repeat.\nNon-example: the sequence of decimal digits of $\\pi$ is not eventually periodic, because $\\pi$ is irrational.\nIt is not the output sequence of any such tuple, since a finite state space as in clause 1 forces the outputs to be eventually periodic.\nSince $S$ is finite, the sequence $(s_i)$ is eventually periodic, with period at most $\\abs{S}$; if $T$ is a bijection it is purely periodic.\nThe definition is purely structural; the quality of a generator is judged by its period, by the uniformity of tuples $(u_i, \\ldots, u_{i+k-1})$, and by statistical tests.\nGenerators for cryptography must in addition be unpredictable from past outputs, which is a stronger requirement.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "C5FG6ARWVV",
    "kind": "definition",
    "msc": [
      "65C10",
      "11K45"
    ],
    "name": "Pseudorandom number generator",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Pseudorandom_number_generator"
      }
    ],
    "tag": "J1TZHNRV02",
    "uses": []
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/J1TZHNRV02/",
  "links": [
    {
      "field": "defines",
      "target": "C5FG6ARWVV"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/J1TZHNRV02.md",
  "msc": [
    "65C10",
    "11K45"
  ],
  "name": "Pseudorandom number generator",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/J1T/J1TZHNRV02.md",
  "status": null,
  "tag": "J1TZHNRV02",
  "uri": "m2://J1TZHNRV02",
  "url": "https://tamnd.github.io/math2/wiki/pseudorandom-number-generator-definition/",
  "writing": {
    "tag": "J1TZHNRV02",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
