{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nDefine polynomials $P_m$ and $Q_m$ by $P_0(z) = Q_0(z) = 1$ and, for $m \\ge 0$,\n$$P_{m+1}(z) = P_m(z) + z^{2^m} Q_m(z), \\qquad Q_{m+1}(z) = P_m(z) - z^{2^m} Q_m(z).$$\nThese are the *Rudin–Shapiro polynomials*.\nBy induction, $P_m$ and $Q_m$ have degree $2^m - 1$, and all $2^m$ of their coefficients are $+1$ or $-1$.\nIndeed $P_m$ fills the coefficients of $1, \\ldots, z^{2^m - 1}$ and $z^{2^m} Q_m$ fills those of $z^{2^m}, \\ldots, z^{2^{m+1} - 1}$.\nSo they are [[Littlewood polynomials|5A16A9W335]].\nThe first ones are $P_1(z) = 1 + z$, $Q_1(z) = 1 - z$ and $P_2(z) = 1 + z + z^2 - z^3$.\n\nFor $\\abs{z} = 1$, the parallelogram law $\\abs{u + v}^2 + \\abs{u - v}^2 = 2\\abs{u}^2 + 2\\abs{v}^2$ with $\\abs{z^{2^m}} = 1$ gives\n$$\\abs{P_{m+1}(z)}^2 + \\abs{Q_{m+1}(z)}^2 = 2 \\left( \\abs{P_m(z)}^2 + \\abs{Q_m(z)}^2 \\right).$$\nHence $\\abs{P_m(z)}^2 + \\abs{Q_m(z)}^2 = 2^{m+1}$, and\n$$\\max_{\\abs{z} = 1} \\abs{P_m(z)} \\le \\sqrt{2} \\cdot \\sqrt{2^m}.$$\n\n## Remarks\n\nSince the mean square of $\\abs{P_m}$ on the circle is $2^m$, the maximum is at most $\\sqrt 2$ times the root mean square.\nFor a polynomial with $N$ coefficients $\\pm 1$, the maximum on the circle is always at least $\\sqrt N$, so this is optimal up to the factor $\\sqrt 2$.\nA random choice of signs typically gives a maximum of order $\\sqrt{N \\log N}$, so the Rudin–Shapiro signs are much better than random.\nThe coefficients of the $P_m$ form the Rudin–Shapiro sequence, an automatic sequence.\n\n## Explanations\n\n### L1 human\n\nThe Rudin–Shapiro polynomials are built by a doubling rule.\nGlue the old polynomial to a shifted copy of its partner, once with a plus sign and once with a minus sign.\nAll coefficients stay $\\pm 1$.\nThe rule keeps the sum of the squared sizes of the pair exactly doubling at every point of the circle.\nSo neither polynomial can ever be much larger than its average size, which makes them almost flat from above.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "instance_of": [
      "5A16A9W335"
    ],
    "kind": "example",
    "msc": [
      "42A05",
      "11B83"
    ],
    "name": "Rudin–Shapiro polynomials",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Rudin%E2%80%93Shapiro_sequence"
      }
    ],
    "tag": "PSAX8W3ZYV",
    "uses": [
      "5A16A9W335"
    ]
  },
  "kind": "example",
  "link": "https://tamnd.github.io/math2/node/PSAX8W3ZYV/",
  "links": [
    {
      "field": "instance_of",
      "target": "5A16A9W335"
    },
    {
      "field": "uses",
      "target": "5A16A9W335"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/PSAX8W3ZYV.md",
  "msc": [
    "42A05",
    "11B83"
  ],
  "name": "Rudin–Shapiro polynomials",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/PSA/PSAX8W3ZYV.md",
  "status": null,
  "tag": "PSAX8W3ZYV",
  "uri": "m2://PSAX8W3ZYV",
  "url": "https://tamnd.github.io/math2/wiki/rudin-shapiro-polynomials/",
  "writing": {
    "tag": "PSAX8W3ZYV",
    "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
      }
    ]
  }
}
