{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA *Turing machine* is a tuple $M = (Q, \\Gamma, \\sqcup, \\Sigma, \\delta, q_0, F)$ with the following parts.\n\n1. $Q$ is a finite nonempty [[set|0BSJ7RQ9BW]] of states.\n2. $\\Gamma$ is a finite set of tape symbols, and $\\sqcup \\in \\Gamma$ is the blank symbol.\n3. $\\Sigma \\subseteq \\Gamma \\setminus \\set{\\sqcup}$ is the set of input symbols.\n4. $q_0 \\in Q$ is the initial state, and $F \\subseteq Q$ is the set of halting states.\n5. $\\delta$ is a partial [[function|0EPAT51DXQ]] from $(Q \\setminus F) \\times \\Gamma$ to $Q \\times \\Gamma \\times \\set{L, R}$, the transition function.\n\nA configuration consists of a state $q$, a tape $t \\colon \\Z \\to \\Gamma$ with only finitely many non-blank cells, and a head position $p \\in \\Z$.\nIf $\\delta(q, t(p)) = (q', s, D)$, the next configuration has state $q'$, the symbol $s$ written at cell $p$, and head position $p - 1$ if $D = L$ and $p + 1$ if $D = R$.\nThe machine *halts* when no transition applies, in particular when it reaches a state in $F$.\nOn an input word $w \\in \\Sigma^*$, the computation starts in state $q_0$ with the head at cell $0$.\nAt the start, $w$ is written from cell $0$ onward and all other cells are blank.\n\n## Remarks\n\nExample: let $Q = \\set{q_0, h}$, $\\Gamma = \\set{0, 1, \\sqcup}$, $\\Sigma = \\set{0, 1}$ and $F = \\set{h}$.\nLet $\\delta(q_0, 0) = (q_0, 1, R)$, $\\delta(q_0, 1) = (q_0, 0, R)$ and $\\delta(q_0, \\sqcup) = (h, \\sqcup, R)$.\nEach clause holds, and on input $0110$ the machine moves right, writes $1001$, and halts at the first blank.\n\nNon-example: a \"machine\" with one state for each natural number is not a Turing machine, because clause 1 requires finitely many states.\n\nMany variants are in use: a tape infinite in one direction only, several tapes, or a single halting state.\nThey all compute the same partial functions, though their running times differ.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "758EYCN27B",
    "kind": "definition",
    "msc": [
      "03D10",
      "68Q04"
    ],
    "name": "Turing machine",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Turing_machine"
      }
    ],
    "tag": "W6ESDYBF8Z",
    "uses": [
      "0BSJ7RQ9BW",
      "0EPAT51DXQ"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/W6ESDYBF8Z/",
  "links": [
    {
      "field": "defines",
      "target": "758EYCN27B"
    },
    {
      "field": "uses",
      "target": "0BSJ7RQ9BW"
    },
    {
      "field": "uses",
      "target": "0EPAT51DXQ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/W6ESDYBF8Z.md",
  "msc": [
    "03D10",
    "68Q04"
  ],
  "name": "Turing machine",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/W6E/W6ESDYBF8Z.md",
  "status": null,
  "tag": "W6ESDYBF8Z",
  "uri": "m2://W6ESDYBF8Z",
  "url": "https://math2.tamnd.com/wiki/turing-machine-definition/",
  "writing": {
    "tag": "W6ESDYBF8Z",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
