{
  "index": "1965-B-2",
  "type": "COMB",
  "tag": [
    "COMB",
    "ALG"
  ],
  "difficulty": "",
  "question": "B-2. In a round-robin tournament with \\( n \\) players \\( P_{1}, P_{2}, \\cdots, P_{n} \\) (where \\( n>1 \\) ), each player plays one game with each of the other players and the rules are such that no ties can occur. Let \\( \\omega_{r} \\) and \\( l_{r} \\) be the number of games won and lost, respectively, by \\( P_{r} \\). Show that\n\\[\n\\sum_{r=1}^{n} w_{r}^{2}=\\sum_{r=1}^{n} l_{r}^{2}\n\\]",
  "solution": "\\begin{array}{l}\n\\text { B-2. Clearly } \\omega_{r}+l_{r}=n-1 \\text { for } r=1,2, \\cdots, n \\text { and } \\sum_{1}^{n} \\omega_{r}=\\sum_{1}^{n} l_{r} \\text {. Hence, }\\\\\n\\sum_{1}^{n} \\omega_{r}^{2}-\\sum_{1}^{n} l_{r}^{2}=\\sum_{1}^{n}\\left(\\omega_{r}-l_{r}\\right)\\left(\\omega_{r}+l_{r}\\right)=(n-1) \\sum_{1}^{n}\\left(\\omega_{r}-l_{r}\\right)=(n-1) \\cdot 0=0 .\n\\end{array}",
  "vars": [
    "w_r",
    "\\\\omega_r",
    "l_r"
  ],
  "params": [
    "n",
    "P_1",
    "P_2",
    "P_n"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "w_r": "gameswon",
        "\\\\omega_r": "totalwins",
        "l_r": "gameslost",
        "n": "playercount",
        "P_1": "firstplayer",
        "P_2": "secondplayer",
        "P_n": "lastplayer"
      },
      "question": "B-2. In a round-robin tournament with \\( playercount \\) players \\( firstplayer, secondplayer, \\cdots, lastplayer \\) (where \\( playercount>1 \\) ), each player plays one game with each of the other players and the rules are such that no ties can occur. Let \\( totalwins \\) and \\( gameslost \\) be the number of games won and lost, respectively, by \\( P_{r} \\). Show that\n\\[\n\\sum_{r=1}^{playercount} gameswon^{2}=\\sum_{r=1}^{playercount} gameslost^{2}\n\\]",
      "solution": "\\begin{array}{l}\n\\text { B-2. Clearly } totalwins+gameslost=playercount-1 \\text { for } r=1,2, \\cdots, playercount \\text { and } \\sum_{1}^{playercount} totalwins=\\sum_{1}^{playercount} gameslost \\text {. Hence, }\\\\\n\\sum_{1}^{playercount} totalwins^{2}-\\sum_{1}^{playercount} gameslost^{2}=\\sum_{1}^{playercount}\\left(totalwins-gameslost\\right)\\left(totalwins+gameslost\\right)=(playercount-1) \\sum_{1}^{playercount}\\left(totalwins-gameslost\\right)=(playercount-1) \\cdot 0=0 .\n\\end{array}"
    },
    "descriptive_long_confusing": {
      "map": {
        "w_r": "riverside",
        "\\omega_r": "chandelier",
        "l_r": "butterfly",
        "n": "whileloop",
        "P_1": "watermelon",
        "P_2": "blacksmith",
        "P_n": "trebuchet"
      },
      "question": "B-2. In a round-robin tournament with \\( whileloop \\) players \\( watermelon, blacksmith, \\cdots, trebuchet \\) (where \\( whileloop>1 \\) ), each player plays one game with each of the other players and the rules are such that no ties can occur. Let \\( chandelier_{r} \\) and \\( butterfly_{r} \\) be the number of games won and lost, respectively, by \\( P_{r} \\). Show that\n\\[\n\\sum_{r=1}^{whileloop} riverside_{r}^{2}=\\sum_{r=1}^{whileloop} butterfly_{r}^{2}\n\\]",
      "solution": "\\begin{array}{l}\n\\text { B-2. Clearly } chandelier_{r}+butterfly_{r}=whileloop-1 \\text { for } r=1,2, \\cdots, whileloop \\text { and } \\sum_{1}^{whileloop} chandelier_{r}=\\sum_{1}^{whileloop} butterfly_{r} \\text {. Hence, }\\\\\n\\sum_{1}^{whileloop} chandelier_{r}^{2}-\\sum_{1}^{whileloop} butterfly_{r}^{2}=\\sum_{1}^{whileloop}\\left(chandelier_{r}-butterfly_{r}\\right)\\left(chandelier_{r}+butterfly_{r}\\right)=(whileloop-1) \\sum_{1}^{whileloop}\\left(chandelier_{r}-butterfly_{r}\\right)=(whileloop-1) \\cdot 0=0 .\n\\end{array}"
    },
    "descriptive_long_misleading": {
      "map": {
        "w_r": "losescore",
        "\\\\omega_r": "losescore",
        "l_r": "winsscore",
        "n": "soloplayer",
        "P_1": "spectatorone",
        "P_2": "spectatortwo",
        "P_n": "spectatorlast"
      },
      "question": "B-2. In a round-robin tournament with \\( soloplayer \\) players \\( spectatorone, spectatortwo, \\cdots, spectatorlast \\) (where \\( soloplayer>1 \\) ), each player plays one game with each of the other players and the rules are such that no ties can occur. Let \\( losescore_{r} \\) and \\( winsscore_{r} \\) be the number of games won and lost, respectively, by \\( P_{r} \\). Show that\n\\[\n\\sum_{r=1}^{soloplayer} losescore_{r}^{2}=\\sum_{r=1}^{soloplayer} winsscore_{r}^{2}\n\\]",
      "solution": "\\begin{array}{l}\n\\text { B-2. Clearly } losescore_{r}+winsscore_{r}=soloplayer-1 \\text { for } r=1,2, \\cdots, soloplayer \\text { and } \\sum_{1}^{soloplayer} losescore_{r}=\\sum_{1}^{soloplayer} winsscore_{r} \\text {. Hence, }\\\\\n\\sum_{1}^{soloplayer} losescore_{r}^{2}-\\sum_{1}^{soloplayer} winsscore_{r}^{2}=\\sum_{1}^{soloplayer}\\left(losescore_{r}-winsscore_{r}\\right)\\left(losescore_{r}+winsscore_{r}\\right)=(soloplayer-1) \\sum_{1}^{soloplayer}\\left(losescore_{r}-winsscore_{r}\\right)=(soloplayer-1) \\cdot 0=0 .\n\\end{array}"
    },
    "garbled_string": {
      "map": {
        "w_r": "qzxwvtnp",
        "\\\\omega_r": "hjgrksla",
        "l_r": "ksdjqjzp",
        "n": "gfdkalwm",
        "P_1": "rqmfndca",
        "P_2": "ptlevoxh",
        "P_n": "smyxeruv"
      },
      "question": "B-2. In a round-robin tournament with \\( gfdkalwm \\) players \\( rqmfndca, ptlevoxh, \\cdots, smyxeruv \\) (where \\( gfdkalwm>1 \\) ), each player plays one game with each of the other players and the rules are such that no ties can occur. Let \\( hjgrksla \\) and \\( ksdjqjzp \\) be the number of games won and lost, respectively, by \\( P_{r} \\). Show that\n\\[\n\\sum_{r=1}^{gfdkalwm} qzxwvtnp^{2}=\\sum_{r=1}^{gfdkalwm} ksdjqjzp^{2}\n\\]",
      "solution": "\\begin{array}{l}\n\\text { B-2. Clearly } hjgrksla+ksdjqjzp=gfdkalwm-1 \\text { for } r=1,2, \\cdots, gfdkalwm \\text { and } \\sum_{1}^{gfdkalwm} hjgrksla=\\sum_{1}^{gfdkalwm} ksdjqjzp \\text {. Hence, }\\\\\n\\sum_{1}^{gfdkalwm} hjgrksla^{2}-\\sum_{1}^{gfdkalwm} ksdjqjzp^{2}=\\sum_{1}^{gfdkalwm}\\left(hjgrksla-ksdjqjzp\\right)\\left(hjgrksla+ksdjqjzp\\right)=(gfdkalwm-1) \\sum_{1}^{gfdkalwm}\\left(hjgrksla-ksdjqjzp\\right)=(gfdkalwm-1) \\cdot 0=0 .\n\\end{array}"
    },
    "kernel_variant": {
      "question": "Fix an integer $n\\ge 2$.  \nIn a (single) round–robin tournament — every unordered pair of distinct players meets exactly once and every game has a winner and a loser — let  \n\n$\\bullet$ $w_r$ and $l_r$ be, respectively, the numbers of games won and lost by player $P_r$;  \n\n$\\bullet$ $d_r=w_r-l_r$ be the score–differential of $P_r$.\n\nAnswer the following four questions.\n\n(a)  Prove that $\\displaystyle\\sum_{r=1}^{n}d_r=0$.\n\n(b)  For every non–empty subset $T\\subseteq\\{1,2,\\dots ,n\\}$ with $t=|T|$ players show that  \n\\[\n\\sum_{r\\in T}d_r\\;\\le\\;t\\,(n-t).\n\\tag{1}\n\\]\n\n(c)  An integer $n$–tuple $(d_1,\\dots ,d_n)$ is the score–differential vector of \\emph{some} round–robin tournament on $n$ players if and only if simultaneously  \n\n\\quad(i)   $\\displaystyle\\sum_{r=1}^{n}d_r=0$;  \n\n\\quad(ii)  Inequality (1) holds for every non–empty subset $T\\subseteq\\{1,\\dots ,n\\}$;  \n\n\\quad(iii) Every coordinate satisfies the parity restriction  \n\\[\nd_r\\equiv n-1\\pmod 2\\qquad(r=1,\\dots ,n).\n\\]\n\n(d)  Denote  \n\\[\nS(n)=\\sum_{r=1}^{n}w_r^{2}\n\\quad\\bigl(\\text{equivalently }S(n)=\\sum_{r=1}^{n}l_r^{2}\\bigr).\n\\]\nAmong all round–robin tournaments on $n$ players determine the exact minimum and maximum of $S(n)$ and describe \\emph{all} tournaments at which each extremum is attained.",
      "solution": "Throughout write $E(T,\\overline T)$ for the collection of edges with one endpoint in $T$ and the other in its complement $\\overline T$.\n\n------------------------------------------------\n(a)  Each game supplies exactly one win and one loss, so   \n\\[\n\\sum_{r=1}^{n}w_r=\\binom{n}{2}=\\sum_{r=1}^{n}l_r\n\\Longrightarrow \n\\sum_{r=1}^{n}d_r=\\sum_{r=1}^{n}(w_r-l_r)=0.\n\\qquad\\square\n\\]\n\n------------------------------------------------\n(b)  Fix $T\\subseteq[n]$ with $|T|=t$.  \nExactly $t(n-t)$ games are played across the cut $E(T,\\overline T)$.  \nDefine  \n\\[\n\\operatorname{out}(T)=\\sum_{r\\in T}\\#\\{\\text{wins of }P_r\\text{ versus }\\overline T\\},\\qquad\n\\operatorname{in}(T)=\\sum_{r\\in T}\\#\\{\\text{losses of }P_r\\text{ to }\\overline T\\}.\n\\]\nThen $\\operatorname{out}(T)+\\operatorname{in}(T)=t(n-t)$ and  \n\\[\n\\sum_{r\\in T}d_r\n=\\sum_{r\\in T}(w_r-l_r)\n=\\operatorname{out}(T)-\\operatorname{in}(T)\n=t(n-t)-2\\,\\operatorname{in}(T)\\le t(n-t).\n\\]\nThus (1) holds. $\\square$\n\n------------------------------------------------\n(c)  Necessity and sufficiency of (i)–(iii).\n\nNecessity.  Part (a) yields (i) and part (b) yields (ii); (iii) is immediate from  \n$w_r+l_r=n-1\\Longrightarrow d_r\\equiv n-1\\pmod 2$.\n\nSufficiency.  Assume an integer vector $\\mathbf d=(d_1,\\dots ,d_n)$ satisfies (i)–(iii) and define  \n\\[\ns_r=\\frac12\\!\\bigl((n-1)+d_r\\bigr)\\qquad(r=1,\\dots ,n).\n\\]\nBecause of (iii) each $s_r$ is an integer with $0\\le s_r\\le n-1$, and by (i)\n\\[\n\\sum_{r=1}^{n}s_r=\\frac12\\sum_{r=1}^{n}(n-1+d_r)=\\binom{n}{2}.\n\\]\nHence $\\mathbf s=(s_1,\\dots ,s_n)$ is a viable candidate for the out–degree sequence of a tournament.\n\nLandau’s classical criterion (stated in non–decreasing order) asserts:\n\nLet $s_{(1)}\\le\\dots\\le s_{(n)}$ be the increasing rearrangement of the $s_r$.\nAn integer sequence $(s_r)$ with the above bounds and sum is the score sequence of a tournament if and only if\n\\[\n\\sum_{i=1}^{k}s_{(i)}\\;\\ge\\;\\binom{k}{2}\\qquad(k=1,\\dots ,n).\n\\tag{2}\n\\]\n\nWe verify (2).  \nFor $k\\in\\{1,\\dots ,n\\}$ let $T_k$ be the set of indices of the $k$ \\emph{largest} coordinates of $\\mathbf s$.  \nBecause $s_r=\\frac12[(n-1)+d_r]$, inequality (1) applied to the complement $\\overline{T}_k$ gives\n\\[\n\\sum_{r\\in T_k}d_r\n=-\\!\\sum_{r\\in \\overline{T}_k}d_r\n\\;\\ge\\;-k(n-k),\n\\]\nwhence\n\\[\n\\sum_{r\\in T_k}s_r\n=\\frac12\\!\\Bigl(k(n-1)+\\sum_{r\\in T_k}d_r\\Bigr)\n\\;\\ge\\;\\frac12\\!\\bigl(k(n-1)-k(n-k)\\bigr)\n=\\binom{k}{2}.\n\\tag{3}\n\\]\n\nLet $U_k=[n]\\setminus T_{n-k}$; $U_k$ consists of the $k$ \\emph{smallest} $s_r$.  \nExactly the same computation yields\n\\[\n\\sum_{r\\in U_k}s_r\\;\\ge\\;\\binom{k}{2}.\n\\tag{4}\n\\]\nRelation (4) is precisely (2) for the $k$ smallest coordinates, while (3) implies (2) for the $k$ largest ones (replace $k$ by $n-k$).  \nHence (2) holds for every $k$, so by Landau the multiset $\\{s_1,\\dots ,s_n\\}$ is realised by some tournament; its score–differential vector is exactly $\\mathbf d$. $\\square$\n\n\n\n------------------------------------------------\n(d)  Extremal values of $S(n)=\\sum_{r=1}^{n}w_r^{2}$.\n\nWrite  \n\\[\nQ(\\mathbf d)=\\sum_{r=1}^{n}d_r^{2},\\qquad\nS(n)=\\sum_{r=1}^{n}w_r^{2}.\n\\]\nWith $w_r=\\frac12[(n-1)+d_r]$ and $\\sum d_r=0$ one obtains\n\\[\nS(n)=\\frac14\\sum_{r=1}^{n}\\bigl((n-1)+d_r\\bigr)^{2}\n     =\\frac{n}{4}(n-1)^{2}+\\frac14\\,Q(\\mathbf d).\n\\tag{5}\n\\]\nThus maximising/minimising $S(n)$ is equivalent to maximising/minimising the quadratic form $Q(\\mathbf d)$ over the feasible set  \n\\[\n\\mathcal D=\\{\\mathbf d\\in\\mathbb Z^{n}\\text{ satisfying (i)–(iii)}\\}.\n\\]\n\n────────────────────────────────\nMaximum of $S(n)$.\n\nPut $s_r=\\frac12[(n-1)+d_r]$.  Because\n\\[\nQ(\\mathbf d)=4\\sum_{r=1}^{n}\\!\\Bigl(s_r-\\tfrac{n-1}{2}\\Bigr)^{2}\n           =4\\sum_{r=1}^{n}s_r^{2}-n(n-1)^{2},\n\\]\nmaximising $Q$ is tantamount to maximising $\\sum s_r^{2}$.\n\nMajorisation argument.  \nLet $\\mathbf s=(s_1,\\dots ,s_n)$ be the score sequence of a tournament and let $s_{(1)}\\le\\dots\\le s_{(n)}$ be its increasing rearrangement.  \nThe Landau inequalities (2) together with their complements read\n\\[\n\\sum_{i=1}^{k}s_{(i)}\\ge\\binom{k}{2}\\quad\\text{and}\\quad\n\\sum_{i=n-k+1}^{n}s_{(i)}\\le\\binom{n}{2}-\\binom{k}{2}\\qquad(k=1,\\dots ,n).\n\\tag{6}\n\\]\nThe canonical multiset  \n\\[\n\\mathbf t=(0,1,2,\\dots ,n-1)\n\\]\nsatisfies the equalities in (6).  Therefore $\\mathbf t$ majorises every other score multiset, and Karamata’s inequality gives  \n$\\sum s_r^{2}\\le\\sum t_r^{2}$, with equality only if $\\{s_r\\}=\\{t_r\\}$.\n\nHence the maximum of $\\sum s_r^{2}$ and thus of $Q(\\mathbf d)$ is attained exactly for the multiset $\\{0,1,\\dots ,n-1\\}$.  \nThis score sequence is realised by any \\emph{transitive} (acyclic) tournament, i.e. one obtained by totally ordering the vertices and orienting every edge forward.  Translating back,\n\\[\nd_r=n-1-2(r-1)\\qquad(r=1,\\dots ,n),\n\\]\nup to permutation.  Direct calculation yields\n\\[\nQ_{\\max}=\\sum_{k=0}^{n-1}(n-1-2k)^{2}=\\frac{n\\bigl(n^{2}-1\\bigr)}{3},\n\\qquad\nS_{\\max}(n)=\\frac14\\!\\Bigl(n(n-1)^{2}+Q_{\\max}\\Bigr)\n           =\\frac{n(n-1)(2n-1)}{6}.\n\\]\nBecause of the preceding majorisation argument equality in $S\\le S_{\\max}(n)$ implies $\\{s_r\\}=\\{0,1,\\dots ,n-1\\}$, hence the tournament is transitive.  Thus the maximum is realised \\emph{only} by transitive tournaments.\n\n────────────────────────────────\nMinimum of $S(n)$.\n\nBecause $\\sum d_r=0$, the quadratic $Q(\\mathbf d)$ is minimised when the coordinates of $\\mathbf d$ are as balanced as the parity restriction allows.\n\n• Odd $n=2m+1$.  \nParity forces every $d_r$ to be even.  Choosing a regular tournament (each player wins and loses $m$ games) yields $\\mathbf d=\\mathbf0$ and\n$Q_{\\min}=0$.  \nAny non–zero feasible vector has at least one coordinate $\\lvert d_r\\rvert\\ge2$, giving $Q\\ge4$; hence regular tournaments (and only those) achieve the minimum.\n\n• Even $n=2m$.  \nNow every $d_r$ is odd, so $\\lvert d_r\\rvert\\ge1$.  The least possible quadratic sum is obtained when \\emph{exactly} $m$ coordinates equal $+1$ and the remaining $m$ equal $-1$, giving $Q_{\\min}=m+m=2m=n$.\n\nExistence of such tournaments.  \nLabel the vertices $0,1,\\dots ,2m-1$ and perform all computations modulo $2m$.\n\nStep 1 – orient edges of \\emph{length} $1,2,\\dots ,m-1$.  \nFor $i\\ne j$ with $1\\le (j-i)\\bmod 2m\\le m-1$ direct the edge $\\{i,j\\}$ from $i$ to $j$.  \nThis yields a digraph in which every unordered pair whose distance is not $m$ is oriented exactly once.\n\nStep 2 – orient the $m$ antipodal edges of length $m$.  \nFor each $i\\in\\{0,1,\\dots ,m-1\\}$ orient the edge $\\{i,i+m\\}$ \\emph{from} $i$ \\emph{to} $i+m$.  \n\nThe two steps together orient every unordered pair exactly once, hence produce a tournament.  Let us count wins.\n\n• Vertices $i<m$.  \nFrom Step 1 they beat the $m-1$ vertices at distances $1,2,\\dots ,m-1$, and from Step 2 they additionally beat $i+m$.  \nThus $w_i=m$ and $d_i=+1$.\n\n• Vertices $i\\ge m$.  \nStep 1 grants them $m-1$ wins (against the vertices at backward distances $1,2,\\dots ,m-1$), while Step 2 gives a \\emph{loss} against $i-m$.  \nHence $w_i=m-1$ and $d_i=-1$.\n\nConsequently the constructed tournament realises the differential vector\n\\[\n(\\underbrace{1,\\dots ,1}_{m},\\underbrace{-1,\\dots ,-1}_{m}),\n\\]\nso $Q=n$ and $S(n)$ attains its minimum.\n\nMinimality.  Let $\\mathbf d$ be any feasible vector with $Q(\\mathbf d)<n+2$.  \nBecause every $d_r$ is odd, $\\lvert d_r\\rvert\\ge1$, so $Q(\\mathbf d)\\ge n$.  \nIf some $\\lvert d_r\\rvert\\ge3$, then  \n$Q(\\mathbf d)\\ge 3^{2}+(n-1)\\cdot 1^{2}=n+8>n$, impossible.  \nHence every $\\lvert d_r\\rvert=1$.  \nFinally $\\sum d_r=0$ forces exactly $m$ entries $+1$ and $m$ entries $-1$.  \nTherefore $Q_{\\min}=n$ and the above pattern is the \\emph{only} one that achieves it.\n\nCombining with (5),\n\\[\nS_{\\min}(n)=\n\\begin{cases}\n\\dfrac{n}{4}(n-1)^{2}, & n\\ \\text{odd},\\\\[10pt]\n\\dfrac{n}{4}(n-1)^{2}+\\dfrac{n}{4}, & n\\ \\text{even}.\n\\end{cases}\n\\]\nFor odd $n$ equality occurs exactly at regular tournaments; for even $n$ at precisely the tournaments whose differential vector consists of $m$ entries $+1$ and $m$ entries $-1$.\n\n────────────────────────────────\nSummary of extrema.\n\n\\[\n\\boxed{\\;\nS_{\\max}(n)=\\frac{n(n-1)(2n-1)}{6}\\text{ — realised exactly by the transitive tournaments;}\n\\qquad\nS_{\\min}(n)=\n\\begin{cases}\n\\dfrac{n}{4}(n-1)^{2}, & n\\ \\text{odd},\\\\[10pt]\n\\dfrac{n}{4}(n-1)^{2}+\\dfrac{n}{4}, & n\\ \\text{even},\n\\end{cases}\n}\n\\]\nwith equality in the second formula iff the tournament is regular (odd $n$) or has differential vector $\\bigl(\\underbrace{1,\\dots ,1}_{m},\\underbrace{-1,\\dots ,-1}_{m}\\bigr)$ (even $n=2m$). $\\square$",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.557052",
        "was_fixed": false,
        "difficulty_analysis": "The original exercise shows a single, easy quadratic identity and is dispatched in two short lines.  \nThe enhanced variant\n\n• introduces the \\emph{score–differential vector} \\((d_1,\\dots ,d_n)\\), raising the dimension of the problem;  \n• imposes the \\emph{cut inequalities} (1), drawing on flow-cut ideas in graph theory;  \n• invokes and proves a version of \\emph{Landau’s theorem} (part (c)), a classical but non-trivial characterisation of realisable degree sequences in tournaments that requires algorithmic construction (Havel–Hakimi) or inductive combinatorial reasoning;  \n• converts the original quadratic identity into an extremal optimisation problem over a high-dimensional polytope, demanding convexity, extreme-point analysis and careful parity arguments; and  \n• fully characterises the extremal tournaments, showing that only transitive or almost-regular tournaments achieve the respective bounds.\n\nThe solution therefore mixes combinatorial counting, inequalities on cuts, polyhedral–combinatorial characterisation, convex optimisation, and explicit constructive algorithms, far surpassing the single-line algebraic manipulation that sufficed for the original problem."
      }
    },
    "original_kernel_variant": {
      "question": "Fix an integer $n\\ge 2$.  \nIn a (single) round–robin tournament — every unordered pair of distinct players meets exactly once and every game has a winner and a loser — let  \n\n$\\bullet$ $w_r$ and $l_r$ be, respectively, the numbers of games won and lost by player $P_r$;  \n\n$\\bullet$ $d_r=w_r-l_r$ be the score–differential of $P_r$.\n\nAnswer the following four questions.\n\n(a)  Prove that $\\displaystyle\\sum_{r=1}^{n}d_r=0$.\n\n(b)  For every non–empty subset $T\\subseteq\\{1,2,\\dots ,n\\}$ with $t=|T|$ players show that  \n\\[\n\\sum_{r\\in T}d_r\\;\\le\\;t\\,(n-t).\n\\tag{1}\n\\]\n\n(c)  An integer $n$–tuple $(d_1,\\dots ,d_n)$ is the score–differential vector of \\emph{some} round–robin tournament on $n$ players if and only if simultaneously  \n\n\\quad(i)   $\\displaystyle\\sum_{r=1}^{n}d_r=0$;  \n\n\\quad(ii)  Inequality (1) holds for every non–empty subset $T\\subseteq\\{1,\\dots ,n\\}$;  \n\n\\quad(iii) Every coordinate satisfies the parity restriction  \n\\[\nd_r\\equiv n-1\\pmod 2\\qquad(r=1,\\dots ,n).\n\\]\n\n(d)  Denote  \n\\[\nS(n)=\\sum_{r=1}^{n}w_r^{2}\n\\quad\\bigl(\\text{equivalently }S(n)=\\sum_{r=1}^{n}l_r^{2}\\bigr).\n\\]\nAmong all round–robin tournaments on $n$ players determine the exact minimum and maximum of $S(n)$ and describe \\emph{all} tournaments at which each extremum is attained.",
      "solution": "Throughout write $E(T,\\overline T)$ for the collection of edges with one endpoint in $T$ and the other in its complement $\\overline T$.\n\n------------------------------------------------\n(a)  Each game supplies exactly one win and one loss, so   \n\\[\n\\sum_{r=1}^{n}w_r=\\binom{n}{2}=\\sum_{r=1}^{n}l_r\n\\Longrightarrow \n\\sum_{r=1}^{n}d_r=\\sum_{r=1}^{n}(w_r-l_r)=0.\n\\qquad\\square\n\\]\n\n------------------------------------------------\n(b)  Fix $T\\subseteq[n]$ with $|T|=t$.  \nExactly $t(n-t)$ games are played across the cut $E(T,\\overline T)$.  \nDefine  \n\\[\n\\operatorname{out}(T)=\\sum_{r\\in T}\\#\\{\\text{wins of }P_r\\text{ versus }\\overline T\\},\\qquad\n\\operatorname{in}(T)=\\sum_{r\\in T}\\#\\{\\text{losses of }P_r\\text{ to }\\overline T\\}.\n\\]\nThen $\\operatorname{out}(T)+\\operatorname{in}(T)=t(n-t)$ and  \n\\[\n\\sum_{r\\in T}d_r\n=\\sum_{r\\in T}(w_r-l_r)\n=\\operatorname{out}(T)-\\operatorname{in}(T)\n=t(n-t)-2\\,\\operatorname{in}(T)\\le t(n-t).\n\\]\nThus (1) holds. $\\square$\n\n------------------------------------------------\n(c)  Necessity and sufficiency of (i)–(iii).\n\nNecessity.  Part (a) yields (i) and part (b) yields (ii); (iii) is immediate from  \n$w_r+l_r=n-1\\Longrightarrow d_r\\equiv n-1\\pmod 2$.\n\nSufficiency.  Assume an integer vector $\\mathbf d=(d_1,\\dots ,d_n)$ satisfies (i)–(iii) and define  \n\\[\ns_r=\\frac12\\!\\bigl((n-1)+d_r\\bigr)\\qquad(r=1,\\dots ,n).\n\\]\nBecause of (iii) each $s_r$ is an integer with $0\\le s_r\\le n-1$, and by (i)\n\\[\n\\sum_{r=1}^{n}s_r=\\frac12\\sum_{r=1}^{n}(n-1+d_r)=\\binom{n}{2}.\n\\]\nHence $\\mathbf s=(s_1,\\dots ,s_n)$ is a viable candidate for the out–degree sequence of a tournament.\n\nLandau’s classical criterion (stated in non–decreasing order) asserts:\n\nLet $s_{(1)}\\le\\dots\\le s_{(n)}$ be the increasing rearrangement of the $s_r$.\nAn integer sequence $(s_r)$ with the above bounds and sum is the score sequence of a tournament if and only if\n\\[\n\\sum_{i=1}^{k}s_{(i)}\\;\\ge\\;\\binom{k}{2}\\qquad(k=1,\\dots ,n).\n\\tag{2}\n\\]\n\nWe verify (2).  \nFor $k\\in\\{1,\\dots ,n\\}$ let $T_k$ be the set of indices of the $k$ \\emph{largest} coordinates of $\\mathbf s$.  \nBecause $s_r=\\frac12[(n-1)+d_r]$, inequality (1) applied to the complement $\\overline{T}_k$ gives\n\\[\n\\sum_{r\\in T_k}d_r\n=-\\!\\sum_{r\\in \\overline{T}_k}d_r\n\\;\\ge\\;-k(n-k),\n\\]\nwhence\n\\[\n\\sum_{r\\in T_k}s_r\n=\\frac12\\!\\Bigl(k(n-1)+\\sum_{r\\in T_k}d_r\\Bigr)\n\\;\\ge\\;\\frac12\\!\\bigl(k(n-1)-k(n-k)\\bigr)\n=\\binom{k}{2}.\n\\tag{3}\n\\]\n\nLet $U_k=[n]\\setminus T_{n-k}$; $U_k$ consists of the $k$ \\emph{smallest} $s_r$.  \nExactly the same computation yields\n\\[\n\\sum_{r\\in U_k}s_r\\;\\ge\\;\\binom{k}{2}.\n\\tag{4}\n\\]\nRelation (4) is precisely (2) for the $k$ smallest coordinates, while (3) implies (2) for the $k$ largest ones (replace $k$ by $n-k$).  \nHence (2) holds for every $k$, so by Landau the multiset $\\{s_1,\\dots ,s_n\\}$ is realised by some tournament; its score–differential vector is exactly $\\mathbf d$. $\\square$\n\n\n\n------------------------------------------------\n(d)  Extremal values of $S(n)=\\sum_{r=1}^{n}w_r^{2}$.\n\nWrite  \n\\[\nQ(\\mathbf d)=\\sum_{r=1}^{n}d_r^{2},\\qquad\nS(n)=\\sum_{r=1}^{n}w_r^{2}.\n\\]\nWith $w_r=\\frac12[(n-1)+d_r]$ and $\\sum d_r=0$ one obtains\n\\[\nS(n)=\\frac14\\sum_{r=1}^{n}\\bigl((n-1)+d_r\\bigr)^{2}\n     =\\frac{n}{4}(n-1)^{2}+\\frac14\\,Q(\\mathbf d).\n\\tag{5}\n\\]\nThus maximising/minimising $S(n)$ is equivalent to maximising/minimising the quadratic form $Q(\\mathbf d)$ over the feasible set  \n\\[\n\\mathcal D=\\{\\mathbf d\\in\\mathbb Z^{n}\\text{ satisfying (i)–(iii)}\\}.\n\\]\n\n────────────────────────────────\nMaximum of $S(n)$.\n\nPut $s_r=\\frac12[(n-1)+d_r]$.  Because\n\\[\nQ(\\mathbf d)=4\\sum_{r=1}^{n}\\!\\Bigl(s_r-\\tfrac{n-1}{2}\\Bigr)^{2}\n           =4\\sum_{r=1}^{n}s_r^{2}-n(n-1)^{2},\n\\]\nmaximising $Q$ is tantamount to maximising $\\sum s_r^{2}$.\n\nMajorisation argument.  \nLet $\\mathbf s=(s_1,\\dots ,s_n)$ be the score sequence of a tournament and let $s_{(1)}\\le\\dots\\le s_{(n)}$ be its increasing rearrangement.  \nThe Landau inequalities (2) together with their complements read\n\\[\n\\sum_{i=1}^{k}s_{(i)}\\ge\\binom{k}{2}\\quad\\text{and}\\quad\n\\sum_{i=n-k+1}^{n}s_{(i)}\\le\\binom{n}{2}-\\binom{k}{2}\\qquad(k=1,\\dots ,n).\n\\tag{6}\n\\]\nThe canonical multiset  \n\\[\n\\mathbf t=(0,1,2,\\dots ,n-1)\n\\]\nsatisfies the equalities in (6).  Therefore $\\mathbf t$ majorises every other score multiset, and Karamata’s inequality gives  \n$\\sum s_r^{2}\\le\\sum t_r^{2}$, with equality only if $\\{s_r\\}=\\{t_r\\}$.\n\nHence the maximum of $\\sum s_r^{2}$ and thus of $Q(\\mathbf d)$ is attained exactly for the multiset $\\{0,1,\\dots ,n-1\\}$.  \nThis score sequence is realised by any \\emph{transitive} (acyclic) tournament, i.e. one obtained by totally ordering the vertices and orienting every edge forward.  Translating back,\n\\[\nd_r=n-1-2(r-1)\\qquad(r=1,\\dots ,n),\n\\]\nup to permutation.  Direct calculation yields\n\\[\nQ_{\\max}=\\sum_{k=0}^{n-1}(n-1-2k)^{2}=\\frac{n\\bigl(n^{2}-1\\bigr)}{3},\n\\qquad\nS_{\\max}(n)=\\frac14\\!\\Bigl(n(n-1)^{2}+Q_{\\max}\\Bigr)\n           =\\frac{n(n-1)(2n-1)}{6}.\n\\]\nBecause of the preceding majorisation argument equality in $S\\le S_{\\max}(n)$ implies $\\{s_r\\}=\\{0,1,\\dots ,n-1\\}$, hence the tournament is transitive.  Thus the maximum is realised \\emph{only} by transitive tournaments.\n\n────────────────────────────────\nMinimum of $S(n)$.\n\nBecause $\\sum d_r=0$, the quadratic $Q(\\mathbf d)$ is minimised when the coordinates of $\\mathbf d$ are as balanced as the parity restriction allows.\n\n• Odd $n=2m+1$.  \nParity forces every $d_r$ to be even.  Choosing a regular tournament (each player wins and loses $m$ games) yields $\\mathbf d=\\mathbf0$ and\n$Q_{\\min}=0$.  \nAny non–zero feasible vector has at least one coordinate $\\lvert d_r\\rvert\\ge2$, giving $Q\\ge4$; hence regular tournaments (and only those) achieve the minimum.\n\n• Even $n=2m$.  \nNow every $d_r$ is odd, so $\\lvert d_r\\rvert\\ge1$.  The least possible quadratic sum is obtained when \\emph{exactly} $m$ coordinates equal $+1$ and the remaining $m$ equal $-1$, giving $Q_{\\min}=m+m=2m=n$.\n\nExistence of such tournaments.  \nLabel the vertices $0,1,\\dots ,2m-1$ and perform all computations modulo $2m$.\n\nStep 1 – orient edges of \\emph{length} $1,2,\\dots ,m-1$.  \nFor $i\\ne j$ with $1\\le (j-i)\\bmod 2m\\le m-1$ direct the edge $\\{i,j\\}$ from $i$ to $j$.  \nThis yields a digraph in which every unordered pair whose distance is not $m$ is oriented exactly once.\n\nStep 2 – orient the $m$ antipodal edges of length $m$.  \nFor each $i\\in\\{0,1,\\dots ,m-1\\}$ orient the edge $\\{i,i+m\\}$ \\emph{from} $i$ \\emph{to} $i+m$.  \n\nThe two steps together orient every unordered pair exactly once, hence produce a tournament.  Let us count wins.\n\n• Vertices $i<m$.  \nFrom Step 1 they beat the $m-1$ vertices at distances $1,2,\\dots ,m-1$, and from Step 2 they additionally beat $i+m$.  \nThus $w_i=m$ and $d_i=+1$.\n\n• Vertices $i\\ge m$.  \nStep 1 grants them $m-1$ wins (against the vertices at backward distances $1,2,\\dots ,m-1$), while Step 2 gives a \\emph{loss} against $i-m$.  \nHence $w_i=m-1$ and $d_i=-1$.\n\nConsequently the constructed tournament realises the differential vector\n\\[\n(\\underbrace{1,\\dots ,1}_{m},\\underbrace{-1,\\dots ,-1}_{m}),\n\\]\nso $Q=n$ and $S(n)$ attains its minimum.\n\nMinimality.  Let $\\mathbf d$ be any feasible vector with $Q(\\mathbf d)<n+2$.  \nBecause every $d_r$ is odd, $\\lvert d_r\\rvert\\ge1$, so $Q(\\mathbf d)\\ge n$.  \nIf some $\\lvert d_r\\rvert\\ge3$, then  \n$Q(\\mathbf d)\\ge 3^{2}+(n-1)\\cdot 1^{2}=n+8>n$, impossible.  \nHence every $\\lvert d_r\\rvert=1$.  \nFinally $\\sum d_r=0$ forces exactly $m$ entries $+1$ and $m$ entries $-1$.  \nTherefore $Q_{\\min}=n$ and the above pattern is the \\emph{only} one that achieves it.\n\nCombining with (5),\n\\[\nS_{\\min}(n)=\n\\begin{cases}\n\\dfrac{n}{4}(n-1)^{2}, & n\\ \\text{odd},\\\\[10pt]\n\\dfrac{n}{4}(n-1)^{2}+\\dfrac{n}{4}, & n\\ \\text{even}.\n\\end{cases}\n\\]\nFor odd $n$ equality occurs exactly at regular tournaments; for even $n$ at precisely the tournaments whose differential vector consists of $m$ entries $+1$ and $m$ entries $-1$.\n\n────────────────────────────────\nSummary of extrema.\n\n\\[\n\\boxed{\\;\nS_{\\max}(n)=\\frac{n(n-1)(2n-1)}{6}\\text{ — realised exactly by the transitive tournaments;}\n\\qquad\nS_{\\min}(n)=\n\\begin{cases}\n\\dfrac{n}{4}(n-1)^{2}, & n\\ \\text{odd},\\\\[10pt]\n\\dfrac{n}{4}(n-1)^{2}+\\dfrac{n}{4}, & n\\ \\text{even},\n\\end{cases}\n}\n\\]\nwith equality in the second formula iff the tournament is regular (odd $n$) or has differential vector $\\bigl(\\underbrace{1,\\dots ,1}_{m},\\underbrace{-1,\\dots ,-1}_{m}\\bigr)$ (even $n=2m$). $\\square$",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.458865",
        "was_fixed": false,
        "difficulty_analysis": "The original exercise shows a single, easy quadratic identity and is dispatched in two short lines.  \nThe enhanced variant\n\n• introduces the \\emph{score–differential vector} \\((d_1,\\dots ,d_n)\\), raising the dimension of the problem;  \n• imposes the \\emph{cut inequalities} (1), drawing on flow-cut ideas in graph theory;  \n• invokes and proves a version of \\emph{Landau’s theorem} (part (c)), a classical but non-trivial characterisation of realisable degree sequences in tournaments that requires algorithmic construction (Havel–Hakimi) or inductive combinatorial reasoning;  \n• converts the original quadratic identity into an extremal optimisation problem over a high-dimensional polytope, demanding convexity, extreme-point analysis and careful parity arguments; and  \n• fully characterises the extremal tournaments, showing that only transitive or almost-regular tournaments achieve the respective bounds.\n\nThe solution therefore mixes combinatorial counting, inequalities on cuts, polyhedral–combinatorial characterisation, convex optimisation, and explicit constructive algorithms, far surpassing the single-line algebraic manipulation that sufficed for the original problem."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}