<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://zemanpeter.github.io/feed.xml" rel="self" type="application/atom+xml"/><link href="https://zemanpeter.github.io/" rel="alternate" type="text/html" hreflang="en"/><updated>2026-10-12T13:24:38+00:00</updated><id>https://zemanpeter.github.io/feed.xml</id><title type="html">Peter Zeman</title><subtitle>Peter Zeman&apos;s research, teaching, and mathematical expositions on quantum information, graph theory, combinatorics, and algebra. </subtitle><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><entry><title type="html">Mermin-Peres magic rectangles</title><link href="https://zemanpeter.github.io/blog/2026/magic-rectangles/" rel="alternate" type="text/html" title="Mermin-Peres magic rectangles"/><published>2026-09-18T00:00:00+00:00</published><updated>2026-09-18T00:00:00+00:00</updated><id>https://zemanpeter.github.io/blog/2026/magic-rectangles</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2026/magic-rectangles/"><![CDATA[<p>Can a system of linear equations have no solution in numbers, but have a solution in matrices? The Mermin-Peres magic square gives a famous example modulo $2$. In our new paper <a href="https://arxiv.org/abs/2609.20746">Mermin-Peres magic rectangles modulo odd primes</a>, with <a href="https://kam.mff.cuni.cz/~dobben/">Josse van Dobben de Bruyn</a> and <a href="https://guests.mpim-bonn.mpg.de/dobbendebruyn/">Remy van Dobben de Bruyn</a>, we construct examples for every modulus. In this post, I will give some background on how these systems relate to quantum theory and contextuality, then illustrate our result with an example.</p> <hr/> <p><strong>Contents</strong></p> <ol> <li><a href="#1-what-is-an-operator-solution">What is an operator solution?</a></li> <li><a href="#2-the-original-mermin-peres-magic-square">The original Mermin-Peres magic square</a></li> <li><a href="#3-measurements-and-contextuality">Measurements and contextuality</a></li> <li><a href="#4-our-result">Our result</a></li> <li><a href="#5-magic-rectangle-modulo-3">Magic rectangle modulo 3</a></li> <li><a href="#6-the-group-generated-by-the-magic-square">The group generated by the magic square</a></li> <li><a href="#7-from-groups-to-linear-systems">From groups to linear systems</a></li> <li><a href="#8-related-work">Related work</a></li> </ol> <hr/> <h4 id="1-what-is-an-operator-solution">1. What is an operator solution?</h4> <p>Consider a linear system $Ax=b$ over $\mathbb Z/d\mathbb Z$. Writing $\omega=e^{2\pi i/d}$, we can encode a number $x_j$ by the scalar $\omega^{x_j}$. This turns each additive equation into a multiplicative one:</p> \[\sum_j A_{ij}x_j=b_i \quad\Longleftrightarrow\quad \prod_j (\omega^{x_j})^{A_{ij}}=\omega^{b_i}.\] <p>An <em>operator solution</em> replaces these scalars by unitary matrices $U_j$ of a common size, satisfying</p> \[U_j^d=I, \qquad \prod_j U_j^{A_{ij}}=\omega^{b_i}I.\] <p>There is one essential condition: <strong>matrices belonging to variables in the same equation must commute</strong>. This condition expresses <strong>compatibility of measurements</strong>; see <a href="#3-measurements-and-contextuality">Section 3</a>. Matrices appearing in different equations need not commute, and this is where new solutions become possible. Ordinary solutions correspond exactly to matrices of size $1$.</p> <hr/> <h4 id="2-the-original-mermin-peres-magic-square">2. The original Mermin-Peres magic square</h4> <p>Start with nine variables $x_1,\ldots,x_9\in\mathbb Z/2\mathbb Z$, arranged in a $3\times3$ square. The numbers to the right and below specify the required row and column sums, all modulo $2$:</p> <div class="table-responsive"> <table class="magic-square" aria-label="Magic square of nine variables, with row and column sums modulo two"> <tbody> <tr><td>$x_1$</td><td>$x_2$</td><td>$x_3$</td><td class="rhs">$0$</td></tr> <tr><td>$x_4$</td><td>$x_5$</td><td>$x_6$</td><td class="rhs">$0$</td></tr> <tr><td>$x_7$</td><td>$x_8$</td><td>$x_9$</td><td class="rhs">$0$</td></tr> <tr><td class="rhs">$0$</td><td class="rhs">$0$</td><td class="rhs">$1$</td><td class="rhs"></td></tr> </tbody> </table> </div> <p>Thus each row sums to $0$, the first two columns sum to $0$, and the last column sums to $1$. Adding the row equations says that the sum of all nine bits is $0$; adding the column equations says it is $1$.</p> <p>Equivalently, set $s_j=\omega^{x_j}$, where $\omega=e^{2\pi i/2}=-1$. We then seek a square of signs whose row products are all $+1$ and whose column products are $+1,+1,\omega$. No such square of numbers exists.</p> <p>Here is its operator solution. Take the Pauli matrices</p> \[X=\begin{pmatrix}0&amp;1\\1&amp;0\end{pmatrix}, \qquad Y=\begin{pmatrix}0&amp;-i\\i&amp;0\end{pmatrix}, \qquad Z=\begin{pmatrix}1&amp;0\\0&amp;-1\end{pmatrix}.\] <p>Replace each sign $s_j$ by the $4\times4$ matrix in the corresponding cell below. The entries to the right and below now give the row and column products:</p> <div class="table-responsive"> <table class="magic-square magic-square--operators" aria-label="Pauli operator solution of the magic square, with row and column products"> <tbody> <tr><td>$X\otimes I$</td><td>$I\otimes X$</td><td>$X\otimes X$</td><td class="rhs">$I_4$</td></tr> <tr><td>$I\otimes Z$</td><td>$Z\otimes I$</td><td>$Z\otimes Z$</td><td class="rhs">$I_4$</td></tr> <tr><td>$X\otimes Z$</td><td>$Z\otimes X$</td><td>$Y\otimes Y$</td><td class="rhs">$I_4$</td></tr> <tr><td class="rhs">$I_4$</td><td class="rhs">$I_4$</td><td class="rhs">$\omega I_4$</td><td class="rhs"></td></tr> </tbody> </table> </div> <p>Every entry squares to $I_4$, and the entries in each row or column commute pairwise. The factor $\omega$ in the last column comes from $XZ=-iY$:</p> \[(X\otimes X)(Z\otimes Z)(Y\otimes Y) =(XZY)\otimes(XZY) =(-iI_2)\otimes(-iI_2) =\omega I_4.\] <p>In the third row, the two signs instead cancel: $(X\otimes Z)(Z\otimes X)=(-iY)\otimes(iY)=Y\otimes Y$, so multiplying by the last entry gives $I_4$. Thus the square satisfies precisely the matrix equations corresponding to the impossible system of bits. This is the <a href="https://arxiv.org/abs/1802.10119">Mermin-Peres magic-square argument</a>, expressed in the language of linear systems.</p> <hr/> <h4 id="3-measurements-and-contextuality">3. Measurements and contextuality</h4> <p>In quantum theory, an <em>observable</em> is represented by a Hermitian matrix $A$, whose spectral decomposition $A=\sum_a aP_a$ expresses it in terms of its distinct eigenvalues $a$ and the orthogonal projections $P_a$ onto their eigenspaces. These projections define a <em>projective measurement</em>: for a normalized state vector $\psi$, it returns the outcome $a$ with probability $\lVert P_a\psi\rVert^2$. The nine matrices in our square are observables of a pair of qubits: each is Hermitian, with eigenvalues $+1$ and $-1$, which are its possible measurement outcomes. For example, $X\otimes I$ measures the first qubit in the $X$ basis, while $I\otimes X$ measures the second. A commuting row or column has a common eigenbasis, so its three observables can be measured jointly. Such a compatible set of measurements is called a <em>context</em>. Some entries in different contexts do not commute, so the nine observables cannot all be measured by a single projective measurement.</p> <p>The matrix identities give exact constraints on the outcomes of these joint measurements. If commuting observables $A,B,C$ satisfy $ABC=I_4$, their joint eigenvalues $a,b,c$ satisfy $abc=+1$; if $ABC=\omega I_4$, they satisfy $abc=\omega=-1$. Consequently, <strong>quantum theory predicts that the product of the three outcomes is always $+1$ for any row or either of the first two columns, and always $-1$ for the last column</strong>. These statements hold for every two-qubit state, even though the individual outcomes can be random.</p> <p>In the usual classical picture, it is natural to think that ideal measurements reveal properties that the system already has. For example, a classical particle has a definite position $(x,y,z)$: reading its $x$ coordinate gives the same value whether we also read $y$ or $z$, provided the measurements do not disturb its position. Uncertainty about the particle’s state can make the answer unpredictable, but the value itself does not depend on which other coordinates we choose to read.</p> <p>To apply this classical intuition to the square, imagine that each prepared pair of qubits comes with a hidden, prewritten <em>answer sheet</em>. The sheet is a $3\times3$ grid containing one sign, $+1$ or $-1$, for each of the nine observables. Different runs may use different sheets, even when we prepare exactly the same quantum state. The hidden state $\lambda$ tells us which sheet is used in a particular run.</p> <p>After the sheet is fixed, we independently choose a row or column to measure and read off its three answers. The assumption of <em>noncontextuality</em> is that <strong>the answer depends on the observable and the hidden state $\lambda$, but not on the context</strong>. We write this answer as $v_\lambda(A)$: $\lambda$ specifies the sheet, and $A$ specifies the cell to read. Thus $v_\lambda(X\otimes X)$ is determined by the sheet, regardless of whether we choose the first row or the last column. Different runs can use different sheets and give different answers; noncontextuality says that choosing a context does not change the answer on a given sheet.</p> <p>We only read one row or column in each run, but the sheet must be ready for any of the six choices. To reproduce these quantum predictions about row and column products, every sheet the model uses must satisfy all six constraints. If a sheet fails one of them, choosing that row or column reveals the failure. Yet no such sheet exists: multiplying the three row constraints gives $+1$, while multiplying the three column constraints gives $-1$. Both calculations multiply the same nine signs, so they must give the same answer. Drawing sheets at random cannot help, because every sheet fails at least one of the possible checks.</p> <p>This is <em>Kochen-Specker contextuality</em>: the quantum predictions cannot be explained by a common collection of answer sheets with one answer per observable. The contradiction is <em>state-independent</em> because the product constraints hold in every quantum state. Quantum mechanics still gives the same probabilities for an individual observable whether we measure it in its row or its column. What fails is the idea that all the outcomes come from nine answers written down in advance. Contextual hidden-variable models allow an observable’s answer to depend on which other observables are measured alongside it, so they are outside this assumption. For further background, see the <a href="https://arxiv.org/abs/2102.13036">review of Kochen-Specker contextuality</a> by Budroni, Cabello, Gühne, Kleinmann, and Larsson.</p> <hr/> <h4 id="4-our-result">4. Our result</h4> <p>Every modulus $d\geq2$ admits a linear system with no numerical solution but with an operator solution. The difficult case is odd modulus: simply replacing the Pauli matrices in the usual magic square by their higher-dimensional analogues does not work. In fact, for odd modulus, any system solvable using generalized Pauli matrices also has a classical solution. Our construction goes beyond this family.</p> <hr/> <h4 id="5-magic-rectangle-modulo-3">5. Magic rectangle modulo 3</h4> <p>Until recently, no example of a linear system with an operator solution but no numerical solution was known even modulo $3$. Our example modulo $3$ has $18$ variables $x_1,\ldots,x_{18}\in\mathbb Z/3\mathbb Z$ arranged in a $5\times6$ rectangle. The remaining cells contain zeros, and the numbers to the right and below specify the required row and column sums, all modulo $3$:</p> <div class="table-responsive"> <table class="magic-square" aria-label="Magic rectangle of eighteen variables, with row and column sums modulo three"> <tbody> <tr><td>$x_1$</td><td>$x_2$</td><td>$x_3$</td><td>$0$</td><td>$0$</td><td>$0$</td><td class="rhs">$0$</td></tr> <tr><td>$x_4$</td><td>$0$</td><td>$0$</td><td>$x_5$</td><td>$x_6$</td><td>$0$</td><td class="rhs">$0$</td></tr> <tr><td>$0$</td><td>$x_7$</td><td>$0$</td><td>$0$</td><td>$x_8$</td><td>$x_9$</td><td class="rhs">$0$</td></tr> <tr><td>$0$</td><td>$0$</td><td>$x_{10}$</td><td>$x_{11}$</td><td>$0$</td><td>$x_{12}$</td><td class="rhs">$0$</td></tr> <tr><td>$x_{13}$</td><td>$x_{14}$</td><td>$x_{15}$</td><td>$x_{16}$</td><td>$x_{17}$</td><td>$x_{18}$</td><td class="rhs">$1$</td></tr> <tr><td class="rhs">$0$</td><td class="rhs">$0$</td><td class="rhs">$0$</td><td class="rhs">$0$</td><td class="rhs">$0$</td><td class="rhs">$0$</td><td class="rhs"></td></tr> </tbody> </table> </div> <p>Thus the first four rows and all six columns sum to $0$, while the last row sums to $1$. There is no numerical solution: adding the row equations gives $\sum_{j=1}^{18}x_j=1$, while adding the column equations gives the same sum equal to $0$.</p> <p>The explicit $9\times9$ operator solution can be found in Section 2 of <a href="https://arxiv.org/abs/2609.20746">our paper</a>.</p> <hr/> <h4 id="6-the-group-generated-by-the-magic-square">6. The group generated by the magic square</h4> <p>The nine operators in the original Mermin-Peres magic square generate the <em>real two-qubit Pauli group</em>, which has $32$ elements. Adjoining the scalar matrix $iI_4$ to this group gives the usual $64$-element two-qubit Pauli group. We now describe the $32$-element real two-qubit Pauli group, denoted by $G$, as a semidirect product.</p> <p>Let $E=\mathbb F_2^2$, and let $\mathcal A_1=\operatorname{span}_{\mathbb F_2}\lbrace1,x,y\rbrace$ be the space of affine linear functions on $E$. Label the four standard basis vectors by $e_z$ for $z\in E$, and set $\omega=-1$. The group combines diagonal matrices with translations of these basis vectors:</p> \[D_f e_z=\omega^{f(z)}e_z,\qquad S_a e_z=e_{z-a}, \qquad f\in\mathcal A_1,\quad a\in E.\] <p>Every element is uniquely a product $D_fS_a$, giving</p> \[G\cong\mathcal A_1\rtimes E \cong(\mathbb Z/2\mathbb Z)^3\rtimes(\mathbb Z/2\mathbb Z)^2.\] <p>The action in this semidirect product is translation of functions: $(T_af)(z)=f(z+a)$. In matrix terms, $S_aD_fS_a^{-1}=D_{T_af}$.</p> <p>This is exactly the group $G_{2,1}$ in <a href="https://arxiv.org/abs/2609.20746">our paper</a>. For an odd prime $p$, our group has the same form $G_{p,p-1}=\mathcal A_{p-1}\rtimes\mathbb F_p^2$, where $\mathcal A_{p-1}$ consists of polynomials in two variables of total degree at most $p-1$ over $\mathbb F_p$. Thus we keep the translation action and enlarge the space of diagonal phase functions beyond the affine linear ones.</p> <hr/> <h4 id="7-from-groups-to-linear-systems">7. From groups to linear systems</h4> <p>There is a general way to turn the commuting relations of a group into a linear system. Start with a finite group $G$ and a central element $J$ of order $d$. Introduce a variable $x_u$ for every element $u\in G$ satisfying $u^d=e$, where $e$ is the identity. For every commuting pair of these elements, impose an equation, and add one final constraint:</p> \[\begin{aligned} x_u+x_v&amp;=x_{uv} &amp;&amp;\text{whenever }uv=vu,\\ x_J&amp;=1. \end{aligned}\] <p>All arithmetic is modulo $d$. The variable $x_{uv}$ exists because commuting elements with $u^d=v^d=e$ also satisfy $(uv)^d=e$. If $G$ is represented by unitary matrices $\rho(u)$ with $\rho(J)=\omega I$, where $\omega=e^{2\pi i/d}$, then assigning $U_u=\rho(u)$ gives an operator solution: the first equations express multiplication of commuting matrices, and the last one is exactly $U_J=\omega I$.</p> <p>A numerical solution would assign a value $\ell(u)=x_u$ to each of these group elements, satisfying $\ell(uv)=\ell(u)+\ell(v)$ whenever $u$ and $v$ commute, together with $\ell(J)=1$. For the real two-qubit Pauli group, the magic-square argument already shows that such an assignment is impossible.</p> <p>For our groups $G_{p,p-1}$ with $p$ odd, we set $d=p$ and prove that <strong>additivity on commuting pairs forces $\ell(J)=0$</strong>, where $J=(1,0)$ corresponds to the scalar matrix $\omega I$ and $\omega=e^{2\pi i/p}$. The proof compares the restrictions of $\ell$ to certain abelian subgroups whose elements satisfy $u^p=e$. On each such subgroup, $\ell$ must be linear; the relations between these subgroups then force $\ell(J)=0$. This contradicts the required equation $x_J=1$, so the system has an operator solution but no numerical solution. The general construction and the contradiction are given in Sections 3 and 5 of <a href="https://arxiv.org/abs/2609.20746">our paper</a>.</p> <hr/> <h4 id="8-related-work">8. Related work</h4> <p>There was also a little arXiv drama: <a href="https://arxiv.org/abs/2609.14632">Lorenzo Ciardo</a> and <a href="https://arxiv.org/abs/2609.16490">Markus Frembs</a> independently obtained the same existence result using different techniques, with all three preprints appearing within days of each other!</p> <hr/>]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="quantum-information"/><category term="linear-algebra"/><category term="group-theory"/><summary type="html"><![CDATA[Mermin-Peres magic rectangles, quantum contextuality, and matrix solutions to inconsistent linear equations, even modulo odd primes.]]></summary></entry><entry><title type="html">Cumulative XOR via the shift operator on $\mathbb{F}_2^\infty$</title><link href="https://zemanpeter.github.io/blog/2026/cumulative-xor/" rel="alternate" type="text/html" title="Cumulative XOR via the shift operator on $\mathbb{F}_2^\infty$"/><published>2026-05-30T10:00:00+00:00</published><updated>2026-05-30T10:00:00+00:00</updated><id>https://zemanpeter.github.io/blog/2026/cumulative-xor</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2026/cumulative-xor/"><![CDATA[<p>Let $\oplus$ denote bitwise XOR and write $f(n)=0\oplus 1\oplus 2\oplus\cdots\oplus n$ for $n\geq 0$. The following formula is well-known:</p> \[f(n)=\begin{cases} n &amp; n\equiv 0\pmod 4,\\ 1 &amp; n\equiv 1\pmod 4,\\ n+1 &amp; n\equiv 2\pmod 4,\\ 0 &amp; n\equiv 3\pmod 4. \end{cases}\] <p>Here is a proof using elementary functional-analysis.</p> <p><strong class="paragraph">The sequence space.</strong> Let $\mathbb F_2^\infty$ denote the space of eventually-zero $\mathbb F_2$-valued sequences, with standard basis vectors $e_0, e_1, e_2, \ldots$ The <em>unilateral shift</em> is the linear operator</p> \[\sigma\colon\mathbb{F}_2^\infty\to\mathbb{F}_2^\infty,\qquad \sigma e_i=e_{i+1},\] <p>i.e., insert a $0$ in position $0$ and shuffle everything up. Encode each $m\in\mathbb Z_{\geq 0}$ as its bit-vector $v_m\in\mathbb F_2^\infty$ (the $i$-th component of $v_m$ is the $i$-th bit of $m$); bitwise XOR becomes vector-space addition. The cumulative XOR becomes a partial sum,</p> \[v_{f(n)}\;=\;\sum_{m=0}^{n} v_m,\] <p>and the question is to evaluate this sum in $\mathbb F_2^\infty$.</p> <p><strong class="paragraph">Intertwining doubling with the shift.</strong> The arithmetic of doubling intertwines cleanly with $\sigma$: multiplying $m$ by $2$ shifts every bit up by one, and adding $1$ to an even number sets the low bit. In operator form,</p> \[v_{2m}=\sigma v_m,\qquad v_{2m+1}=\sigma v_m+e_0.\] <p>So consecutive pairs collapse to a constant: $v_{2m}+v_{2m+1}=2\sigma v_m+e_0=e_0$ (the $2$ vanishes in $\mathbb F_2$). This is the analogue, over $\mathbb F_2$, of a “$\sigma$-telescoping” identity — pairs of adjacent terms differ only on the range of $\sigma$, and the range of $\sigma$ is annihilated when added to itself.</p> <p><strong class="paragraph">Odd $n$.</strong> Write $n=2k+1$ and apply the pairing identity:</p> \[v_{f(2k+1)}\;=\;\sum_{m=0}^{k}\bigl(v_{2m}+v_{2m+1}\bigr)\;=\;(k+1)\,e_0.\] <p>The entire sum lands in the one-dimensional subspace $\langle e_0\rangle=\ker\sigma$ — the “boundary” complement of $\operatorname{im}\sigma$ — with coefficient $(k+1)\bmod 2$. Hence $f(2k+1)=(k+1)\bmod 2$, which is $0$ when $k$ is odd ($n\equiv 3\pmod 4$) and $1$ when $k$ is even ($n\equiv 1\pmod 4$).</p> <p><strong class="paragraph">Even $n$.</strong> Write $n=2k$ and peel off the last term against the odd case: $v_{f(2k)}=v_{f(2k-1)}+\sigma v_k$. The previous step gives $v_{f(2k-1)}=(k\bmod 2)\,e_0$, so</p> \[v_{f(2k)}=\sigma v_k+(k\bmod 2)\,e_0.\] <p>This decomposes $v_{f(2k)}$ into its $\operatorname{im}\sigma$-part and its $\ker\sigma$-part:</p> <ul> <li>$k$ even ($n\equiv 0\pmod 4$): $v_{f(2k)}=\sigma v_k$, so $f(n)=2k=n$.</li> <li>$k$ odd ($n\equiv 2\pmod 4$): $v_{f(2k)}=\sigma v_k+e_0$. Since bit $0$ of $2k$ vanishes, adding $e_0$ sets it, giving $f(n)=2k+1=n+1$.</li> </ul> <p>This exhausts all residues.<span style="float:right">$\square$</span></p> <p><strong class="paragraph">Sanity check.</strong> The first few values:</p> \[\begin{array}{c|cccccccccc} n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9\\\hline f(n) &amp; 0 &amp; 1 &amp; 3 &amp; 0 &amp; 4 &amp; 1 &amp; 7 &amp; 0 &amp; 8 &amp; 1 \end{array}\] <p>Reading off: $f(0)=0$, $f(4)=4$, $f(8)=8$ ($n$); $f(1)=f(5)=f(9)=1$; $f(2)=3$, $f(6)=7$ ($n+1$); $f(3)=f(7)=0$. The four-periodic pattern is visible immediately.</p>]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="recreational-mathematics"/><category term="number-theory"/><category term="functional-analysis"/><summary type="html"><![CDATA[A closed form for the prefix bitwise XOR, proved by telescoping against the unilateral shift on the sequence space $\mathbb{F}_2^\infty$.]]></summary></entry><entry><title type="html">IMO 1981/2 via generating functions</title><link href="https://zemanpeter.github.io/blog/2026/imo-1981-subset-minima/" rel="alternate" type="text/html" title="IMO 1981/2 via generating functions"/><published>2026-05-17T10:00:00+00:00</published><updated>2026-05-17T10:00:00+00:00</updated><id>https://zemanpeter.github.io/blog/2026/imo-1981-subset-minima</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2026/imo-1981-subset-minima/"><![CDATA[<p><strong class="paragraph">Problem (IMO 1981, Problem 2).</strong> Let $1\leq r\leq n$ and consider all $r$-element subsets of $\lbrace 1,2,\dots,n \rbrace$. Each such subset has a smallest element. Let $F(n,r)$ be the arithmetic mean of these smallest elements. Prove that</p> \[F(n,r)=\frac{n+1}{r+1}.\] <p><strong class="paragraph">Reformulation.</strong> Write $S(n,r)$ for the <em>sum</em> of the smallest elements over all $r$-subsets of $\lbrace 1,\dots,n \rbrace$, so that</p> \[F(n,r)=\frac{S(n,r)}{\binom{n}{r}}.\] <p>If we fix the smallest element to be $k$, the remaining $r-1$ elements are chosen from $\lbrace k+1,\dots,n \rbrace$, which has $n-k$ elements. Hence</p> \[S(n,r)=\sum_{k=1}^{n-r+1} k\binom{n-k}{r-1}.\] <p>The claim $F(n,r)=\frac{n+1}{r+1}$ is equivalent to</p> \[S(n,r)=\binom{n+1}{r+1},\] <p>because $\frac{n+1}{r+1}\binom{n}{r}=\binom{n+1}{r+1}$.</p> <p><strong class="paragraph">Generating functions.</strong> Recognize $S(n,r)$ as the $n$-th coefficient of a product of two familiar series. From</p> \[\sum_{k\geq 1} k\,x^k = \frac{x}{(1-x)^2}, \qquad \sum_{m\geq 0}\binom{m}{r-1}x^{m}=\frac{x^{r-1}}{(1-x)^{r}},\] <p>the Cauchy product is</p> \[\frac{x}{(1-x)^2}\cdot \frac{x^{r-1}}{(1-x)^{r}} =\frac{x^{r}}{(1-x)^{r+2}} =\sum_{n\geq 0}\left(\sum_{k+m=n} k\binom{m}{r-1}\right)x^{n}.\] <p>The inner sum is precisely $S(n,r)$ (terms with $k=0$ or $m&lt;r-1$ contribute nothing), so</p> \[S(n,r)=[x^{n}]\,\frac{x^{r}}{(1-x)^{r+2}}=[x^{\,n-r}]\,\frac{1}{(1-x)^{r+2}}.\] <p>The negative binomial expansion $\frac{1}{(1-x)^{r+2}}=\sum_{j\geq 0}\binom{j+r+1}{r+1}x^{j}$ then gives</p> \[S(n,r)=\binom{(n-r)+r+1}{r+1}=\binom{n+1}{r+1}.\] <p>Dividing by $\binom{n}{r}$,</p> \[F(n,r)=\frac{\binom{n+1}{r+1}}{\binom{n}{r}}=\frac{(n+1)!/((r+1)!(n-r)!)}{n!/(r!(n-r)!)}=\frac{n+1}{r+1}.\] <p><strong class="paragraph">A bijective proof.</strong> The identity $S(n,r)=\binom{n+1}{r+1}$ also admits a simple bijective argument. To choose an $(r+1)$-subset of $\lbrace 1,\dots,n+1 \rbrace$, pick the second-smallest element $k+1\in\lbrace 2,\dots,n-r+2 \rbrace$, then choose the smallest element from $\lbrace 1,\dots,k \rbrace$ (giving $k$ options), and finally pick the remaining $r-1$ elements from $\lbrace k+2,\dots,n+1 \rbrace$ (giving $\binom{n-k}{r-1}$ options). Summing over $k$ recovers exactly $\sum_{k\geq 1}k\binom{n-k}{r-1}=S(n,r)$. The generating-functions calculation is the algebraic shadow of this bijection: the factor $\tfrac{x}{(1-x)^2}=\sum k x^k$ encodes the choice of the smallest element together with its label $k$, and $\tfrac{x^{r-1}}{(1-x)^r}=\sum\binom{m}{r-1}x^m$ encodes the choice of the upper $r-1$ elements.</p> <p><strong class="paragraph">Small cases.</strong> For $n=4$, $r=2$ the six $2$-subsets of $\lbrace 1,2,3,4 \rbrace$ have minima $1,1,1,2,2,3$, summing to $10=\binom{5}{3}$ and averaging $\tfrac{10}{6}=\tfrac{5}{3}=\tfrac{n+1}{r+1}$. For $r=1$ the formula gives $F(n,1)=\tfrac{n+1}{2}$, which is just the average of $\lbrace 1,\dots,n \rbrace$. For $r=n$ there is a unique subset with minimum $1$, and indeed $\tfrac{n+1}{n+1}=1$.</p>]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="recreational-mathematics"/><category term="combinatorics"/><summary type="html"><![CDATA[A generating-functions proof that the average minimum of an r-subset of {1,...,n} is (n+1)/(r+1).]]></summary></entry><entry><title type="html">SKMO 2026/1 via KKT conditions</title><link href="https://zemanpeter.github.io/blog/2026/kkt-olympiad/" rel="alternate" type="text/html" title="SKMO 2026/1 via KKT conditions"/><published>2026-04-05T10:00:00+00:00</published><updated>2026-04-05T10:00:00+00:00</updated><id>https://zemanpeter.github.io/blog/2026/kkt-olympiad</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2026/kkt-olympiad/"><![CDATA[<p><strong class="paragraph">Problem (SKMO 2026, Problem 1).</strong> Let $x,y,z$ be positive real numbers such that</p> \[x^2+y^2+z^2=75.\] <p>Suppose that two of the three sums $x+y$, $y+z$, $z+x$ are at least $10$. Determine the smallest and largest possible value of the remaining sum.</p> <p>The natural toolkit is Lagrange multipliers with inequality constraints — the Karush–Kuhn–Tucker conditions. A purely algebraic argument also works (and we give one below), but KKT makes the structure transparent.</p> <p>By symmetry we may assume</p> \[x+y\geq 10,\qquad y+z\geq 10,\] <p>and ask for the smallest and largest possible value of $x+z$.</p> <p><strong class="paragraph">KKT conditions.</strong> For a minimization problem $\min f$ subject to an equality constraint $h=0$ and inequality constraints $g_i\leq 0$, a (regular) local minimum admits multipliers $\lambda\in\mathbb{R}$ and $\mu_i\geq 0$ such that</p> \[\nabla f + \lambda\,\nabla h + \sum_i \mu_i\,\nabla g_i = 0, \qquad \mu_i\, g_i = 0 \text{ for each } i.\] <p>The slackness condition $\mu_i g_i = 0$ says that each inequality is either <em>active</em> ($g_i=0$) or has zero multiplier. The sign requirement $\mu_i\geq 0$ singles out minima; maxima satisfy the same equations with $\mu_i\leq 0$ (equivalently, replace $f$ by $-f$).</p> <p><strong class="paragraph">KKT formulation.</strong> We optimize $f(x,y,z)=x+z$ subject to the equality constraint $x^2+y^2+z^2=75$ and the inequality constraints</p> \[10-x-y\leq 0,\qquad 10-y-z\leq 0.\] <p>For the minimization, the Lagrangian is</p> \[\mathcal L = x+z +\lambda(x^2+y^2+z^2-75) +\mu(10-x-y) +\nu(10-y-z), \qquad \mu,\nu\geq 0.\] <p>The KKT stationarity conditions read</p> \[1+2\lambda x=\mu,\qquad 2\lambda y=\mu+\nu,\qquad 1+2\lambda z=\nu,\] <p>together with the complementary slackness conditions $\mu(10-x-y)=0$ and $\nu(10-y-z)=0$.</p> <p><strong class="paragraph">Both inequality constraints are active.</strong> If both were inactive then $\mu=\nu=0$ and the middle equation forces $2\lambda y=0$; since $y&gt;0$ this gives $\lambda=0$, but then the first equation becomes $1=0$. If only $x+y=10$ is active, then $\nu=0$, the third equation gives $\lambda=-\tfrac{1}{2z}&lt;0$, and substituting into the middle equation yields $\mu=2\lambda y=-\tfrac{y}{z}&lt;0$, contradicting $\mu\geq 0$. The other one-active case is symmetric.</p> <p>Therefore $x+y=10$ and $y+z=10$, so $x=z$. Writing $x=z=a$ and $y=10-a$, the sphere condition becomes</p> \[2a^2 + (10-a)^2 = 75.\] <p>Expanding,</p> \[2a^2 + 100 - 20a + a^2 = 75 \quad\Longleftrightarrow\quad 3a^2 - 20a + 25 = 0 \quad\Longleftrightarrow\quad (3a-5)(a-5)=0.\] <p>So $a=5$ or $a=\tfrac{5}{3}$, giving two candidate triples</p> \[P_1 = (5,5,5), \qquad P_2 = \bigl(\tfrac{5}{3},\,\tfrac{25}{3},\,\tfrac{5}{3}\bigr),\] <p>with $x+z=10$ at $P_1$ and $x+z=\tfrac{10}{3}$ at $P_2$.</p> <p><strong class="paragraph">Sign of the multipliers.</strong> Plugging each candidate into the KKT system,</p> \[P_1:\ \lambda=-\tfrac{1}{5},\ \mu=\nu=-1, \qquad P_2:\ \lambda=\tfrac{1}{5},\ \mu=\nu=\tfrac{5}{3}.\] <p>Only $P_2$ has $\mu,\nu\geq 0$, so $P_2$ is the KKT point for the minimization. At $P_1$ the multipliers are reversed in sign — exactly the pattern required by the KKT system for the <em>maximization</em> (which has the right-hand sides of the stationarity conditions negated). Hence</p> \[\min(x+z) = \tfrac{10}{3}, \qquad \max(x+z) = 10,\] <p>attained at $P_2$ and $P_1$ respectively.</p> <p><strong class="paragraph">A purely algebraic argument.</strong> KKT singles out the two candidates but, strictly speaking, only certifies that they are stationary; one still has to rule out the values outside $[\tfrac{10}{3},10]$. Here is a self-contained inequality proof. Write $s=x+z$. From $x\geq 10-y$ and $z\geq 10-y$,</p> \[\min(x,z)\geq 10-y,\] <p>and since $\min(x,z)\leq \tfrac{s}{2}$,</p> \[y \geq 10-\tfrac{s}{2}.\] <p>On the other hand $x^2+z^2\geq \tfrac{(x+z)^2}{2}=\tfrac{s^2}{2}$, so</p> \[y^2 \leq 75-\tfrac{s^2}{2}.\] <p>Combining,</p> \[\left(10-\tfrac{s}{2}\right)^2 \leq 75-\tfrac{s^2}{2},\] <p>which after expansion and multiplication by $4$ becomes</p> \[3s^2-40s+100 \leq 0, \quad\text{i.e.}\quad (3s-10)(s-10)\leq 0.\] <p>Therefore $\tfrac{10}{3}\leq s\leq 10$, as KKT predicted.</p> <p><strong class="paragraph">The bounds are attained.</strong> The lower bound is attained at $x=z=\tfrac{5}{3}$, $y=\tfrac{25}{3}$: indeed</p> \[x^2+y^2+z^2 = \tfrac{25}{9}+\tfrac{625}{9}+\tfrac{25}{9} = \tfrac{675}{9} = 75,\] <p>and $x+y = y+z = 10$, while $x+z = \tfrac{10}{3}$. The upper bound is attained at $x=y=z=5$, where all three pairwise sums equal $10$.</p> <p>The smallest possible value of the remaining sum is $\tfrac{10}{3}$ and the largest is $10$.</p>]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="recreational-mathematics"/><category term="optimization"/><summary type="html"><![CDATA[Solving a problem from SKMO with the Karush–Kuhn–Tucker conditions.]]></summary></entry><entry><title type="html">Infinity of primes</title><link href="https://zemanpeter.github.io/blog/2026/infinity-of-primes/" rel="alternate" type="text/html" title="Infinity of primes"/><published>2026-02-03T05:12:00+00:00</published><updated>2026-02-03T05:12:00+00:00</updated><id>https://zemanpeter.github.io/blog/2026/infinity-of-primes</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2026/infinity-of-primes/"><![CDATA[<p>Suppose that $p$ is the largest prime.Then $2^p-1$ is composite and let $q$ be some prime dividing $2^p-1$. Since $p$ is a prime, the order of $2$ in the multiplicative group $\mathbb{Z}_q^\times$ is $p$. Since $q$ is a prime, the order of $\mathbb{Z}_q^\times$ is exactly $q-1$. By Lagrange’s theorem, $p \mid (q-1)$, which implies that $p &lt; q$.</p>]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="number-theory"/><category term="group-theory"/><summary type="html"><![CDATA[A group-theoretic proof of infinity of primes.]]></summary></entry><entry><title type="html">Orbit counting lemma</title><link href="https://zemanpeter.github.io/blog/2025/orbit-counting/" rel="alternate" type="text/html" title="Orbit counting lemma"/><published>2025-09-27T05:12:00+00:00</published><updated>2025-09-27T05:12:00+00:00</updated><id>https://zemanpeter.github.io/blog/2025/orbit-counting</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2025/orbit-counting/"><![CDATA[<p><strong class="paragraph">Theorem.</strong> Let $G\leq \mathrm{Sym}(X)$. Then the number of orbits of $G$ on $X$ is</p> \[\frac{1}{|G|}\sum_{g\in G}\mathrm{fix}(g).\] <p><em>Proof.</em> Form a bipartite graph with parts $X$ and $G$, putting an edge between $x \in X$ and $g\in G$ whenever $x^g = x$. We count its edges two ways.</p> <p>From the $G$-side, vertex $g$ is incident to exactly $\mathrm{fix}(g)$ edges, so the total is</p> \[\sum_{g\in G}\mathrm{fix}(g).\] <p>From the $X$-side, vertex $x$ is incident to $\lvert G_x\rvert$ edges, where $G_x$ is the stabilizer of $x$. By the orbit–stabilizer theorem, $\lvert G_x\rvert\cdot\lvert\Delta\rvert = \lvert G\rvert$, where $\Delta$ is the orbit of $x$. Summing over a single orbit $\Delta$,</p> \[\sum_{x\in\Delta}|G_x| = |\Delta|\cdot\frac{|G|}{|\Delta|} = |G|,\] <p>so each orbit contributes $\lvert G\rvert$ to the edge count, and the total is $k\,\lvert G\rvert$ where $k$ is the number of orbits. Equating the two counts gives $k\,\lvert G\rvert = \sum_{g\in G}\mathrm{fix}(g)$.<span style="float:right">$\square$</span></p>]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="combinatorics"/><category term="group-theory"/><summary type="html"><![CDATA[A graph-theoretic proof of Burnside's lemma, counting group-action orbits by double-counting edges in a bipartite graph.]]></summary></entry><entry><title type="html">Matrix recurrence for non-backtracking walks</title><link href="https://zemanpeter.github.io/blog/2025/counting-walks/" rel="alternate" type="text/html" title="Matrix recurrence for non-backtracking walks"/><published>2025-04-18T15:12:00+00:00</published><updated>2025-04-18T15:12:00+00:00</updated><id>https://zemanpeter.github.io/blog/2025/counting-walks</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2025/counting-walks/"><![CDATA[<p>Let $X$ be a simple graph and $A$ its adjacency matrix. It is well-known that the number of length-$k$ walks from a vertex $x$ to $y$ corresponds to the entry $(x, y)$ of the $k$th power of $A$. Suppose that we want to count walks of length $k$ in which no edge repeats twice in a row (<a href="https://codeforces.com/problemset/problem/1662/C">see this</a>).</p> <p>For $k = 1$, this is still achieved by the adjacency matrix $A$. For $k = 2$, the matrix $A^2$ ignores the constraint. All the walks that violate the constraint are of type $xyx$, for some edge $xy\in E(X)$. For every vertex $x$, the number of such walks is exactly $\deg(x)$ and they are all stored on the diagonal of $A^2$. Thus, for $k = 2$, we can refine the formula by subtracting $D$, where</p> \[D_{xy} = \begin{cases} \deg(x) \quad &amp;\text{if $x = y$,}\\ 0 \quad &amp;\text{if $x \neq y$}. \end{cases}\] <p>If $B_k$ should be the matrix counting walks of length $k$ in which no edge repeats twice in a row, then we can write</p> \[\begin{aligned} B_1 &amp;= A,\\ B_2 &amp;= A^2 - D. \end{aligned}\] <p>Notice that in the matrix $B_{k-1}A$, for $k\geq 3$, the entry $(x, y)$ stores the number of walks of the form $Wy$, where $W$ is a constraint-satisfying walk of length $k-1$ starting at $x$. We need to subtract those where $W$ ends with $\ldots y z$ (i.e.\ the next-to-last vertex of $W$ is $y$), since appending $y$ retraces the edge $yz$ and violates the constraint.</p> <p>Each such bad walk $Wy$ corresponds to a constraint-satisfying walk of length $k-2$ from $x$ to $y$, followed by a step to some neighbor $z$ of $y$ different from the penultimate vertex of the $(k-2)$-walk (otherwise the extended $(k-1)$-walk would already violate the constraint), and then back to $y$. There are $\deg(y)-1$ valid choices of $z$ per $(k-2)$-walk, so the number of bad length-$k$ walks from $x$ to $y$ is $(B_{k-2})_{xy}\cdot (\deg(y)-1)$. This leads us to the following formula:</p> \[B_{k} = B_{k-1}A - B_{k-2}(D - I).\]]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="recreational-mathematics"/><category term="combinatorics"/><category term="graph-theory"/><summary type="html"><![CDATA[A matrix recurrence for walks that avoid immediately retracing the last edge.]]></summary></entry><entry><title type="html">Graham-Pollak determinant formula</title><link href="https://zemanpeter.github.io/blog/2025/graham-pollak/" rel="alternate" type="text/html" title="Graham-Pollak determinant formula"/><published>2025-04-07T15:12:00+00:00</published><updated>2025-04-07T15:12:00+00:00</updated><id>https://zemanpeter.github.io/blog/2025/graham-pollak</id><content type="html" xml:base="https://zemanpeter.github.io/blog/2025/graham-pollak/"><![CDATA[<p><strong class="paragraph">Theorem</strong> (Graham, Pollak; 1971): Let $D_n$ be the distance matrix of a tree $T$ on $n\geq 1$ vertices, i.e.,</p> \[(D_n)_{xy} = d(x,y).\] <p>Then</p> \[\det(D_n) = (-1)^{n-1}(n-1)2^{n-2}.\] <p>Thus, surprisingly, the determinant of $D_n$ depends solely on the number of vertices of a tree and not at all on its structure.</p> <p><strong class="paragraph">Proof.</strong> For $n=1$, the determinant is $0$, as claimed. For $n\geq 2$, we proceed by induction on $n$. The base case $n=2$ gives $\det(D_2) = -1 = (-1)^1\cdot 1\cdot 2^0$. Suppose $n\geq 3$ and the formula holds for every tree on $n-1$ vertices.</p> <p>Pick a leaf $\ell$ with neighbor $v$, and let $T’=T-\ell$ be the tree on $n-1$ vertices obtained by deleting $\ell$. Order the vertices so that $\ell$ is last. Since $\ell$ is a leaf, every path from $\ell$ to a vertex $i\neq\ell$ passes through $v$, hence $d_T(i,\ell)=d_{T’}(i,v)+1$. The operations $R_\ell\leftarrow R_\ell - R_v$ and $C_\ell\leftarrow C_\ell - C_v$ leave the determinant invariant and bring $D_n$ to</p> \[\widetilde D = \begin{pmatrix} D_{n-1} &amp; \mathbf 1 \\ \mathbf 1^T &amp; -2 \end{pmatrix},\] <p>where $D_{n-1}$ is the distance matrix of $T’$ and $\mathbf 1$ is the all-ones column. By the induction hypothesis, $\det(D_{n-1}) = (-1)^{n-2}(n-2)2^{n-3}\neq 0$, so $D_{n-1}$ is invertible. Thus, by the Schur complement,</p> \[\det(D_n) \;=\; \det(D_{n-1})\cdot\bigl(-2 - \mathbf 1^T D_{n-1}^{-1}\mathbf 1\bigr). \qquad (\star)\] <p>The remaining quantity has a clean closed form.</p> <p><strong class="paragraph">Lemma.</strong> <em>For any tree $T$ on $n\geq 2$ vertices, $D_T\,\tau = (n-1)\,\mathbf 1$, where $\tau_w := 2-\deg(w)$.</em></p> <p><em>Proof.</em> Induction on $n$. For $n=2$, $\tau=(1,1)^T$ and $D\tau=\mathbf 1$. For $n\geq 3$, take $\ell, v, T’$ as above. The only degrees that change between $T$ and $T’$ are at $v$ (loses one neighbor) and at $\ell$ (absent in $T’$), so</p> \[(\tau_T)_w = (\tau_{T'})_w \text{ for } w\neq v,\ell, \qquad (\tau_T)_v = (\tau_{T'})_v - 1, \qquad (\tau_T)_\ell = 1.\] <p>For $i\in T’$, using $d_T(i,\ell)=d_{T’}(i,v)+1$,</p> \[(D_T\tau_T)_i = \underbrace{\sum_{j\in T'} d_{T'}(i,j)(\tau_{T'})_j}_{=(D_{T'}\tau_{T'})_i\,=\,n-2} \;-\; d_{T'}(i,v) \;+\; \bigl(d_{T'}(i,v)+1\bigr)\cdot 1 \;=\; n-1.\] <p>For $i=\ell$, splitting $d_T(\ell,j) = d_{T’}(v,j)+1$ and using $\sum_{j\in T’}\tau_{T’}(j) = 2(n-1) - 2(n-2) = 2$,</p> \[(D_T\tau_T)_\ell = \sum_{j\in T'}\bigl(d_{T'}(v,j)+1\bigr)(\tau_T)_j = \bigl[(D_{T'}\tau_{T'})_v - 0\bigr] + \bigl[2 - 1\bigr] = n-1. \qquad\square\] <p>Returning to $(\star)$: by the lemma $D_{n-1}^{-1}\mathbf 1 = \tfrac{1}{n-2}\,\tau_{T’}$ for $n\geq 3$, so</p> \[\mathbf 1^T D_{n-1}^{-1}\mathbf 1 = \tfrac{1}{n-2}\sum_{j\in T'}\tau_{T'}(j) = \tfrac{2}{n-2},\] <p>and $(\star)$ becomes</p> \[\det(D_n) = \det(D_{n-1})\cdot\left(-2 - \tfrac{2}{n-2}\right) = -\tfrac{2(n-1)}{n-2}\,\det(D_{n-1}).\] <p>Applying the induction hypothesis gives</p> \[\det(D_n) = -\tfrac{2(n-1)}{n-2}\cdot(-1)^{n-2}(n-2)\,2^{n-3} = (-1)^{n-1}(n-1)\,2^{n-2}. \qquad\square\]]]></content><author><name>Peter Zeman</name><uri>https://zemanpeter.github.io/</uri></author><category term="combinatorics"/><category term="graph-theory"/><summary type="html"><![CDATA[A beautiful formula for the determinant of the distance matrix of a tree.]]></summary></entry></feed>