{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nEvery irrational $x \\in (0, 1)$ has a unique infinite [[continued fraction|0BK6JBK58W]] expansion $x = [0; a_1, a_2, a_3, \\dots]$ with positive integers $a_k$.\nThe question-mark function $? \\colon [0, 1] \\to [0, 1]$ is defined at such $x$ by\n$$?(x) = 2 \\sum_{k=1}^{\\infty} (-1)^{k+1} \\, 2^{-(a_1 + a_2 + \\cdots + a_k)}.$$\nFor a rational $x = [0; a_1, \\dots, a_n]$ the same formula with a finite sum is used, and $?(0) = 0$.\nThe value does not depend on which of the two finite expansions of a rational is chosen.\nFor example, $\\frac12 = [0; 2] = [0; 1, 1]$ gives $2 \\cdot 2^{-2} = \\frac12$ and $2(2^{-1} - 2^{-2}) = \\frac12$.\n\nSome values: $?(1) = 1$, $?(\\frac13) = 2 \\cdot 2^{-3} = \\frac14$, and for $x = [0; 1, 1, 1, \\dots] = (\\sqrt5 - 1)/2$ the geometric series gives $?(x) = 2 \\cdot \\frac{1/2}{1 + 1/2} = \\frac23$.\n\nThe function $?$ is continuous and strictly increasing, so it is a [[homeomorphism|05GZ11PWRY]] of $[0, 1]$ onto itself.\nIts derivative exists and equals $0$ at almost every point of $[0, 1]$.\nSo $?$ is a [[singular function|P5AWRD2793]].\nUnlike the [[Cantor function|NPBYYK63FE]], it is strictly increasing, so it is constant on no interval.\n\nThe function maps the rationals of $[0, 1]$ onto the dyadic rationals $m/2^n$ of $[0, 1]$.\nIt maps the quadratic irrationals of $(0, 1)$ onto the rationals that are not dyadic.\n\n## Explanations\n\n### L1 human\n\nThe question-mark function reads the continued fraction of a number and turns it into a binary expansion: each partial quotient becomes a run of equal binary digits.\nThe first run has length $a_1 - 1$, and the $k$-th run has length $a_k$ for $k \\ge 2$.\nIt is a continuous, strictly increasing function that still has slope zero almost everywhere.\nThis shows that a function can climb steadily from $0$ to $1$ while being flat in the sense of derivatives almost everywhere.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "instance_of": [
      "P5AWRD2793"
    ],
    "kind": "example",
    "msc": [
      "26A30",
      "11A55"
    ],
    "name": "Minkowski question-mark function",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Minkowski%27s_question-mark_function"
      }
    ],
    "tag": "4D9HP5TS6W",
    "uses": [
      "0BK6JBK58W",
      "05GZ11PWRY"
    ]
  },
  "kind": "example",
  "link": "https://math2.tamnd.com/node/4D9HP5TS6W/",
  "links": [
    {
      "field": "instance_of",
      "target": "P5AWRD2793"
    },
    {
      "field": "uses",
      "target": "0BK6JBK58W"
    },
    {
      "field": "uses",
      "target": "05GZ11PWRY"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/4D9HP5TS6W.md",
  "msc": [
    "26A30",
    "11A55"
  ],
  "name": "Minkowski question-mark function",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/4D9/4D9HP5TS6W.md",
  "status": null,
  "tag": "4D9HP5TS6W",
  "uri": "m2://4D9HP5TS6W",
  "url": "https://math2.tamnd.com/wiki/minkowski-question-mark-function/",
  "writing": {
    "tag": "4D9HP5TS6W",
    "kind": "example",
    "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
      }
    ]
  }
}
