{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $k \\ge 1$ and let $f \\colon \\N^k \\rightharpoonup \\N$ be a partial function, where $\\N$ is the set of [[natural numbers|0MWKJ44V5A]].\nFix an encoding of tuples of natural numbers as words on the input alphabet, for example in unary separated by a marker.\nThe function $f$ is *computable*, or *partial computable*, if there is a [[Turing machine|758EYCN27B]] $M$ with the following property for every $\\bar x \\in \\N^k$.\n\n1. If $f(\\bar x)$ is defined, then $M$ halts on input $\\bar x$ with the code of $f(\\bar x)$ on its tape.\n2. If $f(\\bar x)$ is undefined, then $M$ does not halt on input $\\bar x$.\n\nA *total computable function* is a computable function defined at every point of $\\N^k$.\n\n## Remarks\n\nExample: addition $(x, y) \\mapsto x + y$ is computable.\nWith unary codes $1^x 0 1^y$, a machine that replaces the $0$ by $1$ and erases the last $1$ halts with $1^{x+y}$ on its tape.\n\nNon-example: the function $h(e) = 1$ if the machine with index $e$ halts on input $e$, and $h(e) = 0$ otherwise, is total but not computable.\nNo machine satisfies clause 1 for $h$; see the [[halting problem|Z7TN2B35B0]].\n\nA partial function is computable if and only if it is partial [[general recursive|HBK5QHC1GC]].\nThe definition does not depend on the choice of a reasonable encoding or a variant of Turing machines.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "KZSB5E471K",
    "kind": "definition",
    "msc": [
      "03D20",
      "03D10"
    ],
    "name": "Computable function",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Computable_function"
      }
    ],
    "tag": "D9AWNH60RM",
    "uses": [
      "758EYCN27B",
      "0MWKJ44V5A"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/D9AWNH60RM/",
  "links": [
    {
      "field": "defines",
      "target": "KZSB5E471K"
    },
    {
      "field": "uses",
      "target": "758EYCN27B"
    },
    {
      "field": "uses",
      "target": "0MWKJ44V5A"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/D9AWNH60RM.md",
  "msc": [
    "03D20",
    "03D10"
  ],
  "name": "Computable function",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/D9A/D9AWNH60RM.md",
  "status": null,
  "tag": "D9AWNH60RM",
  "uri": "m2://D9AWNH60RM",
  "url": "https://math2.tamnd.com/wiki/computable-function-definition/",
  "writing": {
    "tag": "D9AWNH60RM",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
