{
  "index": "2013-A-4",
  "type": "COMB",
  "tag": [
    "COMB",
    "NT"
  ],
  "difficulty": "",
  "question": "A finite collection of digits $0$ and $1$ is written around a circle.\nAn \\emph{arc} of length $L \\geq 0$ consists of $L$ consecutive digits around the circle. For each arc $w$, let $Z(w)$ and $N(w)$ denote the number of $0$'s in $w$ and the number of $1$'s in $w$, respectively.\nAssume that $\\left| Z(w) - Z(w') \\right| \\leq 1$ for any two arcs $w, w'$ of the same length. Suppose that some arcs $w_1,\\dots,w_k$ have the property that\n\\[\nZ = \\frac{1}{k} \\sum_{j=1}^k Z(w_j) \\mbox{ and }\nN = \\frac{1}{k} \\sum_{j=1}^k N(w_j)\n\\]\nare both integers. Prove that there exists an arc $w$ with $Z(w) = Z$\nand $N(w) = N$.",
  "solution": "Let $w_1',\\ldots,w_k'$ be arcs such that: $w_j'$ has the same length as $w_j$; $w_1'$ is the same as $w_1$; and $w_{j+1}'$ is adjacent to $w_j'$ (i.e., the last digit of $w_j'$ comes right before the first digit of $w_{j+1}'$). Since $w_j$ has length $Z(w_j)+N(w_j)$, the sum of the lengths of $w_1,\\ldots,w_k$ is $k(Z+N)$, and so the concatenation of $w_1',\\ldots,w_k'$ is a string of $k(Z+N)$ consecutive digits around the circle. (This string may wrap around the circle, in which case some of these digits may appear more than once in the string.) Break this string into $k$ arcs $w_1'',\\ldots,w_k''$ each of length $Z+N$, each adjacent to the previous one. (Note that if the number of digits around the circle is $m$, then $Z+N \\leq m$ since $Z(w_j)+N(w_j) \\leq m$ for all $j$, and thus each of $w_1'',\\ldots,w_k''$ is indeed an arc.)\n\nWe claim that for some $j=1,\\ldots,k$, $Z(w_j'')=Z$ and $N(w_j'')=N$ (where the second equation follows from the first since $Z(w_j'')+N(w_j'')=Z+N$). Otherwise, since all of the $Z(w_j'')$ differ by at most $1$, either $Z(w_j'') \\leq Z-1$ for all $j$ or $Z(w_j'') \\geq Z+1$ for all $j$. In either case,\n$|kZ - \\sum_j Z(w_j')| = |kZ-\\sum_j Z(w_j'')| \\geq k$. But since $w_1=w_1'$, we have\n$|kZ - \\sum_j Z(w_j')| = |\\sum_{j=1}^k (Z(w_j)-Z(w_j'))| = |\\sum_{j=2}^k (Z(w_j)-Z(w_j'))| \\leq \\sum_{j=2}^k |Z(w_j)-Z(w_j')| \\leq k-1$, contradiction.",
  "vars": [
    "w",
    "w_j",
    "Z",
    "N"
  ],
  "params": [
    "L",
    "k",
    "j",
    "m"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "w": "arcsymbol",
        "w_j": "arcindexed",
        "Z": "zerocount",
        "N": "onecount",
        "L": "arclength",
        "k": "arcnumber",
        "j": "indexer",
        "m": "totaldigits"
      },
      "question": "A finite collection of digits $0$ and $1$ is written around a circle.\nAn \\emph{arc} of length $arclength \\geq 0$ consists of $arclength$ consecutive digits around the circle. For each arc $arcsymbol$, let $zerocount(arcsymbol)$ and $onecount(arcsymbol)$ denote the number of $0$'s in $arcsymbol$ and the number of $1$'s in $arcsymbol$, respectively.\nAssume that $\\left| zerocount(arcsymbol) - zerocount(arcsymbol') \\right| \\leq 1$ for any two arcs $arcsymbol, arcsymbol'$ of the same length. Suppose that some arcs $arcindexed_1,\\dots,arcindexed_{arcnumber}$ have the property that\n\\[\nzerocount = \\frac{1}{arcnumber} \\sum_{indexer=1}^{arcnumber} zerocount(arcindexed_{indexer}) \\mbox{ and }\nonecount = \\frac{1}{arcnumber} \\sum_{indexer=1}^{arcnumber} onecount(arcindexed_{indexer})\n\\]\nare both integers. Prove that there exists an arc $arcsymbol$ with $zerocount(arcsymbol) = zerocount$\nand $onecount(arcsymbol) = onecount$.",
      "solution": "Let $arcindexed_1',\\ldots,arcindexed_{arcnumber}'$ be arcs such that: $arcindexed_{indexer}'$ has the same length as $arcindexed_{indexer}$; $arcindexed_1'$ is the same as $arcindexed_1$; and $arcindexed_{indexer+1}'$ is adjacent to $arcindexed_{indexer}'$ (i.e., the last digit of $arcindexed_{indexer}'$ comes right before the first digit of $arcindexed_{indexer+1}'$). Since $arcindexed_{indexer}$ has length $zerocount(arcindexed_{indexer})+onecount(arcindexed_{indexer})$, the sum of the lengths of $arcindexed_1,\\ldots,arcindexed_{arcnumber}$ is $arcnumber(zerocount+onecount)$, and so the concatenation of $arcindexed_1',\\ldots,arcindexed_{arcnumber}'$ is a string of $arcnumber(zerocount+onecount)$ consecutive digits around the circle. (This string may wrap around the circle, in which case some of these digits may appear more than once in the string.) Break this string into $arcnumber$ arcs $arcindexed_1'',\\ldots,arcindexed_{arcnumber}''$ each of length $zerocount+onecount$, each adjacent to the previous one. (Note that if the number of digits around the circle is $totaldigits$, then $zerocount+onecount \\leq totaldigits$ since $zerocount(arcindexed_{indexer})+onecount(arcindexed_{indexer}) \\leq totaldigits$ for all $indexer$, and thus each of $arcindexed_1'',\\ldots,arcindexed_{arcnumber}''$ is indeed an arc.)\n\nWe claim that for some $indexer=1,\\ldots,arcnumber$, $zerocount(arcindexed_{indexer}'')=zerocount$ and $onecount(arcindexed_{indexer}'')=onecount$ (where the second equation follows from the first since $zerocount(arcindexed_{indexer}'')+onecount(arcindexed_{indexer}'')=zerocount+onecount$). Otherwise, since all of the $zerocount(arcindexed_{indexer}'')$ differ by at most $1$, either $zerocount(arcindexed_{indexer}'') \\leq zerocount-1$ for all $indexer$ or $zerocount(arcindexed_{indexer}'') \\geq zerocount+1$ for all $indexer$. In either case,\n$|arcnumber\\,zerocount - \\sum_{indexer} zerocount(arcindexed_{indexer}')| = |arcnumber\\,zerocount-\\sum_{indexer} zerocount(arcindexed_{indexer}'')| \\geq arcnumber$. But since $arcindexed_1=arcindexed_1'$, we have\n$|arcnumber\\,zerocount - \\sum_{indexer} zerocount(arcindexed_{indexer}')| = |\\sum_{indexer=1}^{arcnumber} (zerocount(arcindexed_{indexer})-zerocount(arcindexed_{indexer}'))| = |\\sum_{indexer=2}^{arcnumber} (zerocount(arcindexed_{indexer})-zerocount(arcindexed_{indexer}'))| \\leq \\sum_{indexer=2}^{arcnumber} |zerocount(arcindexed_{indexer})-zerocount(arcindexed_{indexer}')| \\leq arcnumber-1$, contradiction."
    },
    "descriptive_long_confusing": {
      "map": {
        "w": "keystroke",
        "w_j": "raincloud",
        "Z": "pinecone",
        "N": "goldminer",
        "L": "hairbrush",
        "k": "driftwood",
        "j": "moonstone",
        "m": "starlight"
      },
      "question": "A finite collection of digits $0$ and $1$ is written around a circle.\nAn \\emph{arc} of length $hairbrush \\geq 0$ consists of $hairbrush$ consecutive digits around the circle. For each arc $keystroke$, let $pinecone(keystroke)$ and $goldminer(keystroke)$ denote the number of $0$'s in $keystroke$ and the number of $1$'s in $keystroke$, respectively.\nAssume that $\\left| pinecone(keystroke) - pinecone(keystroke') \\right| \\leq 1$ for any two arcs $keystroke, keystroke'$ of the same length. Suppose that some arcs $keystroke_1,\\dots,keystroke_{driftwood}$ have the property that\n\\[\npinecone = \\frac{1}{driftwood} \\sum_{moonstone=1}^{driftwood} pinecone(raincloud) \\mbox{ and }\ngoldminer = \\frac{1}{driftwood} \\sum_{moonstone=1}^{driftwood} goldminer(raincloud)\n\\]\nare both integers. Prove that there exists an arc $keystroke$ with $pinecone(keystroke) = pinecone$\nand $goldminer(keystroke) = goldminer$.",
      "solution": "Let $keystroke_1',\\ldots,keystroke_{driftwood}'$ be arcs such that: $raincloud'$ has the same length as $raincloud$; $keystroke_1'$ is the same as $keystroke_1$; and $keystroke_{moonstone+1}'$ is adjacent to $raincloud'$ (i.e., the last digit of $raincloud'$ comes right before the first digit of $keystroke_{moonstone+1}'$). Since $raincloud$ has length $pinecone(raincloud)+goldminer(raincloud)$, the sum of the lengths of $keystroke_1,\\ldots,keystroke_{driftwood}$ is $driftwood(pinecone+goldminer)$, and so the concatenation of $keystroke_1',\\ldots,keystroke_{driftwood}'$ is a string of $driftwood(pinecone+goldminer)$ consecutive digits around the circle. (This string may wrap around the circle, in which case some of these digits may appear more than once in the string.) Break this string into $driftwood$ arcs $keystroke_1'',\\ldots,keystroke_{driftwood}''$ each of length $pinecone+goldminer$, each adjacent to the previous one. (Note that if the number of digits around the circle is $starlight$, then $pinecone+goldminer \\leq starlight$ since $pinecone(raincloud)+goldminer(raincloud) \\leq starlight$ for all $moonstone$, and thus each of $keystroke_1'',\\ldots,keystroke_{driftwood}''$ is indeed an arc.)\n\nWe claim that for some $moonstone=1,\\ldots,driftwood$, $pinecone(raincloud'')=pinecone$ and $goldminer(raincloud'')=goldminer$ (where the second equation follows from the first since $pinecone(raincloud'')+goldminer(raincloud'')=pinecone+goldminer$). Otherwise, since all of the $pinecone(raincloud'')$ differ by at most $1$, either $pinecone(raincloud'') \\leq pinecone-1$ for all $moonstone$ or $pinecone(raincloud'') \\geq pinecone+1$ for all $moonstone$. In either case,\n$\\lvert driftwood\\,pinecone - \\sum_{moonstone} pinecone(raincloud')\\rvert = \\lvert driftwood\\,pinecone-\\sum_{moonstone} pinecone(raincloud'')\\rvert \\geq driftwood$. But since $keystroke_1=keystroke_1'$, we have\n$\\lvert driftwood\\,pinecone - \\sum_{moonstone=1}^{driftwood} pinecone(raincloud')\\rvert = \\lvert\\sum_{moonstone=1}^{driftwood} (pinecone(raincloud)-pinecone(raincloud'))\\rvert = \\lvert\\sum_{moonstone=2}^{driftwood} (pinecone(raincloud)-pinecone(raincloud'))\\rvert \\leq \\sum_{moonstone=2}^{driftwood} \\lvert pinecone(raincloud)-pinecone(raincloud')\\rvert \\leq driftwood-1$, contradiction."
    },
    "descriptive_long_misleading": {
      "map": {
        "w": "straightline",
        "w_j": "straightlinepiece",
        "Z": "onesmeasure",
        "N": "zeroesmeasure",
        "L": "breadthvalue",
        "k": "solitudecount",
        "j": "totalityindex",
        "m": "fewdigitnum"
      },
      "question": "A finite collection of digits $0$ and $1$ is written around a circle.\nAn \\emph{arc} of length $\\breadthvalue \\geq 0$ consists of $\\breadthvalue$ consecutive digits around the circle. For each arc $\\straightline$, let $\\onesmeasure(\\straightline)$ and $\\zeroesmeasure(\\straightline)$ denote the number of $0$'s in $\\straightline$ and the number of $1$'s in $\\straightline$, respectively.\nAssume that $\\left| \\onesmeasure(\\straightline) - \\onesmeasure(\\straightline') \\right| \\leq 1$ for any two arcs $\\straightline, \\straightline'$ of the same length. Suppose that some arcs $\\straightlinepiece_1,\\dots,\\straightlinepiece_{\\solitudecount}$ have the property that\n\\[\n\\onesmeasure = \\frac{1}{\\solitudecount} \\sum_{\\totalityindex=1}^{\\solitudecount} \\onesmeasure(\\straightlinepiece_{\\totalityindex}) \\mbox{ and }\n\\zeroesmeasure = \\frac{1}{\\solitudecount} \\sum_{\\totalityindex=1}^{\\solitudecount} \\zeroesmeasure(\\straightlinepiece_{\\totalityindex})\n\\]\nare both integers. Prove that there exists an arc $\\straightline$ with $\\onesmeasure(\\straightline) = \\onesmeasure$ and $\\zeroesmeasure(\\straightline) = \\zeroesmeasure$.",
      "solution": "Let $\\straightlinepiece_1',\\ldots,\\straightlinepiece_{\\solitudecount}'$ be arcs such that: $\\straightlinepiece_{\\totalityindex}'$ has the same length as $\\straightlinepiece_{\\totalityindex}$; $\\straightlinepiece_1'$ is the same as $\\straightlinepiece_1$; and $\\straightlinepiece_{\\totalityindex+1}'$ is adjacent to $\\straightlinepiece_{\\totalityindex}'$ (i.e., the last digit of $\\straightlinepiece_{\\totalityindex}'$ comes right before the first digit of $\\straightlinepiece_{\\totalityindex+1}'$). Since $\\straightlinepiece_{\\totalityindex}$ has length $\\onesmeasure(\\straightlinepiece_{\\totalityindex})+\\zeroesmeasure(\\straightlinepiece_{\\totalityindex})$, the sum of the lengths of $\\straightlinepiece_1,\\ldots,\\straightlinepiece_{\\solitudecount}$ is $\\solitudecount(\\onesmeasure+\\zeroesmeasure)$, and so the concatenation of $\\straightlinepiece_1',\\ldots,\\straightlinepiece_{\\solitudecount}'$ is a string of $\\solitudecount(\\onesmeasure+\\zeroesmeasure)$ consecutive digits around the circle. (This string may wrap around the circle, in which case some of these digits may appear more than once in the string.) Break this string into $\\solitudecount$ arcs $\\straightlinepiece_1'',\\ldots,\\straightlinepiece_{\\solitudecount}''$ each of length $\\onesmeasure+\\zeroesmeasure$, each adjacent to the previous one. (Note that if the number of digits around the circle is $\\fewdigitnum$, then $\\onesmeasure+\\zeroesmeasure \\leq \\fewdigitnum$ since $\\onesmeasure(\\straightlinepiece_{\\totalityindex})+\\zeroesmeasure(\\straightlinepiece_{\\totalityindex}) \\leq \\fewdigitnum$ for all $\\totalityindex$, and thus each of $\\straightlinepiece_1'',\\ldots,\\straightlinepiece_{\\solitudecount}''$ is indeed an arc.)\n\nWe claim that for some $\\totalityindex=1,\\ldots,\\solitudecount$, $\\onesmeasure(\\straightlinepiece_{\\totalityindex}'')=\\onesmeasure$ and $\\zeroesmeasure(\\straightlinepiece_{\\totalityindex}'')=\\zeroesmeasure$ (where the second equation follows from the first since $\\onesmeasure(\\straightlinepiece_{\\totalityindex}'')+\\zeroesmeasure(\\straightlinepiece_{\\totalityindex}'')=\\onesmeasure+\\zeroesmeasure$). Otherwise, since all of the $\\onesmeasure(\\straightlinepiece_{\\totalityindex}'')$ differ by at most $1$, either $\\onesmeasure(\\straightlinepiece_{\\totalityindex}'') \\leq \\onesmeasure-1$ for all $\\totalityindex$ or $\\onesmeasure(\\straightlinepiece_{\\totalityindex}'') \\geq \\onesmeasure+1$ for all $\\totalityindex$. In either case,\n$|\\solitudecount\\onesmeasure - \\sum_{\\totalityindex} \\onesmeasure(\\straightlinepiece_{\\totalityindex}')| = |\\solitudecount\\onesmeasure-\\sum_{\\totalityindex} \\onesmeasure(\\straightlinepiece_{\\totalityindex}'')| \\geq \\solitudecount$. But since $\\straightlinepiece_1=\\straightlinepiece_1'$, we have\n$|\\solitudecount\\onesmeasure - \\sum_{\\totalityindex} \\onesmeasure(\\straightlinepiece_{\\totalityindex}')| = |\\sum_{\\totalityindex=1}^{\\solitudecount} (\\onesmeasure(\\straightlinepiece_{\\totalityindex})-\\onesmeasure(\\straightlinepiece_{\\totalityindex}'))| = |\\sum_{\\totalityindex=2}^{\\solitudecount} (\\onesmeasure(\\straightlinepiece_{\\totalityindex})-\\onesmeasure(\\straightlinepiece_{\\totalityindex}'))| \\leq \\sum_{\\totalityindex=2}^{\\solitudecount} |\\onesmeasure(\\straightlinepiece_{\\totalityindex})-\\onesmeasure(\\straightlinepiece_{\\totalityindex}')| \\leq \\solitudecount-1$, contradiction."
    },
    "garbled_string": {
      "map": {
        "w": "avkzmpqj",
        "w_j": "qhwxdert",
        "Z": "msidvpla",
        "N": "rlbfkwze",
        "L": "gcytshpr",
        "k": "bnzqlxwu",
        "j": "oivcrmeg",
        "m": "sdphtlko"
      },
      "question": "A finite collection of digits $0$ and $1$ is written around a circle.\nAn \\emph{arc} of length $gcytshpr \\geq 0$ consists of $gcytshpr$ consecutive digits around the circle. For each arc $avkzmpqj$, let $msidvpla(avkzmpqj)$ and $rlbfkwze(avkzmpqj)$ denote the number of $0$'s in $avkzmpqj$ and the number of $1$'s in $avkzmpqj$, respectively.\nAssume that $\\left| msidvpla(avkzmpqj) - msidvpla(avkzmpqj') \\right| \\leq 1$ for any two arcs $avkzmpqj, avkzmpqj'$ of the same length. Suppose that some arcs $avkzmpqj_1,\\dots,avkzmpqj_{bnzqlxwu}$ have the property that\n\\[\nmsidvpla = \\frac{1}{bnzqlxwu} \\sum_{oivcrmeg=1}^{bnzqlxwu} msidvpla(qhwxdert) \\mbox{ and }\nrlbfkwze = \\frac{1}{bnzqlxwu} \\sum_{oivcrmeg=1}^{bnzqlxwu} rlbfkwze(qhwxdert)\n\\]\nare both integers. Prove that there exists an arc $avkzmpqj$ with $msidvpla(avkzmpqj) = msidvpla$\nand $rlbfkwze(avkzmpqj) = rlbfkwze$.",
      "solution": "Let $avkzmpqj_1',\\ldots,avkzmpqj_{bnzqlxwu}'$ be arcs such that: $qhwxdert'$ has the same length as $qhwxdert$; $avkzmpqj_1'$ is the same as $avkzmpqj_1$; and $avkzmpqj_{oivcrmeg+1}'$ is adjacent to $qhwxdert'$ (i.e., the last digit of $qhwxdert'$ comes right before the first digit of $avkzmpqj_{oivcrmeg+1}'$). Since $qhwxdert$ has length $msidvpla(qhwxdert)+rlbfkwze(qhwxdert)$, the sum of the lengths of $avkzmpqj_1,\\ldots,avkzmpqj_{bnzqlxwu}$ is $bnzqlxwu(msidvpla+rlbfkwze)$, and so the concatenation of $avkzmpqj_1',\\ldots,avkzmpqj_{bnzqlxwu}'$ is a string of $bnzqlxwu(msidvpla+rlbfkwze)$ consecutive digits around the circle. (This string may wrap around the circle, in which case some of these digits may appear more than once in the string.) Break this string into $bnzqlxwu$ arcs $avkzmpqj_1'',\\ldots,avkzmpqj_{bnzqlxwu}''$ each of length $msidvpla+rlbfkwze$, each adjacent to the previous one. (Note that if the number of digits around the circle is $sdphtlko$, then $msidvpla+rlbfkwze \\leq sdphtlko$ since $msidvpla(qhwxdert)+rlbfkwze(qhwxdert) \\leq sdphtlko$ for all $oivcrmeg$, and thus each of $avkzmpqj_1'',\\ldots,avkzmpqj_{bnzqlxwu}''$ is indeed an arc.)\n\nWe claim that for some $oivcrmeg=1,\\ldots,bnzqlxwu$, $msidvpla(qhwxdert'')=msidvpla$ and $rlbfkwze(qhwxdert'')=rlbfkwze$ (where the second equation follows from the first since $msidvpla(qhwxdert'')+rlbfkwze(qhwxdert'')=msidvpla+rlbfkwze$). Otherwise, since all of the $msidvpla(qhwxdert'')$ differ by at most $1$, either $msidvpla(qhwxdert'') \\leq msidvpla-1$ for all $oivcrmeg$ or $msidvpla(qhwxdert'') \\geq msidvpla+1$ for all $oivcrmeg$. In either case,\n$\\left|bnzqlxwu\\,msidvpla - \\sum_{oivcrmeg} msidvpla(qhwxdert')\\right| = \\left|bnzqlxwu\\,msidvpla-\\sum_{oivcrmeg} msidvpla(qhwxdert'')\\right| \\geq bnzqlxwu$. But since $avkzmpqj_1=avkzmpqj_1'$, we have\n$\\left|bnzqlxwu\\,msidvpla - \\sum_{oivcrmeg} msidvpla(qhwxdert')\\right| = \\left|\\sum_{oivcrmeg=1}^{bnzqlxwu} (msidvpla(qhwxdert)-msidvpla(qhwxdert'))\\right| = \\left|\\sum_{oivcrmeg=2}^{bnzqlxwu} (msidvpla(qhwxdert)-msidvpla(qhwxdert'))\\right| \\leq \\sum_{oivcrmeg=2}^{bnzqlxwu} |msidvpla(qhwxdert)-msidvpla(qhwxdert')| \\leq bnzqlxwu-1$, contradiction."
    },
    "kernel_variant": {
      "question": "A circular necklace is made of a finite number of beads, each bead being either sapphire (S) or emerald (E).\n\nFor a positive integer \\(\\ell\\ge 1\\), an \\emph{arc of length \\(\\ell\\)} is a string of \\(\\ell\\) consecutive beads read clockwise around the necklace.  For any arc \\(w\\) let \\(S(w)\\) (resp. \\(E(w)\\)) denote the number of sapphire (resp. emerald) beads it contains.\n\nAssume that for every pair of arcs \\(u,v\\) having the same length one has\n\\[|S(u)-S(v)|\\le 1.\\]\n\nLet \\(w_1,\\dots ,w_k\\) be (not necessarily distinct) arcs for which\n\\[\\overline S\\;:=\\;\\frac1k\\sum_{j=1}^{k}S(w_j), \\qquad \\overline E\\;:=\\;\\frac1k\\sum_{j=1}^{k}E(w_j)\\]\nare both integers.  Prove that there exists an arc \\(w\\) with\n\\[S(w)=\\overline S\\quad\\text{and}\\quad E(w)=\\overline E.\\]",
      "solution": "Let the given arcs be w₁,…,wₖ, and write L_j = S(w_j) + E(w_j) for the length of w_j.  Set\n  N = ∑_{j=1}^k L_j  = k(\\bar S + \\bar E),\nwhere \\bar S and \\bar E are the given integer averages.  Number the beads on the necklace 1,2,…,m cyclically, and let a be the index of the first bead of w₁.  Define a string W of N consecutive beads by starting at bead a and reading clockwise for N beads (wrapping around past m back to 1 if necessary).  Thus W is a contiguous arc of length N on the necklace.\n\nStep 1.  Two partitions of W.\n––––––––––––––––––––––––––––––\nPartition W in the “equal–length” way into k blocks\n  u₁, u₂, …, uₖ,\neach of length L = \\bar S + \\bar E, by letting u_i be beads number (i–1)L+1 through iL in W.  Since any two arcs of the same length differ in their sapphire–count by at most 1, we have\n  |S(u_i) – S(u_j)| ≤ 1\nfor all i,j.\n\nAlso partition W in the “original–length” way into k blocks\n  v₁, v₂, …, vₖ,\nwhere for each j, v_j is the next L_j beads of W.  By construction v₁ is exactly w₁, so S(v₁)=S(w₁).  For j≥2, v_j is some arc of length L_j on the necklace, and w_j is another such arc, so by the uniformity hypothesis\n  |S(v_j) – S(w_j)| ≤ 1.\nHence\n  |∑_{j=1}^k S(v_j) – ∑_{j=1}^k S(w_j)|\n    = |S(v₁)–S(w₁) + ∑_{j=2}^k (S(v_j)–S(w_j))|\n    ≤ 0 + ∑_{j=2}^k 1\n    = k–1.\nBut ∑_{j=1}^k S(w_j)=k\\bar S, so\n  |∑_{j=1}^k S(v_j) – k\\bar S| ≤ k–1.      (*2)\n\nStep 2.  A contradiction if no u_i has S(u_i)=\\bar S.\n––––––––––––––––––––––––––––––––––––––––––––––\nSuppose for contradiction that no u_i satisfies S(u_i)=\\bar S.  Since all the S(u_i) differ by at most 1, they must all lie in one of the two sets {≤\\bar S–1} or {≥\\bar S+1}.  In the first case\n  ∑_{i=1}^k S(u_i) ≤ k(\\bar S–1) = k\\bar S – k,\nand in the second\n  ∑_{i=1}^k S(u_i) ≥ k(\\bar S+1) = k\\bar S + k.\nIn either case\n  |∑_{i=1}^k S(u_i) – k\\bar S| ≥ k.       (*1)\n\nBut the u–blocks and the v–blocks exhaust exactly the same multiset of beads in W, so\n  ∑_{i=1}^k S(u_i) = ∑_{j=1}^k S(v_j).\nCombining this with (*1) and (*2) yields the impossible chain\n  k ≤ |∑S(u_i) – k\\bar S| = |∑S(v_j) – k\\bar S| ≤ k–1.\n\nConclusion.\n––––––––––\nOur assumption was false, so some u_i has S(u_i)=\\bar S.  But u_i has length L=\\bar S+\\bar E, whence E(u_i)=L–S(u_i)=\\bar E.  Therefore u_i is the desired arc with exactly the prescribed numbers of sapphires and emeralds.",
      "_meta": {
        "core_steps": [
          "Place the given k arcs head-to-tail to form one consecutive string of length k(Z+N).",
          "Cut that string into k adjacent arcs, each of length Z+N.",
          "Use the hypothesis |Z(w)−Z(w′)|≤1 for equal-length arcs to show the Z–counts of these k arcs differ by at most 1.",
          "Assume none of those k arcs has exactly Z zeros; then every one deviates from Z in the same direction, producing an overall discrepancy ≥k.",
          "Bound the total discrepancy by ≤k−1 via pairwise differences between original and rearranged arcs, obtaining a contradiction and hence an arc with Z zeros and N ones."
        ],
        "mutable_slots": {
          "slot1": {
            "description": "The actual two symbols being counted; any two distinct symbols work because only their counts matter.",
            "original": "digits 0 and 1"
          },
          "slot2": {
            "description": "Permission for arcs of zero length; the proof never uses length 0, so lengths could be required to be positive.",
            "original": "arc length L ≥ 0 (includes L = 0)"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}