The UTokyo Mathematical Informatics Exam

A study guide for the entrance exam of the Department of Mathematical Informatics (数理情報学専攻) at the University of Tokyo: three hours, five problems, answer three. Every past problem from 2020 to 2026 is restated here with hints and a full solution, grouped by the idea it tests. Each group opens with the tools those problems keep reaching for, an interactive figure, and concept checks. The last module prepares the doctoral keyword essay.

Built from the department's published past papers (master's 2020 and 2023–2026, the 2021–2022 report assignments, and the 2026 doctoral papers), its 2026 statement of what the exam is meant to test (出題の意図), its sample problems, and the 2027 application guide. Problem numbers match the papers; the statements are restated in our own words, so check the official PDFs for exact wording. Books are from the department's recommended list; modules 2, 3, 4, 5 and 8 also cite one standard book each (Horn and Johnson, Strogatz, Boyd and Vandenberghe, Stein and Shakarchi, Kleinberg and Tardos) by result number, with a set of each book's exercises restated and solved. Related pages here: Linear Algebra, Real Analysis, High-Dimensional Probability, Markov Chains, Gradient Flows.

InteractivePast papers 2020–2026, 2027 application guide

The exam and its patterns

Twenty-five problems in five papers are enough to see the shape of the exam. Problem 1 is usually linear algebra, Problem 4 is usually probability, and Problem 5 has been an algorithms problem every year. The middle two rotate through differential equations, analysis and optimization.

The idea

The written exam (専門科目「数理情報学」). Three hours, 10:00–13:00. Five problems, of which you answer any three, one answer sheet per problem (you may use the back). The booklet has every problem in both Japanese and English; answer in either. Only a pencil, eraser and a plain watch are allowed.
Where it sits (2027 guide). Document screening first, with a two-page essay on why you want to join and one research theme you care about: its background, recent progress, what you would hope to find and why it matters. Those who pass take the school-wide general mathematics exam, then this specialized exam, then an online oral exam. English is assessed by TOEFL. There is no winter master's exam.
Dates. For 2027 entry the specialized exam was on 24 August 2026 and the oral on 27 August. For 2028 entry, expect the same late-August pattern in 2027; the guide for 2027 entry appeared in April 2026. The doctoral written exam (module 10) is online, in late August and again in late January (26–29 January 2027 for the winter round). Check the current guide before planning around any date here.

The department's statement of intent names five areas, linear algebra, differential equations, optimization, probability and statistics, and algorithms, and three abilities: computing and proving accurately, seeing the mathematical model behind a phenomenon, and designing algorithms. The papers match it closely. Several problems end with a part that asks what the mathematics means for the application (2025 P2(4) on phase separation is the clearest), and their sample problems ask where a matrix comes from as well as how to compute with it.

Three habits pay off on every paper:

  • Read all five first. Spend ten minutes; pick the three whose last part you can see a route to. That leaves about 55 minutes each.
  • Parts are a staircase. Later parts almost always use earlier ones. If you can't prove (2), say "by (2)" and use it in (3): you still earn (3).
  • Read the other language when wording looks odd. In 2024 P1(2) the English says "min tr(PXYᵀ)" but the Japanese says max, and only max is correct (see module 2).

In 2021 and 2022 the written exam was replaced by take-home report assignments (an essay on a concept you find important, a research survey and plan, and an essay on how mathematical informatics can address COVID-19, carbon neutrality, digital transformation or an ageing society). They are good practice for the screening essay.

Explore

Highlight an area
Pick a problem to see what it tests and where it is worked in this guide.

Mock exam

Draws five past problems in the exam's usual slots: linear algebra, two from differential equations, analysis and optimization, probability, then algorithms. Choose three, work on paper, and open the solutions only when the clock stops.

    3:00:00
    The clock runs in this tab only and nothing is saved.

    A twelve-week plan

    For someone starting from a solid undergraduate background, about ten hours a week. The order follows how often each area appears: the guaranteed slots (Problems 1, 4 and 5) first, then the rotating middle. Each week: read the module's idea section and the book sections, do the worked example and quizzes, then the past problems timed (55 minutes each, on paper, before opening any hint), then the book exercises. Keep a list of every step you got stuck on, and redo those problems a week later.

    1. Weeks 1–2: symmetric matrices

      Module 2; Horn and Johnson §§4.1, 7.1–7.2, 7.7. Past problems 2020 P1, 2024 P1, 2025 P1, 2026 P1, then the six book exercises. Goal: diagonalize-first becomes automatic.

    2. Weeks 3–4: probability and statistics

      Module 6 and module 7, with a standard probability text from the department's list (伏見 or Grimmett and Welsh) for transforms, the exponential and Poisson families, and maximum likelihood. Six past problems. Goal: change of variables, memorylessness, first-step analysis and Chernoff bounds without notes.

    3. Weeks 5–6: algorithms

      Module 8; Kleinberg and Tardos §§3.6, 4.4, 6.8–6.10, 7.1–7.5, 11.1. Five past problems (including 2023 P5 from module 9), then the three book exercises. Goal: every algorithm answer has the four parts (algorithm, invariant, correctness, running time).

    4. Week 7: differential equations

      Module 3; Strogatz §§2.5, 6.3–6.5, 7.2. Four past problems and five book exercises. Goal: for any planar system, find the fixed points, a conserved or decreasing quantity, and the long-run behaviour.

    5. Week 8: analysis

      Module 5; Stein and Shakarchi Ch. 2 §4 and Ch. 3 §§1–2, 7. Four past problems and four book exercises.

    6. Week 9: optimization, and algebra

      Module 4 with Boyd and Vandenberghe §§2.6, 3.1, 5.2, 8.1, and module 9. 2024 P2, 2020 P3, and the five book exercises.

    7. Weeks 10–12: full mock exams

      Two mock exams a week from the generator above, three hours each, choosing three of five under exam conditions, then marking against the solutions. Spend the days in between on the stuck-list. In the final week, redo one full real paper (2026 or 2025) cold.

    Applying to the doctoral program instead? Replace weeks 10–12 with module 10: one keyword essay a day from the drill, written in 30 minutes, with the five-part outline.

    Words worth knowing in Japanese

    Answers in English are fine, but reading the Japanese statement settles ambiguities. These terms come up on the papers above.

    正定値 / 半正定値positive definite / semidefinite
    固有値・固有ベクトルeigenvalue, eigenvector
    特異値分解singular value decomposition
    一意に定まるis uniquely determined
    必要十分条件necessary and sufficient condition
    同値であることを示せshow that … are equivalent
    反例を与えよgive a counterexample
    単調非増加monotonically non-increasing
    狭義単調減少strictly decreasing
    漸近挙動asymptotic behaviour
    確率密度関数probability density function
    期待値・分散expectation, variance
    最尤推定量maximum likelihood estimator
    分布収束(法則収束)convergence in distribution
    特性関数・モーメント母関数characteristic / moment generating function
    正則関数・留数holomorphic function, residue
    一様収束uniform convergence
    多項式時間・線形時間polynomial time, linear time
    帰着reduction
    最短経路問題shortest path problem
    非巡回向き付けacyclic orientation
    イデアル・剰余環・同型ideal, quotient ring, isomorphic
    相分離phase separation
    概略図を示せsketch a conceptual picture

    Check your understanding

    Which problem slot has been an algorithms problem on every paper from 2020 to 2026?

    1. Problem 1Problem 1 is usually linear algebra (four of five papers).
    2. Problem 3The middle slots rotate between differential equations, analysis, optimization and algebra.
    3. Problem 5
    2020 isotonic regression, 2023 non-adjacent form, 2024 makespan scheduling, 2025 tropical matrix powers, 2026 acyclic orientations. Each asks for an algorithm with a running-time guarantee and a correctness proof.

    You cannot prove part (2) but can see how (3) follows from it. What should you write?

    1. Skip (3) as well, since it depends on (2).Graders mark each part. A correct (3) that cites (2) earns its marks.
    2. Answer (3), stating clearly that you are using the result of (2).
    3. Prove a weaker version of (2) and stop.Worth doing if you have time, but don't let it cost you (3).
    The parts are designed as a staircase, and the later parts are often the more valuable ones.

    The 2027 guide says the written exam draws on algebraic, analytic, geometric, discrete, probabilistic, statistical and algorithmic methods. How many problems must you answer?

    1. All five.Five are set, but you choose.
    2. Three of the five.
    3. One from each area.There is no per-area requirement.
    Answer three of five in three hours. That freedom is why a breadth-first plan works: be solid in the three or four areas that appear every year, so a bad draw in one never forces you into a problem you can't finish.

    Reading

    From the department's recommended list, the books that match these papers most closely (◎ marks the department's "standard" level):

    • Linear algebra: Horn and Johnson, Matrix Analysis, Chapters 2, 4 and 7 (used in module 2); 室田・杉原『線形代数 I・II』◎.
    • Differential equations: Strogatz, Nonlinear Dynamics and Chaos, §§2.5, 6.3–6.5, 7.2 (used in module 3). Not on the department's list, which has no ODE book, but the exam's phase-plane and Lyapunov questions come straight from this material.
    • Analysis and complex analysis: Stein and Shakarchi, Complex Analysis, Chapters 2–3 (used in module 5); 杉浦『解析入門 I・II』◎; 森・杉原『複素関数論』◎; Ahlfors, Complex Analysis.
    • Optimization: Boyd and Vandenberghe, Convex Optimization, §§2.6, 3.1, 5.2, 8.1 (used in module 4; free from the authors); 寒野・土谷『最適化と変分法』◎; Matoušek and Gärtner, Understanding and Using Linear Programming.
    • Probability and statistics: 伏見『確率と確率過程』◎; 東京大学教養学部統計学教室『自然科学の統計学』◎; Grimmett and Welsh, Probability: An Introduction.
    • Algorithms: Kleinberg and Tardos, Algorithm Design, §§3.6, 6.8–6.10, 7.1–7.5, 11.1 (used in module 8); 渋谷『アルゴリズム』◎; Cormen, Leiserson, Rivest and Stein, Introduction to Algorithms.
    • Algebra and discrete mathematics: 伊理・藤重『応用代数』◎; Lidl and Pilz, Applied Abstract Algebra.
    Interactive2020 P1, 2024 P1, 2025 P1, 2026 P1; Horn and Johnson, Ch. 2, 4, 7

    Symmetric matrices and the PSD cone

    Four of the five Problem 1s are about real symmetric matrices. Almost every part yields to the same move: diagonalize the symmetric matrix with an orthogonal change of basis, and see what the question says about eigenvalues.

    The idea

    Spectral theorem (H&J 4.1.5). A real symmetric BB can be written B=QΛQ⊤B=Q\Lambda Q^\top with QQ orthogonal and Λ=diag(λ1,…,λn)\Lambda=\mathrm{diag}(\lambda_1,\dots,\lambda_n) real. B⪰OB\succeq O (positive semidefinite, 半正定値) means x⊤Bx≥0x^\top Bx\ge0 for all xx, equivalently all λi≥0\lambda_i\ge0. Then B1/2=QΛ1/2Q⊤B^{1/2}=Q\Lambda^{1/2}Q^\top is the unique PSD square root (H&J 7.2.6).

    Change basis first. (Sylvester's theorem, H&J 2.4.4.1, is the general form: AX−XB=CAX-XB=C is uniquely solvable for every CC exactly when AA and BB share no eigenvalue.) For an equation like BC+CB=ABC+CB=A, put C~=Q⊤CQ\tilde C=Q^\top CQ and A~=Q⊤AQ\tilde A=Q^\top AQ. The equation becomes ΛC~+C~Λ=A~\Lambda\tilde C+\tilde C\Lambda=\tilde A, which is entrywise: (λi+λj)C~ij=A~ij(\lambda_i+\lambda_j)\tilde C_{ij}=\tilde A_{ij}. Commuting with BB becomes (λi−λj)C~ij=0(\lambda_i-\lambda_j)\tilde C_{ij}=0.

    Loewner order (H&J 7.7.1). X⪰YX\succeq Y means X−Y⪰OX-Y\succeq O. It is a partial order: two symmetric matrices are often incomparable. Congruence preserves it: X⪰Y⇒S⊤XS⪰S⊤YSX\succeq Y\Rightarrow S^\top XS\succeq S^\top YS for any SS (H&J 7.7.2), which is the tool for reducing to B=IB=I.
    Trace facts for PSD matrices (H&J 7.2.P26, 7.5.4). If A,B⪰OA,B\succeq O then tr(AB)=tr(A1/2BA1/2)≥0\mathrm{tr}(AB)=\mathrm{tr}(A^{1/2}BA^{1/2})\ge0, and tr(AB)=‖A1/2B1/2‖F2\mathrm{tr}(AB)=\lVert A^{1/2}B^{1/2}\rVert_F^2, so tr(AB)=0\mathrm{tr}(AB)=0 if and only if AB=OAB=O. Conversely, A⪰OA\succeq O if and only if tr(AC)≥0\mathrm{tr}(AC)\ge0 for every PSD CC (take C=vv⊤C=vv^\top): the PSD cone is self-dual. Horn and Johnson credit this to Moutard (1894).
    What the order survives (H&J 7.7.4, 7.7.P3). If A⪰B≻OA\succeq B\succ O then B−1⪰A−1B^{-1}\succeq A^{-1} and A1/2⪰B1/2A^{1/2}\succeq B^{1/2}. It does not follow that A2⪰B2A^2\succeq B^2. (Functions that preserve the order are called operator monotone; t1/2t^{1/2}, log⁡t\log t and −1/t-1/t are, t2t^2 is not.)

    Projection onto the PSD cone. With the inner product ⟨A,B⟩=tr(AB)\langle A,B\rangle=\mathrm{tr}(AB), the nearest PSD matrix to a symmetric A=QΛQ⊤A=Q\Lambda Q^\top clips the negative eigenvalues: ϕ(A)=Qmax⁡(Λ,0)Q⊤\phi(A)=Q\max(\Lambda,0)Q^\top. Like every projection onto a closed convex set, it is characterized by the variational inequality ⟨A−ϕ(A),X−ϕ(A)⟩≤0\langle A-\phi(A),X-\phi(A)\rangle\le0 for all XX in the set. The same inequality reappears for isotonic regression in module 8.

    Orthogonal Procrustes (H&J 7.4.5). Over orthogonal PP, ‖PX−Y‖F2=‖X‖F2+‖Y‖F2−2tr(PXY⊤)\lVert PX-Y\rVert_F^2=\lVert X\rVert_F^2+\lVert Y\rVert_F^2-2\,\mathrm{tr}(PXY^\top). Minimizing it means maximizing the trace; if XY⊤=UΣV⊤XY^\top=U\Sigma V^\top, the maximizer is P=VU⊤P=VU^\top.

    Explore

    The curve x⊤Mx=1x^\top Mx=1 of a positive definite MM is an ellipse with semi-axes 1/λi1/\sqrt{\lambda_i} along its eigenvectors. A larger matrix gives a smaller ellipse, so P⪰QP\succeq Q exactly when the ellipse of PP sits inside the ellipse of QQ. left side right side. Drag the dots to change AA and BB.
    Test the claim
    Start from

    Worked example

    2025 P1(4): find 2×22\times2 symmetric A⪰B⪰OA\succeq B\succeq O with A2⪰̸B2A^2\not\succeq B^2.

    1. Why must AA and BB fail to commute?

      If AB=BAAB=BA they diagonalize in a common basis, and ai≥bi≥0a_i\ge b_i\ge0 gives ai2≥bi2a_i^2\ge b_i^2. So the counterexample needs tilted axes, as in the second preset above.

    2. Take B=diag(1,0)B=\mathrm{diag}(1,0) and A=B+(1111)A=B+\begin{pmatrix}1&1\\1&1\end{pmatrix}. Check A⪰B⪰OA\succeq B\succeq O.

      A−B=(1111)=vv⊤A-B=\begin{pmatrix}1&1\\1&1\end{pmatrix}=vv^\top with v=(1,1)⊤v=(1,1)^\top, which is PSD. BB is PSD. So A=(2111)⪰B⪰OA=\begin{pmatrix}2&1\\1&1\end{pmatrix}\succeq B\succeq O.

    3. Compute A2−B2A^2-B^2 and decide.

      A2=(5332)A^2=\begin{pmatrix}5&3\\3&2\end{pmatrix}, B2=BB^2=B, so A2−B2=(4332)A^2-B^2=\begin{pmatrix}4&3\\3&2\end{pmatrix} with determinant 8−9=−1<08-9=-1<0. One eigenvalue is negative, so A2⪰̸B2A^2\not\succeq B^2. Writing out the matrices and the determinant is a complete answer for a "false" part.

    Check your understanding

    If A⪰B⪰OA\succeq B\succeq O, which of these must hold?

    1. A2⪰B2A^2\succeq B^2The worked example above is a counterexample.
    2. A1/2⪰B1/2A^{1/2}\succeq B^{1/2}
    3. AB⪰OAB\succeq OABAB need not even be symmetric when they don't commute.
    The square root is operator monotone. Proof: let S=A1/2S=A^{1/2}, R=B1/2R=B^{1/2}, and suppose (S−R)v=−μv(S-R)v=-\mu v with μ>0\mu>0, ‖v‖=1\lVert v\rVert=1. Since S2−R2=(S−R)S+R(S−R)S^2-R^2=(S-R)S+R(S-R), we get v⊤(A−B)v=−μv⊤(S+R)v≤0v^\top(A-B)v=-\mu\,v^\top(S+R)v\le0. But A⪰BA\succeq B, so v⊤(S+R)v=0v^\top(S+R)v=0, forcing Sv=Rv=0Sv=Rv=0 and (S−R)v=0(S-R)v=0, a contradiction.

    X,Y⪰OX,Y\succeq O and tr(XY)=0\mathrm{tr}(XY)=0. What follows?

    1. X=OX=O or Y=OY=OX=diag(1,0)X=\mathrm{diag}(1,0), Y=diag(0,1)Y=\mathrm{diag}(0,1).
    2. XY=OXY=O
    3. X+YX+Y is singularThe same example gives X+Y=IX+Y=I.
    tr(XY)=‖X1/2Y1/2‖F2=0\mathrm{tr}(XY)=\lVert X^{1/2}Y^{1/2}\rVert_F^2=0 forces X1/2Y1/2=OX^{1/2}Y^{1/2}=O, hence XY=OXY=O. The ranges are orthogonal: that is the complementarity behind 2026 P1(4) and semidefinite programming.

    What is the nearest PSD matrix to A=diag(3,−2)A=\mathrm{diag}(3,-2) in the Frobenius norm?

    1. diag(3,0)\mathrm{diag}(3,0)
    2. diag(3,2)\mathrm{diag}(3,2)That flips the sign. It is at distance 4, while clipping gives distance 2.
    3. diag(1,0)\mathrm{diag}(1,0)Clipping only touches negative eigenvalues.
    Clip negative eigenvalues to zero in the eigenbasis. 2026 P1(2) asks you to prove this is the unique minimizer.

    Practice

    Past problems

    Restated in our own words. Official statements: 2020, 2024, 2025, 2026.

    2020 Problem 1The equation BC + CB = A

    AA is a real n×nn\times n matrix and BB is symmetric positive definite. (1) Show there is exactly one real CC with BC+CB=ABC+CB=A; call it CA,BC_{A,B}. (2) Show BCA,B=CA,BBBC_{A,B}=C_{A,B}B if and only if AB=BAAB=BA.

    Hint

    (1) Change to the eigenbasis of BB. (2) For one direction, show BCB−1BCB^{-1} also solves the equation and use uniqueness.

    Solution

    (1) Write B=QΛQ⊤B=Q\Lambda Q^\top with all λi>0\lambda_i>0. With C~=Q⊤CQ\tilde C=Q^\top CQ and A~=Q⊤AQ\tilde A=Q^\top AQ, the equation is equivalent to (λi+λj)C~ij=A~ij(\lambda_i+\lambda_j)\tilde C_{ij}=\tilde A_{ij} for all i,ji,j. Since λi+λj>0\lambda_i+\lambda_j>0, the unique solution is C~ij=A~ij/(λi+λj)\tilde C_{ij}=\tilde A_{ij}/(\lambda_i+\lambda_j), and C=QC~Q⊤C=Q\tilde CQ^\top is real. (Equivalently, the linear map C↦BC+CBC\mapsto BC+CB has eigenvalues λi+λj>0\lambda_i+\lambda_j>0, so it is invertible.)

    (2) If BC=CBBC=CB then A=2BCA=2BC, and AB=2BCB=2B(BC)=BAAB=2BCB=2B(BC)=BA. Conversely, if AB=BAAB=BA, let C′=BCB−1C'=BCB^{-1}. Then BC′+C′B=B(BC+CB)B−1=BAB−1=ABC'+C'B=B(BC+CB)B^{-1}=BAB^{-1}=A, so C′=CC'=C by uniqueness, which says BC=CBBC=CB.

    2024 Problem 1Orthogonal Procrustes

    Let d<md<m, X,Y∈ℝd×mX,Y\in\R^{d\times m}, and let OPT(X,Y)\mathrm{OPT}(X,Y) be the set of minimizers of ‖PX−Y‖F2\lVert PX-Y\rVert_F^2 over P∈ℝd×dP\in\R^{d\times d} with P⊤P=IP^\top P=I. (1) Given A,B∈ℝd×mA,B\in\R^{d\times m} with columns aj,bja_j,b_j and weights wj>0w_j>0, find X,YX,Y so that OPT(X,Y)\mathrm{OPT}(X,Y) is the set of minimizers of ∑jwj‖Paj−bj‖22\sum_j w_j\lVert Pa_j-b_j\rVert_2^2. (2) Show OPT(X,Y)\mathrm{OPT}(X,Y) is the set of maximizers of tr(PXY⊤)\mathrm{tr}(PXY^\top) over orthogonal PP. (3) If XY⊤=UΣV⊤XY^\top=U\Sigma V^\top is an SVD, give an element of OPT(X,Y)\mathrm{OPT}(X,Y).

    A note on the wording

    The English paper prints "min" in (2); the Japanese paper says 最大化 (max). Only max is right, as the solution shows. When something looks off, read the other version.

    Hint

    (1) Scale the columns. (2) Expand the square; ‖PX‖F=‖X‖F\lVert PX\rVert_F=\lVert X\rVert_F when PP is orthogonal. (3) Write tr(PUΣV⊤)=tr(ZΣ)\mathrm{tr}(PU\Sigma V^\top)=\mathrm{tr}(Z\Sigma) with Z=V⊤PUZ=V^\top PU orthogonal.

    Solution

    (1) X=AW1/2X=AW^{1/2}, Y=BW1/2Y=BW^{1/2} with W=diag(w1,…,wm)W=\mathrm{diag}(w_1,\dots,w_m). Column jj of PX−YPX-Y is wj(Paj−bj)\sqrt{w_j}(Pa_j-b_j), so ‖PX−Y‖F2=∑jwj‖Paj−bj‖22\lVert PX-Y\rVert_F^2=\sum_jw_j\lVert Pa_j-b_j\rVert_2^2 for every PP.

    (2) ‖PX−Y‖F2=tr(X⊤P⊤PX)−2tr(Y⊤PX)+‖Y‖F2=‖X‖F2+‖Y‖F2−2tr(PXY⊤)\lVert PX-Y\rVert_F^2=\mathrm{tr}(X^\top P^\top PX)-2\,\mathrm{tr}(Y^\top PX)+\lVert Y\rVert_F^2=\lVert X\rVert_F^2+\lVert Y\rVert_F^2-2\,\mathrm{tr}(PXY^\top), using P⊤P=IP^\top P=I and tr(Y⊤PX)=tr(PXY⊤)\mathrm{tr}(Y^\top PX)=\mathrm{tr}(PXY^\top). The first two terms don't depend on PP, so minimizing the left side is the same as maximizing tr(PXY⊤)\mathrm{tr}(PXY^\top).

    (3) tr(PUΣV⊤)=tr(V⊤PUΣ)=∑iσiZii\mathrm{tr}(PU\Sigma V^\top)=\mathrm{tr}(V^\top PU\Sigma)=\sum_i\sigma_iZ_{ii} with Z=V⊤PUZ=V^\top PU orthogonal. Entries of an orthogonal matrix satisfy |Zii|≤1|Z_{ii}|\le1, so the trace is at most ∑iσi\sum_i\sigma_i, with equality at Z=IZ=I, i.e. P=VU⊤P=VU^\top. This PP is in OPT(X,Y)\mathrm{OPT}(X,Y). Horn and Johnson (7.4.5) state the same answer through the polar decomposition: if YX⊤=HU0YX^\top=HU_0 with H⪰OH\succeq O, U0U_0 orthogonal, then P=U0P=U_0.

    2025 Problem 1True or false for the Loewner order

    For real symmetric d×dd\times d matrices A,BA,B (d≥2d\ge2), prove or give a counterexample: (1) A,B⪰O⇒tr(AB)≥0A,B\succeq O\Rightarrow\mathrm{tr}(AB)\ge0. (2) A,B⪰OA,B\succeq O and tr(AB)=0⇒A=O\mathrm{tr}(AB)=0\Rightarrow A=O or B=OB=O. (3) tr(AC)≥0\mathrm{tr}(AC)\ge0 for every PSD C⇒A⪰OC\Rightarrow A\succeq O. (4) A⪰B⪰O⇒A2⪰B2A\succeq B\succeq O\Rightarrow A^2\succeq B^2. (5) A⪰B≻O⇒B−1⪰A−1A\succeq B\succ O\Rightarrow B^{-1}\succeq A^{-1}.

    Hint

    (5) Reduce to the case B=IB=I by congruence with B−1/2B^{-1/2}.

    Solution

    (1) True. tr(AB)=tr(A1/2BA1/2)\mathrm{tr}(AB)=\mathrm{tr}(A^{1/2}BA^{1/2}), and A1/2BA1/2⪰OA^{1/2}BA^{1/2}\succeq O since x⊤A1/2BA1/2x=(A1/2x)⊤B(A1/2x)≥0x^\top A^{1/2}BA^{1/2}x=(A^{1/2}x)^\top B(A^{1/2}x)\ge0. Its trace is a sum of nonnegative eigenvalues.

    (2) False. A=diag(1,0,…,0)A=\mathrm{diag}(1,0,\dots,0), B=diag(0,1,0,…,0)B=\mathrm{diag}(0,1,0,\dots,0).

    (3) True. For any vv, C=vv⊤⪰OC=vv^\top\succeq O, and tr(Avv⊤)=v⊤Av≥0\mathrm{tr}(Avv^\top)=v^\top Av\ge0.

    (4) False. The worked example above, padded with zeros for d>2d>2.

    (5) True. A⪰BA\succeq B gives M:=B−1/2AB−1/2⪰IM:=B^{-1/2}AB^{-1/2}\succeq I (congruence preserves ⪰\succeq), so every eigenvalue of MM is at least 1 and every eigenvalue of M−1=B1/2A−1B1/2M^{-1}=B^{1/2}A^{-1}B^{1/2} is at most 1, i.e. B1/2A−1B1/2⪯IB^{1/2}A^{-1}B^{1/2}\preceq I. Congruence with B−1/2B^{-1/2} gives A−1⪯B−1A^{-1}\preceq B^{-1}.

    2026 Problem 1Projection onto the PSD cone

    𝕊n\mathbb S^n is the space of real symmetric matrices with ⟨A,B⟩=tr(AB)\langle A,B\rangle=\mathrm{tr}(AB), and 𝕊+n\mathbb S^n_+ the PSD ones. (1) Show 𝕊+n\mathbb S^n_+ is convex. (2) Show ‖X−A‖2\lVert X-A\rVert^2 has a unique minimizer ϕ(A)\phi(A) over X∈𝕊+nX\in\mathbb S^n_+ and write it using the eigen-decomposition of AA. (3) Show ⟨A−ϕ(A),X−ϕ(A)⟩≤0\langle A-\phi(A),X-\phi(A)\rangle\le0 for all X∈𝕊+nX\in\mathbb S^n_+. (4) For X,Y∈𝕊+nX,Y\in\mathbb S^n_+, show ⟨X,Y⟩=0\langle X,Y\rangle=0 if and only if X=ϕ(X−Y)X=\phi(X-Y).

    Hint

    (2) In the eigenbasis of AA, the squared distance is at least the sum of squared diagonal differences. (4) First prove the converse of (3): a PSD ZZ satisfying the inequality must be ϕ(A)\phi(A).

    Solution

    (1) x⊤(αX+(1−α)Y)x=αx⊤Xx+(1−α)x⊤Yx≥0x^\top(\alpha X+(1-\alpha)Y)x=\alpha x^\top Xx+(1-\alpha)x^\top Yx\ge0.

    (2) Write A=QΛQ⊤A=Q\Lambda Q^\top. For PSD XX, X~=Q⊤XQ\tilde X=Q^\top XQ is PSD (so X~ii≥0\tilde X_{ii}\ge0) and ‖X−A‖2=‖X~−Λ‖2=∑i(X~ii−λi)2+∑i≠jX~ij2≥∑i(X~ii−λi)2≥∑i:λi<0λi2\lVert X-A\rVert^2=\lVert\tilde X-\Lambda\rVert^2=\sum_i(\tilde X_{ii}-\lambda_i)^2+\sum_{i\ne j}\tilde X_{ij}^2\ge\sum_i(\tilde X_{ii}-\lambda_i)^2\ge\sum_{i:\lambda_i<0}\lambda_i^2. Equality holds throughout exactly when X~\tilde X is diagonal with X~ii=max⁡(λi,0)\tilde X_{ii}=\max(\lambda_i,0). So the minimizer exists and is unique: ϕ(A)=∑imax⁡(λi,0)qiqi⊤\phi(A)=\sum_i\max(\lambda_i,0)\,q_iq_i^\top, where qiq_i are orthonormal eigenvectors.

    (3) Let N=∑λi<0(−λi)qiqi⊤⪰ON=\sum_{\lambda_i<0}(-\lambda_i)q_iq_i^\top\succeq O. Then A−ϕ(A)=−NA-\phi(A)=-N and Nϕ(A)=ON\phi(A)=O (they live on orthogonal eigenvectors), so ⟨A−ϕ(A),X−ϕ(A)⟩=−⟨N,X⟩+⟨N,ϕ(A)⟩=−tr(NX)≤0\langle A-\phi(A),X-\phi(A)\rangle=-\langle N,X\rangle+\langle N,\phi(A)\rangle=-\mathrm{tr}(NX)\le0 by the trace fact. (A general proof: for t∈(0,1]t\in(0,1], ϕ+t(X−ϕ)\phi+t(X-\phi) is PSD by (1), so ‖ϕ+t(X−ϕ)−A‖2≥‖ϕ−A‖2\lVert\phi+t(X-\phi)-A\rVert^2\ge\lVert\phi-A\rVert^2; expand, divide by tt, let t→0t\to0.)

    (4) First, if ZZ is PSD and ⟨A−Z,W−Z⟩≤0\langle A-Z,W-Z\rangle\le0 for all PSD WW, then ‖W−A‖2=‖W−Z‖2+‖Z−A‖2−2⟨A−Z,W−Z⟩≥‖Z−A‖2\lVert W-A\rVert^2=\lVert W-Z\rVert^2+\lVert Z-A\rVert^2-2\langle A-Z,W-Z\rangle\ge\lVert Z-A\rVert^2, so Z=ϕ(A)Z=\phi(A) by uniqueness. Now take A=X−YA=X-Y, Z=XZ=X: the inequality reads ⟨−Y,W−X⟩=⟨X,Y⟩−⟨Y,W⟩≤0\langle -Y,W-X\rangle=\langle X,Y\rangle-\langle Y,W\rangle\le0 for all PSD WW.

    (i)⇒(ii): if ⟨X,Y⟩=0\langle X,Y\rangle=0, this is −tr(YW)≤0-\mathrm{tr}(YW)\le0, true by the trace fact, so X=ϕ(X−Y)X=\phi(X-Y). (ii)⇒(i): if X=ϕ(X−Y)X=\phi(X-Y), (3) gives the inequality for all PSD WW. With W=OW=O: ⟨X,Y⟩≤0\langle X,Y\rangle\le0. The trace fact gives ⟨X,Y⟩≥0\langle X,Y\rangle\ge0. So ⟨X,Y⟩=0\langle X,Y\rangle=0.

    From Horn and Johnson, Matrix Analysis (2nd ed., Cambridge, 2013)

    Numbers match the book, which works over ℂ\mathbb C with Hermitian matrices; read "real symmetric" and ⊤^\top if you prefer. Each problem is restated in our own words; the hints and solutions are written for this page.

    Problem 2.4.P13Sylvester's equation by eigenvalues (the engine of 2020 P1)

    Let A∈MnA\in M_n and B∈MmB\in M_m have no eigenvalue in common. Show that X↦AX−XBX\mapsto AX-XB is invertible on n×mn\times m matrices, by showing that T1(X)=AXT_1(X)=AX and T2(X)=XBT_2(X)=XB commute and that the eigenvalues of T1−T2T_1-T_2 are differences of eigenvalues of AA and BB.

    Hint

    T1T_1 acts on each column of XX by AA; T2T_2 acts on each row by B⊤B^\top. Commuting linear maps can be triangularized in one basis (H&J 2.3.3).

    Solution

    T1T2(X)=AXB=T2T1(X)T_1T_2(X)=AXB=T_2T_1(X). Acting column by column, T1T_1 is Im⊗AI_m\otimes A, with the eigenvalues λi\lambda_i of AA; acting row by row, T2T_2 is B⊤⊗InB^\top\otimes I_n, with the eigenvalues μj\mu_j of BB. Triangularize T1T_1 and T2T_2 simultaneously: the diagonal of T1−T2T_1-T_2 then consists of differences λi−μj\lambda_i-\mu_j, none of which is 0. So T1−T2T_1-T_2 is invertible.

    For 2020 P1, BC+CB=ABC+CB=A is BC−C(−B)=ABC-C(-B)=A: the relevant differences are λi−(−λj)=λi+λj>0\lambda_i-(-\lambda_j)=\lambda_i+\lambda_j>0. The eigenbasis computation in that solution is this argument made explicit.

    Problem 7.2.P26(a)A two-sided bound on tr AB

    For PSD A,BA,B, show 0≤trAB≤λmax⁡(A)trB0\le\mathrm{tr}\,AB\le\lambda_{\max}(A)\,\mathrm{tr}\,B (the book writes λmax⁡(A)\lambda_{\max}(A) as the spectral norm |||A|||2|||A|||_2).

    Hint

    Move the square root of BB to both sides and use A⪯λmax⁡(A)IA\preceq\lambda_{\max}(A)I.

    Solution

    trAB=tr(B1/2AB1/2)\mathrm{tr}\,AB=\mathrm{tr}(B^{1/2}AB^{1/2}). Since O⪯A⪯λmax⁡(A)IO\preceq A\preceq\lambda_{\max}(A)I, congruence gives O⪯B1/2AB1/2⪯λmax⁡(A)BO\preceq B^{1/2}AB^{1/2}\preceq\lambda_{\max}(A)B, and the trace is monotone for ⪯\preceq (the difference has non-negative eigenvalues). Taking traces gives both inequalities. The lower one is 2025 P1(1).

    Problem 7.7.P6A bigger matrix has a bigger range

    If A⪰B⪰OA\succeq B\succeq O, show rangeB⊆rangeA\mathrm{range}\,B\subseteq\mathrm{range}\,A.

    Hint

    Compare null spaces, then take orthogonal complements.

    Solution

    If Ax=0Ax=0, then 0=x⊤Ax≥x⊤Bx=‖B1/2x‖2≥00=x^\top Ax\ge x^\top Bx=\lVert B^{1/2}x\rVert^2\ge0, so B1/2x=0B^{1/2}x=0 and Bx=0Bx=0. Hence nullA⊆nullB\mathrm{null}\,A\subseteq\mathrm{null}\,B. For symmetric matrices range=(null)⟂\mathrm{range}=(\mathrm{null})^\perp, so rangeB⊆rangeA\mathrm{range}\,B\subseteq\mathrm{range}\,A. In the ellipse picture: wherever AA is degenerate, its "ellipse" runs off to infinity, and since it must fit inside BB's, BB is degenerate in that direction too.

    Problem 7.7.P21(a, b)How much must A be scaled to dominate B?

    Let A≻OA\succ O and B⪰OB\succeq O. Show that cA⪰BcA\succeq B for some c>0c>0, and that the smallest such cc is the spectral radius ρ(A−1B)\rho(A^{-1}B).

    Hint

    Congruence by A−1/2A^{-1/2}.

    Solution

    cA⪰B⟺cI⪰A−1/2BA−1/2⟺c≥λmax⁡(A−1/2BA−1/2)cA\succeq B\iff cI\succeq A^{-1/2}BA^{-1/2}\iff c\ge\lambda_{\max}(A^{-1/2}BA^{-1/2}). The matrix A−1/2BA−1/2A^{-1/2}BA^{-1/2} is PSD and similar to A−1BA^{-1}B, so its largest eigenvalue is ρ(A−1B)\rho(A^{-1}B). This generalized eigenvalue is a quick test for A⪰BA\succeq B: it holds exactly when ρ(A−1B)≤1\rho(A^{-1}B)\le1 (H&J 7.7.3).

    Problem 7.7.P44Inverses reverse the order, from the definition

    If A⪰B≻OA\succeq B\succ O, prove B−1⪰A−1B^{-1}\succeq A^{-1} directly: show x⊤B−1x≥x⊤A−1xx^\top B^{-1}x\ge x^\top A^{-1}x for every xx, starting from (y−B−1x)⊤B(y−B−1x)≥0(y-B^{-1}x)^\top B(y-B^{-1}x)\ge0.

    Hint

    Expand the square, use A⪰BA\succeq B on the y⊤Byy^\top By term, then choose y=A−1xy=A^{-1}x.

    Solution

    Expanding, y⊤By−2y⊤x+x⊤B−1x≥0y^\top By-2y^\top x+x^\top B^{-1}x\ge0, i.e. x⊤B−1x≥2y⊤x−y⊤By≥2y⊤x−y⊤Ayx^\top B^{-1}x\ge2y^\top x-y^\top By\ge2y^\top x-y^\top Ay, the last step because y⊤Ay≥y⊤Byy^\top Ay\ge y^\top By. With y=A−1xy=A^{-1}x the right side is 2x⊤A−1x−x⊤A−1x=x⊤A−1x2x^\top A^{-1}x-x^\top A^{-1}x=x^\top A^{-1}x. This is a second proof of 2025 P1(5), and it needs no square roots at all: a good one to have if you blank on the congruence argument.

    Problem 7.7.P45One block matrix, two Schur complements

    For A,B≻OA,B\succ O, let H=(B−1IIA)H=\begin{pmatrix}B^{-1}&I\\I&A\end{pmatrix}. Compute the Schur complements of B−1B^{-1} and of AA in HH, and explain why A⪰B⟺H⪰O⟺B−1⪰A−1A\succeq B\iff H\succeq O\iff B^{-1}\succeq A^{-1}.

    Hint

    If P≻OP\succ O, then (PQQ⊤R)⪰O\begin{pmatrix}P&Q\\Q^\top&R\end{pmatrix}\succeq O if and only if R−Q⊤P−1Q⪰OR-Q^\top P^{-1}Q\succeq O.

    Solution

    H/B−1=A−IBI=A−BH/B^{-1}=A-I\,B\,I=A-B and H/A=B−1−IA−1I=B−1−A−1H/A=B^{-1}-I\,A^{-1}I=B^{-1}-A^{-1}. The hint follows from the congruence (I0−Q⊤P−1I)(PQQ⊤R)(I−P−1Q0I)=(P00R−Q⊤P−1Q)\begin{pmatrix}I&0\\-Q^\top P^{-1}&I\end{pmatrix}\begin{pmatrix}P&Q\\Q^\top&R\end{pmatrix}\begin{pmatrix}I&-P^{-1}Q\\0&I\end{pmatrix}=\begin{pmatrix}P&0\\0&R-Q^\top P^{-1}Q\end{pmatrix}. Applying it with either diagonal block as the pivot gives A−B⪰O⟺H⪰O⟺B−1−A−1⪰OA-B\succeq O\iff H\succeq O\iff B^{-1}-A^{-1}\succeq O. A third proof of 2025 P1(5), and the standard way this fact is used in semidefinite programming.

    Simulation2020 P4, 2023 P2, 2025 P2, 2026 P3; Strogatz §§2.5, 6.3–6.5, 7.2

    Differential equations: what never increases

    The exam rarely asks you to solve a nonlinear equation outright. It asks what the solution does in the long run, and the answer comes from a quantity you can track: one that is conserved, one that only decreases, or a Fourier mode that decays at a known rate.

    The idea

    Equilibria (Strogatz §6.3). For x˙=F(x)\dot x=F(x), the constant solutions are exactly the zeros of FF. With uniqueness of solutions assumed, "x(t)=x(0)x(t)=x(0) for all tt" is the same as F(x(0))=0F(x(0))=0. Near an equilibrium, the eigenvalues of the Jacobian classify it (node, saddle, spiral), except in borderline cases such as centers.
    Lyapunov functions (Strogatz §7.2, which spells it Liapunov). If LL is minimized at an equilibrium x*x^* and ddtL(x(t))=∇L⋅F<0\frac{\d}{\d t}L(x(t))=\nabla L\cdot F<0 away from x*x^*, solutions are drawn toward x*x^*. For Lotka–Volterra systems x˙i=xi(vi+(Ax)i)\dot x_i=x_i(v_i+(Ax)_i), Volterra's choice L=∑ci(xi−xi*log⁡xi)+constL=\sum c_i(x_i-x_i^*\log x_i)+\text{const} gives L˙=12z⊤(CA+A⊤C)z\dot L=\tfrac12 z^\top(CA+A^\top C)z with z=x−x*z=x-x^*.
    Conserved quantities from dy/dx\d y/\d x (Strogatz §6.5). In the plane, dividing the equations gives dy/dx=y˙/x˙\d y/\d x=\dot y/\dot x. If that separates or is exact, integrating gives H(x,y)=constH(x,y)=\text{const} along solutions, and the trajectories are level sets of HH. If an isolated equilibrium is a local minimum of HH, nearby orbits are closed (Strogatz Theorem 6.5.1).
    Comparison and blow-up (Strogatz §2.5). If x˙≥x2\dot x\ge x^2 and x(0)=1x(0)=1, then ddt(−1/x)≥1\frac{\d}{\d t}(-1/x)\ge1, so x(t)≥1/(1−t)x(t)\ge1/(1-t): the solution leaves every bounded set before t=1t=1.
    Linear equations on a circle or interval. Constant-coefficient linear equations are diagonalized by Fourier modes. On ℤ/Nℤ\Z/N\Z, e2πimn/Ne^{2\pi imn/N} is an eigenvector of the second difference with eigenvalue −4sin2⁡(πm/N)-4\sin^2(\pi m/N). On (0,L)(0,L) with zero-flux (Neumann) ends, cos⁡(kπx/L)\cos(k\pi x/L) is an eigenfunction of ∂x2\partial_x^2 with eigenvalue −(kπ/L)2-(k\pi/L)^2. Every nonzero mode decays; the mean (mode 0) survives.

    Gradient flows. The Allen–Cahn equation ut=u−u3+uxxu_t=u-u^3+u_{xx} is the steepest descent of the energy H(u)=∫(14u4−12u2+12ux2)dxH(u)=\int(\tfrac14u^4-\tfrac12u^2+\tfrac12u_x^2)\,\d x: a double well that prefers u=±1u=\pm1, plus a penalty on gradients. That structure is why HH never increases (2025 P2(1)), and it is the picture to draw in (4). For more on gradient flows, see the Gradient Flows page.

    Explore: an epidemic in the phase plane

    x˙=−2xy, y˙=2xy−y\dot x=-2xy,\ \dot y=2xy-y (2026 P3). Read xx as the susceptible and yy as the infected fraction. trajectory equilibria y=0y=0 x=12x=\tfrac12. Faint curves are level sets of H=x+y−12log⁡xH=x+y-\tfrac12\log x. Drag the dot.
    Starting point
    Jump to

    Explore: phase separation

    Equation
    Initial data
    Space–time picture: xx across, time down. u≈+1u\approx+1 u≈−1u\approx-1; pale means mixed (u≈0u\approx0).
    The profile u(t,⋅)u(t,\cdot) now, between −1-1 and 11.

    Worked example

    2026 P3(3): start with x(0),y(0)>0x(0),y(0)>0, x(0)+y(0)=1x(0)+y(0)=1. Can limt→∞⁡x(t)\lim_{t\to\infty}x(t) lie in [12,1)[\tfrac12,1)?

    1. Find a conserved quantity.

      dydx=2xy−y−2xy=−1+12x\dfrac{\d y}{\d x}=\dfrac{2xy-y}{-2xy}=-1+\dfrac1{2x}, so y=−x+12log⁡x+consty=-x+\tfrac12\log x+\text{const}. Check: H=x+y−12log⁡xH=x+y-\tfrac12\log x has H˙=−2xy+(2xy−y)−12⋅−2xyx=0\dot H=-2xy+(2xy-y)-\tfrac12\cdot\dfrac{-2xy}{x}=0.

    2. Show the limits x∞x_\infty, y∞y_\infty exist, with y∞=0y_\infty=0 and x∞>0x_\infty>0.

      From (2), x,y>0x,y>0, so xx strictly decreases and is bounded below: x∞x_\infty exists. x+yx+y decreases (ddt(x+y)=−y\frac{\d}{\d t}(x+y)=-y) and is bounded below, so it has a limit and ∫0∞ydt=1−lim⁡(x+y)<∞\int_0^\infty y\,\d t=1-\lim(x+y)<\infty; with yy converging (as the difference of convergent functions), y∞=0y_\infty=0. Finally log⁡x(t)=log⁡x(0)−2∫0ty\log x(t)=\log x(0)-2\int_0^ty, which stays bounded, so x∞>0x_\infty>0.

    3. Use HH to locate x∞x_\infty.

      Let g(x)=x−12log⁡xg(x)=x-\tfrac12\log x, which decreases on (0,12](0,\tfrac12] and increases on [12,∞)[\tfrac12,\infty). Conservation gives g(x∞)=H(x(0),y(0))=g(x(0))+y(0)>g(x(0))g(x_\infty)=H(x(0),y(0))=g(x(0))+y(0)>g(x(0)). If x∞≥12x_\infty\ge\tfrac12, then 12≤x∞<x(0)\tfrac12\le x_\infty<x(0) and gg increasing there gives g(x∞)<g(x(0))g(x_\infty)<g(x(0)), a contradiction. So x∞<12x_\infty<\tfrac12 always, and no such solution exists.

      In epidemic terms, x=12x=\tfrac12 is the herd-immunity threshold (R0=2R_0=2); the outbreak always overshoots it. Drag the starting point above to watch this.

    Check your understanding

    Along solutions of x˙=−2xy, y˙=2xy−y\dot x=-2xy,\ \dot y=2xy-y with x>0x>0, which quantity is constant?

    1. x+yx+yddt(x+y)=−y\frac{\d}{\d t}(x+y)=-y, which is why x+y≤1x+y\le1 in (2).
    2. x+y−12log⁡xx+y-\tfrac12\log x
    3. xyxyddt(xy)=xy(2x−2y−1)\frac{\d}{\d t}(xy)=xy(2x-2y-1), not zero in general.
    Integrate dy/dx=−1+1/(2x)\d y/\d x=-1+1/(2x). The level sets of this HH are the trajectories in the figure.

    Linearize ut=u−u3+uxxu_t=u-u^3+u_{xx} at u=0u=0 on (0,L)(0,L) with zero-flux ends. When does the mode cos⁡(kπx/L)\cos(k\pi x/L) grow?

    1. When (kπ/L)2<1(k\pi/L)^2<1
    2. Always: the reaction term pushes away from 0Diffusion damps short waves at rate (kπ/L)2(k\pi/L)^2, which can beat the reaction's rate 1.
    3. Never: diffusion smooths everythingMode 0 (and other long waves) grow at rate 1−(kπ/L)2>01-(k\pi/L)^2>0.
    The linearization is ut=u+uxxu_t=u+u_{xx}, with growth rate 1−(kπ/L)21-(k\pi/L)^2. Long waves grow and short ones die, which is why small noise first turns into a few broad bumps. If L<πL<\pi, only the mean grows.

    If x˙≥x2\dot x\ge x^2 and x(0)=1x(0)=1, what can you conclude?

    1. xx blows up at some T≤1T\le1.
    2. xx grows at least exponentially, but exists for all time.Compare with u˙=u2\dot u=u^2, whose solution 1/(1−t)1/(1-t) blows up at 1.
    3. Nothing without an upper bound on x˙\dot x.A lower bound is exactly what forces blow-up.
    ddt(1/x)=−x˙/x2≤−1\frac{\d}{\d t}(1/x)=-\dot x/x^2\le-1, so 1/x(t)≤1−t1/x(t)\le1-t. This is the last step of 2026 P3(4).

    Practice

    Past problems

    Restated in our own words. Official statements: 2020, 2023, 2025, 2026.

    2020 Problem 4Discrete heat equation on a ring

    ∂tx(n,t)=x(n−1,t)+x(n+1,t)−2x(n,t)\partial_tx(n,t)=x(n-1,t)+x(n+1,t)-2x(n,t) for integers nn, with x(n+N,t)=x(n,t)x(n+N,t)=x(n,t), N≥3N\ge3. Let e(m,n)=e2πimn/Ne(m,n)=e^{2\pi imn/N}. (1) If x(n,t)=e(m,n)fm(t)x(n,t)=e(m,n)f_m(t) is a solution with fm(0)=cmf_m(0)=c_m, find fmf_m. (2) Solve with x(n,0)=gnx(n,0)=g_n, n=0,…,N−1n=0,\dots,N-1. (3) Find limt→∞⁡x(n,t)\lim_{t\to\infty}x(n,t).

    Hint

    e(m,n±1)=e(m,n)e±2πim/Ne(m,n\pm1)=e(m,n)e^{\pm2\pi im/N}. For (2), expand gg in the discrete Fourier basis.

    Solution

    (1) Substituting, fm′=(e−2πim/N+e2πim/N−2)fm=−4sin2⁡(πm/N)fmf_m'=(e^{-2\pi im/N}+e^{2\pi im/N}-2)f_m=-4\sin^2(\pi m/N)f_m, so fm(t)=cme−4sin2⁡(πm/N)tf_m(t)=c_me^{-4\sin^2(\pi m/N)\,t}. Periodicity holds because e(m,n+N)=e(m,n)e(m,n+N)=e(m,n).

    (2) By orthogonality ∑n=0N−1e(m,n)e(m′,n)=Nδmm′\sum_{n=0}^{N-1}e(m,n)\overline{e(m',n)}=N\delta_{mm'}, gn=∑m=0N−1cme(m,n)g_n=\sum_{m=0}^{N-1}c_me(m,n) with cm=1N∑n=0N−1gne−2πimn/Nc_m=\frac1N\sum_{n=0}^{N-1}g_ne^{-2\pi imn/N}. By linearity, x(n,t)=∑m=0N−1cme2πimn/Ne−4sin2⁡(πm/N)tx(n,t)=\sum_{m=0}^{N-1}c_m\,e^{2\pi imn/N}e^{-4\sin^2(\pi m/N)t}. (It satisfies (*), (**), and the initial condition; uniqueness for this linear ODE system makes it the solution.)

    (3) For 1≤m≤N−11\le m\le N-1, sin2⁡(πm/N)>0\sin^2(\pi m/N)>0, so those terms vanish. The limit is c0=1N∑ngnc_0=\frac1N\sum_ng_n, the average of the initial values, for every nn.

    2023 Problem 2Stability of a Lotka–Volterra system

    AA is a real nonsingular n×nn\times n matrix, Fi(x)=xi(vi+∑jaijxj)F_i(x)=x_i(v_i+\sum_ja_{ij}x_j) on the positive orthant, and x*x^* is a positive equilibrium. Consider x˙=F(x)\dot x=F(x). (1) For c>0c>0 and L(x)=∑ici[xi*log⁡(xi*/xi)−xi*+xi]L(x)=\sum_ic_i[x_i^*\log(x_i^*/x_i)-x_i^*+x_i], show L˙(x′)<0\dot L(x')<0 for every positive x′≠x*x'\ne x^* if and only if CA+A⊤CCA+A^\top C is negative definite (C=diag(c)C=\mathrm{diag}(c)). (2) With Hw(z)=12∑wizi2H_w(z)=\tfrac12\sum w_iz_i^2 and z=x−x*z=x-x^*, find G(z)G(z) with z˙=G(z)∇Hw(z)\dot z=G(z)\nabla H_w(z), in terms of AA, WW, X*X^*, ZZ. (3) If such a cc exists, find w>0w>0 so that ddtHw(z(t))<0\frac{\d}{\d t}H_w(z(t))<0 whenever z(t)z(t) is in a punctured neighbourhood of 0.

    Hint

    Use vi=−∑jaijxj*v_i=-\sum_ja_{ij}x_j^* to rewrite Fi=xi(Az)iF_i=x_i(Az)_i. In (3), choose WW so that WX*=CWX^*=C.

    Solution

    (1) ∂L/∂xi=ci(1−xi*/xi)=cizi/xi\partial L/\partial x_i=c_i(1-x_i^*/x_i)=c_iz_i/x_i and Fi=xi(Az)iF_i=x_i(Az)_i, so L˙=∑icizi(Az)i=z⊤CAz=12z⊤(CA+A⊤C)z\dot L=\sum_ic_iz_i(Az)_i=z^\top CAz=\tfrac12z^\top(CA+A^\top C)z. As x′x' ranges over positive vectors other than x*x^*, zz ranges over a set containing a punctured ball around 0. A quadratic form is negative on a punctured ball if and only if it is negative definite (scale any nonzero vector into the ball); and negative definiteness gives L˙<0\dot L<0 for every z≠0z\ne0.

    (2) z˙i=x˙i=(xi*+zi)(Az)i\dot z_i=\dot x_i=(x_i^*+z_i)(Az)_i, and ∇Hw=Wz\nabla H_w=Wz, so z=W−1∇Hwz=W^{-1}\nabla H_w. Hence G(z)=(X*+Z)AW−1G(z)=(X^*+Z)AW^{-1}.

    (3) Take wi=ci/xi*w_i=c_i/x_i^*, so W=C(X*)−1W=C(X^*)^{-1}. Then ddtHw=∇Hw⊤G∇Hw=z⊤W(X*+Z)Az=z⊤CAz+z⊤C(X*)−1ZAz\frac{\d}{\d t}H_w=\nabla H_w^\top G\nabla H_w=z^\top W(X^*+Z)Az=z^\top CAz+z^\top C(X^*)^{-1}ZAz. The first term is ≤−μ‖z‖2\le-\mu\lVert z\rVert^2 with μ>0\mu>0 (half the smallest eigenvalue of −(CA+A⊤C)-(CA+A^\top C)); the second is O(‖z‖3)O(\lVert z\rVert^3). So the derivative is negative for small z≠0z\ne0.

    2025 Problem 2Allen–Cahn and phase separation

    (A): ut=u−u3+uxxu_t=u-u^3+u_{xx} on 0<x<L0<x<L, ux(t,0)=ux(t,L)=0u_x(t,0)=u_x(t,L)=0, u(0,x)=f(x)u(0,x)=f(x) with sup⁡|f|<1\sup|f|<1. (1) Show H(u)=∫0L(14u4−12u2+12ux2)dxH(u)=\int_0^L(\tfrac14u^4-\tfrac12u^2+\tfrac12u_x^2)\,\d x is non-increasing in tt. (2) For (B) ut=uxxu_t=u_{xx} with the same boundary and initial conditions, write u=∑kbkecktcos⁡(kπx/L)u=\sum_kb_ke^{c_kt}\cos(k\pi x/L); find bk,ckb_k,c_k and the limit as t→∞t\to\infty. (3) Solve (C) v′=v−v3v'=v-v^3, v(0)=av(0)=a, |a|<1|a|<1, and find the limit. (4) (i) Explain how (B), (C) and the monotonicity of HH bear on modelling phase separation. (ii) Sketch the evolution for |f|≪1|f|\ll1.

    Hint

    (1) Differentiate under the integral and integrate uxuxtu_xu_{xt} by parts. (3) Separate variables; partial fractions in 1/(v−v3)1/(v-v^3), or solve for v2v^2.

    Solution

    (1) dHdt=∫0L((u3−u)ut+uxuxt)dx=∫0L(u3−u−uxx)utdx+[uxut]0L=−∫0Lut2dx≤0\frac{\d H}{\d t}=\int_0^L\big((u^3-u)u_t+u_xu_{xt}\big)\d x=\int_0^L(u^3-u-u_{xx})u_t\,\d x+\big[u_xu_t\big]_0^L=-\int_0^Lu_t^2\,\d x\le0, since the boundary term vanishes by the Neumann condition.

    (2) Each term must solve (B): ck=−(kπ/L)2c_k=-(k\pi/L)^2. Matching t=0t=0 with the cosine series: b0=1L∫0Lfb_0=\frac1L\int_0^Lf, bk=2L∫0Lf(x)cos⁡(kπx/L)dxb_k=\frac2L\int_0^Lf(x)\cos(k\pi x/L)\,\d x for k≥1k\ge1. As t→∞t\to\infty, u→b0u\to b_0, the mean of ff.

    (3) ddt(v−2)=−2v′/v3=2−2v−2\frac{\d}{\d t}(v^{-2})=-2v'/v^3=2-2v^{-2} (for a≠0a\ne0), so v−2−1=(a−2−1)e−2tv^{-2}-1=(a^{-2}-1)e^{-2t}, giving v(t)=aet1−a2+a2e2tv(t)=\dfrac{ae^t}{\sqrt{1-a^2+a^2e^{2t}}} (also valid for a=0a=0). The limit is 11 if a>0a>0, −1-1 if a<0a<0, 00 if a=0a=0.

    (4)(i) Points to make: diffusion alone (B) mixes everything to the average, erasing structure. Reaction alone (C) pushes each point independently to a pure phase ±1\pm1 (0 is unstable), producing noise-scale fragments. In (A) they compete: HH is a double-well energy minimized by u=±1u=\pm1 plus a gradient cost, and the dynamics only lowers it, so the system settles into large regions of pure phase separated by thin smooth interfaces whose number is penalized by the gradient term. (ii) For |f|≪1|f|\ll1: an early linear stage where long-wave modes with (kπ/L)2<1(k\pi/L)^2<1 grow like e(1−(kπ/L)2)te^{(1-(k\pi/L)^2)t} and short ones decay; then saturation into plateaus at ±1\pm1 joined by tanh⁡\tanh-shaped interfaces of width about 2\sqrt2; then very slow coarsening as nearby interfaces annihilate (exponentially slow in one dimension). The space–time figure above is that sketch.

    2026 Problem 3An epidemic-type system

    x˙=−2xy, y˙=2xy−y\dot x=-2xy,\ \dot y=2xy-y, solutions unique and smooth. (1) Find every initial point for which the solution is constant. (2) If x(0),y(0)>0x(0),y(0)>0 and x(0)+y(0)=1x(0)+y(0)=1, show x,y≥0x,y\ge0 and x+y≤1x+y\le1 for t≥0t\ge0. (3) Under (2), can 12≤lim⁡x(t)<1\tfrac12\le\lim x(t)<1? (4) From (1,−1)(1,-1), show x(t)→∞x(t)\to\infty as t↑Tt\uparrow T for some finite T>0T>0.

    Hint

    (2) Write x(t)=x(0)exp⁡(−2∫0ty)x(t)=x(0)\exp(-2\int_0^ty). (4) On the conserved level through (1,−1)(1,-1), express yy in terms of xx and compare with x˙≥x2\dot x\ge x^2.

    Solution

    (1) −2xy=0-2xy=0 and y(2x−1)=0y(2x-1)=0. If y≠0y\ne0 the first forces x=0x=0, and then the second gives −y=0-y=0, a contradiction. So y=0y=0, and any xx works: the constant solutions start at (c,0)(c,0), c∈ℝc\in\R.

    (2) x(t)=x(0)e−2∫0ty>0x(t)=x(0)e^{-2\int_0^ty}>0 and y(t)=y(0)e∫0t(2x−1)>0y(t)=y(0)e^{\int_0^t(2x-1)}>0. Then ddt(x+y)=−y≤0\frac{\d}{\d t}(x+y)=-y\le0, so x+y≤1x+y\le1.

    (3) No; see the worked example: lim⁡x(t)<12\lim x(t)<\tfrac12 always.

    (4) y(t)=−e∫0t(2x−1)<0y(t)=-e^{\int_0^t(2x-1)}<0 for all tt, so x˙=−2xy>0\dot x=-2xy>0 while x>0x>0: xx increases from 1. H=x+y−12log⁡xH=x+y-\tfrac12\log x equals 00 at (1,−1)(1,-1), so y=12log⁡x−xy=\tfrac12\log x-x and x˙=x(2x−log⁡x)\dot x=x(2x-\log x). Since log⁡x≤x−1\log x\le x-1, 2x−log⁡x≥x+1>x2x-\log x\ge x+1>x, so x˙>x2\dot x>x^2 with x(0)=1x(0)=1, and x(t)≥1/(1−t)x(t)\ge1/(1-t). Hence the solution cannot exist on [0,1)[0,1) with xx finite: there is T≤1T\le1 with x(t)→∞x(t)\to\infty as t↑Tt\uparrow T. In fact T=∫1∞dxx(2x−log⁡x)≈0.5735T=\int_1^\infty\frac{\d x}{x(2x-\log x)}\approx0.5735.

    From Strogatz, Nonlinear Dynamics and Chaos (2nd ed., CRC Press)

    Exercise numbers match the book. Each is restated in our own words; the hints and solutions are written for this page.

    Exercise 6.5.6The epidemic model in the phase plane (2026 P3 with general rates)

    Healthy x≥0x\ge0 and sick y≥0y\ge0 evolve by x˙=−kxy\dot x=-kxy, y˙=kxy−ℓy\dot y=kxy-\ell y with k,ℓ>0k,\ell>0. (a) Find and classify the fixed points. (b) Sketch nullclines and the vector field. (c) Find a conserved quantity. (d) What happens as t→∞t\to\infty? (e) An epidemic occurs if yy increases at first. When does that happen?

    Hint

    (c) Form dy/dx\d y/\d x and separate variables. With k=2k=2, ℓ=1\ell=1 this is the exam's system.

    Solution

    (a) kxy=0kxy=0 and y(kx−ℓ)=0y(kx-\ell)=0 force y=0y=0: every point (x*,0)(x^*,0) is fixed, a whole line of them. The Jacobian there is (0−kx*0kx*−ℓ)\begin{pmatrix}0&-kx^*\\0&kx^*-\ell\end{pmatrix}, with eigenvalues 00 (along the line) and kx*−ℓkx^*-\ell. Points with x*<ℓ/kx^*<\ell/k attract nearby trajectories; points with x*>ℓ/kx^*>\ell/k repel them. Being non-isolated, none is a node or saddle in the usual sense.

    (b) x˙=0\dot x=0 on the axes; y˙=0\dot y=0 on y=0y=0 and on the vertical line x=ℓ/kx=\ell/k. In the open quadrant xx always decreases, and yy rises to the right of x=ℓ/kx=\ell/k and falls to the left.

    (c) dy/dx=−1+ℓ/(kx)\d y/\d x=-1+\ell/(kx), so E=kx+ky−ℓlog⁡xE=kx+ky-\ell\log x is conserved.

    (d) Every trajectory in the open quadrant ends on the line of fixed points at some x∞<ℓ/kx_\infty<\ell/k, with y→0y\to0: the argument of the worked example, with ℓ/k\ell/k in place of 12\tfrac12.

    (e) y˙(0)=y0(kx0−ℓ)>0\dot y(0)=y_0(kx_0-\ell)>0 exactly when x0>ℓ/kx_0>\ell/k: the epidemic threshold. In the exam's units, ℓ/k=12\ell/k=\tfrac12, which is why the gold line in the figure sits at x=12x=\tfrac12, and why 2026 P3(3) asks about [12,1)[\tfrac12,1).

    Exercise 2.5.2Blow-up without an exact solution

    Show that every solution of x˙=1+x10\dot x=1+x^{10} escapes to +∞+\infty in finite time.

    Hint

    Don't solve it. Compare with x˙=1+x2\dot x=1+x^2, whose solutions are shifted tangents.

    Solution

    Since x˙≥1\dot x\ge1, xx reaches the value 1 by time t1=max⁡(0,1−x0)t_1=\max(0,1-x_0). From then on x≥1x\ge1, so x10≥x2x^{10}\ge x^2 and x˙≥1+x2\dot x\ge1+x^2, i.e. ddtarctan⁡x≥1\frac{\d}{\d t}\arctan x\ge1. Hence arctan⁡x(t)≥π4+(t−t1)\arctan x(t)\ge\frac\pi4+(t-t_1), which reaches π2\frac\pi2 by t=t1+π4t=t_1+\frac\pi4: xx must blow up before then. This is the same comparison as 2026 P3(4), where x˙=x(2x−log⁡x)≥x2\dot x=x(2x-\log x)\ge x^2.

    Exercise 6.4.1Two competing species

    For x˙=x(3−x−y)\dot x=x(3-x-y), y˙=y(2−x−y)\dot y=y(2-x-y) with x,y≥0x,y\ge0, find and classify the fixed points and describe the long-run behaviour.

    Hint

    Look at ddtlog⁡(x/y)\frac{\d}{\d t}\log(x/y).

    Solution

    Fixed points: (0,0)(0,0), (3,0)(3,0), (0,2)(0,2); an interior one would need x+y=3x+y=3 and x+y=2x+y=2 at once. The Jacobian is (3−2x−y−x−y2−x−2y)\begin{pmatrix}3-2x-y&-x\\-y&2-x-2y\end{pmatrix}. At (0,0)(0,0): eigenvalues 3, 2, an unstable node. At (3,0)(3,0): (−3−30−1)\begin{pmatrix}-3&-3\\0&-1\end{pmatrix}, eigenvalues −3,−1-3,-1, a stable node. At (0,2)(0,2): (10−2−2)\begin{pmatrix}1&0\\-2&-2\end{pmatrix}, eigenvalues 1,−21,-2, a saddle.

    Globally, for x,y>0x,y>0, ddtlog⁡(x/y)=(3−x−y)−(2−x−y)=1\frac{\d}{\d t}\log(x/y)=(3-x-y)-(2-x-y)=1, so y/x→0y/x\to0 exponentially: yy is driven out and every trajectory with x(0)>0x(0)>0 tends to (3,0)(3,0). (Competitive exclusion; 2023 P2 is the general Lotka–Volterra system, where Volterra's function LL plays the role this ratio plays here.)

    Exercise 7.2.10A Lyapunov function rules out cycles

    Show that x˙=y−x3\dot x=y-x^3, y˙=−x−y3\dot y=-x-y^3 has no closed orbits, by finding V=ax2+by2V=ax^2+by^2 that decreases along trajectories.

    Solution

    V˙=2ax(y−x3)+2by(−x−y3)=2(a−b)xy−2ax4−2by4\dot V=2ax(y-x^3)+2by(-x-y^3)=2(a-b)xy-2ax^4-2by^4. With a=b=1a=b=1 the cross term cancels and V˙=−2(x4+y4)<0\dot V=-2(x^4+y^4)<0 away from the origin. On a closed orbit VV would return to its starting value after one period, but it strictly decreases: impossible. In fact the origin is globally asymptotically stable. Note that linearization alone says nothing here: the Jacobian at the origin has eigenvalues ±i\pm i.

    Exercise 7.2.11When is a quadratic form a valid Lyapunov candidate?

    Show that V=ax2+2bxy+cy2V=ax^2+2bxy+cy^2 is positive definite if and only if a>0a>0 and ac−b2>0ac-b^2>0.

    Solution

    If a≤0a\le0, V(1,0)=a≤0V(1,0)=a\le0. If a>0a>0, complete the square: V=a(x+bay)2+ac−b2ay2V=a\big(x+\tfrac bay\big)^2+\tfrac{ac-b^2}a\,y^2, positive for all (x,y)≠0(x,y)\ne0 exactly when ac−b2>0ac-b^2>0. This is the 2×22\times2 case of the leading-minor test for (abbc)≻O\begin{pmatrix}a&b\\b&c\end{pmatrix}\succ O, the matrix fact behind 2023 P2(1) (see module 2).

    Interactive2024 P2; also 2024 P1, 2026 P1; Boyd and Vandenberghe Ch. 2, 3, 5, 8

    Optimization and acceleration

    Convergence proofs for first-order methods follow one template: write down an energy that mixes the gap f(x)−f*f(x)-f^* with a distance to the optimum, show it never increases, and read off the rate from the weight on the gap. 2024 P2 does exactly this, first in continuous time and then for a discretization.

    The idea

    Convexity, first order (BV (3.2), §3.1.3). A differentiable ff is convex if and only if f(y)≥f(x)+∇f(x)⊤(y−x)f(y)\ge f(x)+\nabla f(x)^\top(y-x) for all x,yx,y. With y=x*y=x^*: f(x)−f*≤∇f(x)⊤(x−x*)f(x)-f^*\le\nabla f(x)^\top(x-x^*). This single inequality closes most rate proofs.
    Rates. For convex ff with LL-Lipschitz gradient, gradient descent with step 1/L1/L has f(xk)−f*≤L‖x0−x*‖2/(2k)f(x_k)-f^*\le L\lVert x_0-x^*\rVert^2/(2k). Nesterov's accelerated method, yk=xk+k−1k+2(xk−xk−1)y_k=x_k+\frac{k-1}{k+2}(x_k-x_{k-1}), xk+1=yk−1L∇f(yk)x_{k+1}=y_k-\frac1L\nabla f(y_k), achieves O(1/k2)O(1/k^2), which is optimal for first-order methods in this class.

    The continuous-time picture. Letting the step size shrink, Nesterov's method tracks x¨+3tx˙+∇f(x)=0\ddot x+\frac3t\dot x+\nabla f(x)=0 (Su, Boyd and Candès). 2024 P2 writes a shifted version as a first-order system in (x,v)(x,v) with x˙=2t+1(v−x)\dot x=\frac2{t+1}(v-x) and v˙=−t+12∇f(x)\dot v=-\frac{t+1}2\nabla f(x), and the energy E(t)=(t+1)2(f(x)−f*)+2‖v−x*‖2E(t)=(t+1)^2(f(x)-f^*)+2\lVert v-x^*\rVert^2. The growing weight (t+1)2(t+1)^2 on the gap is the rate.

    Discrete energies. For sequences, δ+y(k)=(y(k+1)−y(k))/h\delta^+y^{(k)}=(y^{(k+1)}-y^{(k)})/h obeys a product rule δ+(a(k)b(k))=(δ+a(k))b(k+1)+a(k)δ+b(k)\delta^+(a^{(k)}b^{(k)})=(\delta^+a^{(k)})b^{(k+1)}+a^{(k)}\delta^+b^{(k)} and δ+‖y(k)‖2=2y(k+1)⊤δ+y(k)−h‖δ+y(k)‖2\delta^+\lVert y^{(k)}\rVert^2=2y^{(k+1)\top}\delta^+y^{(k)}-h\lVert\delta^+y^{(k)}\rVert^2. The extra −h‖⋅‖2-h\lVert\cdot\rVert^2 is a gift: it has the right sign.
    Proximal gradient. For f+gf+g with ff smooth and gg convex but maybe not smooth, iterate xk+1=proxγg(xk−γ∇f(xk))x_{k+1}=\mathrm{prox}_{\gamma g}(x_k-\gamma\nabla f(x_k)), where proxγg(y)=arg⁡minu⁡(g(u)+12γ‖u−y‖2)\mathrm{prox}_{\gamma g}(y)=\arg\min_u\big(g(u)+\frac1{2\gamma}\lVert u-y\rVert^2\big). For g=λ‖⋅‖1g=\lambda\lVert\cdot\rVert_1 the prox is soft-thresholding; for gg the indicator of a convex set it is the projection (for the PSD cone, the ϕ\phi of 2026 P1, which Boyd and Vandenberghe state in §8.1.1, p. 399).
    Linear programming duality (BV §5.2.1, Exercise 5.23). For max⁡{c⊤x:Ax≤b, x≥0}\max\{c^\top x:Ax\le b,\ x\ge0\} the dual is min⁡{b⊤y:A⊤y≥c, y≥0}\min\{b^\top y:A^\top y\ge c,\ y\ge0\}. Weak duality c⊤x≤b⊤yc^\top x\le b^\top y is one line; strong duality says the optima are equal when either is finite, and complementary slackness y⊤(b−Ax)=0=x⊤(A⊤y−c)y^\top(b-Ax)=0=x^\top(A^\top y-c) characterizes optimal pairs. The max-flow min-cut theorem and the minimum-cost flow optimality conditions are special cases.

    Explore

    gradient descent (dashed, a dot every 10 steps) Nesterov, both with step 1/L1/L. Drag the start.
    f(xk)−f*f(x_k)-f^* against kk on log–log axes. Dashed guides have slopes −1-1 and −2-2.

    Worked example

    2024 P2(1): show E˙≤0\dot E\le0 for E(t)=(t+1)2(f(x)−f*)+2‖v−x*‖2E(t)=(t+1)^2(f(x)-f^*)+2\lVert v-x^*\rVert^2, then deduce f(x(t))−f*≤C/t2f(x(t))-f^*\le C/t^2.

    1. Differentiate each term of EE.

      E˙=2(t+1)(f−f*)+(t+1)2∇f⊤x˙+4(v−x*)⊤v˙\dot E=2(t+1)(f-f^*)+(t+1)^2\nabla f^\top\dot x+4(v-x^*)^\top\dot v.

    2. Substitute the dynamics.

      (t+1)2∇f⊤x˙=2(t+1)∇f⊤(v−x)(t+1)^2\nabla f^\top\dot x=2(t+1)\nabla f^\top(v-x) and 4(v−x*)⊤v˙=−2(t+1)∇f⊤(v−x*)4(v-x^*)^\top\dot v=-2(t+1)\nabla f^\top(v-x^*). The vv terms cancel: E˙=2(t+1)[f(x)−f*−∇f(x)⊤(x−x*)]\dot E=2(t+1)\big[f(x)-f^*-\nabla f(x)^\top(x-x^*)\big].

    3. Finish with convexity.

      The bracket is ≤0\le0 by f*≥f(x)+∇f(x)⊤(x*−x)f^*\ge f(x)+\nabla f(x)^\top(x^*-x). So E(t)≤E(0)E(t)\le E(0), and f(x(t))−f*≤E(0)/(t+1)2≤E(0)/t2f(x(t))-f^*\le E(0)/(t+1)^2\le E(0)/t^2: take C=E(0)=f(x(0))−f*+2‖v(0)−x*‖2C=E(0)=f(x(0))-f^*+2\lVert v(0)-x^*\rVert^2.

    Check your understanding

    In the proof above, which property of ff was used?

    1. Convexity, in the form f(x*)≥f(x)+∇f(x)⊤(x*−x)f(x^*)\ge f(x)+\nabla f(x)^\top(x^*-x)
    2. Strong convexityNot assumed; with it you would get a linear rate.
    3. A Lipschitz gradientNeeded for discrete step-size choices in general, but not in the continuous-time argument.
    The energy method needs only that one inequality. In the discrete part (2), convexity is used twice: once between x(k)x^{(k)} and x(k+1)x^{(k+1)}, once between x(k+1)x^{(k+1)} and x*x^*.

    What is the guaranteed rate of plain gradient descent (step 1/L1/L) on an LL-smooth convex function?

    1. O(1/k)O(1/k)
    2. O(1/k2)O(1/k^2)That is the accelerated rate.
    3. Linear, O(ρk)O(\rho^k)Only with strong convexity, and then the rate depends on the condition number: compare large and small κ in the figure.
    Without strong convexity the gap decays like 1/k1/k for gradient descent and 1/k21/k^2 for Nesterov, and no first-order method can beat 1/k21/k^2 in general.

    What is proxγλ|⋅|(y)\mathrm{prox}_{\gamma\lambda|\cdot|}(y) for y∈ℝy\in\R?

    1. sign(y)max⁡(|y|−γλ,0)\mathrm{sign}(y)\max(|y|-\gamma\lambda,0)
    2. y/(1+γλ)y/(1+\gamma\lambda)That is the prox of λ2y2\frac\lambda2y^2.
    3. max⁡(y,0)\max(y,0)That is projection onto [0,∞)[0,\infty), the prox of its indicator.
    Minimize λ|u|+12γ(u−y)2\lambda|u|+\frac1{2\gamma}(u-y)^2: the optimality condition 0∈λ∂|u|+(u−y)/γ0\in\lambda\,\partial|u|+(u-y)/\gamma gives soft-thresholding. Proximal gradient with this prox is ISTA for the lasso.

    Practice

    Past problem

    Restated in our own words. Official statement: 2024. 2024 P1 and 2026 P1 are optimization problems too; they are worked in module 2.

    2024 Problem 2Accelerated gradient as a differential equation

    ff is smooth and convex on ℝd\R^d with a minimizer x*x^*. (1) For the system above, show E˙≤0\dot E\le0 and f(x(t))−f*≤C/t2f(x(t))-f^*\le C/t^2. (2) Discretize as δ+x(k)=2hk+h+2(hk+1)2(v(k+1)−x(k+1))\delta^+x^{(k)}=\frac{2hk+h+2}{(hk+1)^2}(v^{(k+1)}-x^{(k+1)}), δ+v(k)=−2hk+h+24∇f(x(k+1))\delta^+v^{(k)}=-\frac{2hk+h+2}4\nabla f(x^{(k+1)}), with E(k)=(hk+1)2(f(x(k))−f*)+2‖v(k)−x*‖2E^{(k)}=(hk+1)^2(f(x^{(k)})-f^*)+2\lVert v^{(k)}-x^*\rVert^2. Show δ+‖v(k)−x*‖2=2(v(k+1)−x*)⊤δ+v(k)−h‖δ+v(k)‖2\delta^+\lVert v^{(k)}-x^*\rVert^2=2(v^{(k+1)}-x^*)^\top\delta^+v^{(k)}-h\lVert\delta^+v^{(k)}\rVert^2 and δ+E(k)≤0\delta^+E^{(k)}\le0. (3) Show f(x(k))−f*≤C′/k2f(x^{(k)})-f^*\le C'/k^2.

    Hint

    Write sk=2hk+h+2s_k=2hk+h+2 and Ak=(hk+1)2A_k=(hk+1)^2. Then δ+Ak=sk\delta^+A_k=s_k: the coefficient in the scheme is the discrete derivative of the weight. Use the product rule with a=Aa=A, b=f(x(k))−f*b=f(x^{(k)})-f^*.

    Solution

    (1) The worked example.

    (2) With a=v(k+1)−x*a=v^{(k+1)}-x^*, b=v(k)−x*b=v^{(k)}-x^*: ‖a‖2−‖b‖2=2a⊤(a−b)−‖a−b‖2\lVert a\rVert^2-\lVert b\rVert^2=2a^\top(a-b)-\lVert a-b\rVert^2. Divide by hh and use a−b=hδ+v(k)a-b=h\,\delta^+v^{(k)}.

    Now (h(k+1)+1)2−(hk+1)2=h(2hk+h+2)(h(k+1)+1)^2-(hk+1)^2=h(2hk+h+2), so δ+Ak=sk\delta^+A_k=s_k. Write Dk=f(x(k))−f*D_k=f(x^{(k)})-f^* and g=∇f(x(k+1))g=\nabla f(x^{(k+1)}). The product rule gives δ+E(k)=skDk+1+Akδ+Dk+4(v(k+1)−x*)⊤δ+v(k)−2h‖δ+v(k)‖2\delta^+E^{(k)}=s_kD_{k+1}+A_k\,\delta^+D_k+4(v^{(k+1)}-x^*)^\top\delta^+v^{(k)}-2h\lVert\delta^+v^{(k)}\rVert^2.

    • Convexity between x(k)x^{(k)} and x(k+1)x^{(k+1)}: f(x(k))≥f(x(k+1))+g⊤(x(k)−x(k+1))f(x^{(k)})\ge f(x^{(k+1)})+g^\top(x^{(k)}-x^{(k+1)}), so δ+Dk≤g⊤δ+x(k)=skAkg⊤(v(k+1)−x(k+1))\delta^+D_k\le g^\top\delta^+x^{(k)}=\frac{s_k}{A_k}g^\top(v^{(k+1)}-x^{(k+1)}).
    • The vv update: 4(v(k+1)−x*)⊤δ+v(k)=−skg⊤(v(k+1)−x*)4(v^{(k+1)}-x^*)^\top\delta^+v^{(k)}=-s_kg^\top(v^{(k+1)}-x^*).

    Adding, the v(k+1)v^{(k+1)} terms cancel: δ+E(k)≤sk[f(x(k+1))−f*−g⊤(x(k+1)−x*)]−2h‖δ+v(k)‖2≤0\delta^+E^{(k)}\le s_k\big[f(x^{(k+1)})-f^*-g^\top(x^{(k+1)}-x^*)\big]-2h\lVert\delta^+v^{(k)}\rVert^2\le0, by convexity between x(k+1)x^{(k+1)} and x*x^*.

    (3) E(k)≤E(0)E^{(k)}\le E^{(0)}, so f(x(k))−f*≤E(0)/(hk+1)2≤E(0)/(h2k2)f(x^{(k)})-f^*\le E^{(0)}/(hk+1)^2\le E^{(0)}/(h^2k^2). Take C′=E(0)/h2C'=E^{(0)}/h^2.

    Fresh practiceThe dual of a transportation LP

    Supplies ai≥0a_i\ge0 at sources ii, demands bj≥0b_j\ge0 at sinks jj with ∑ai=∑bj\sum a_i=\sum b_j, and costs cijc_{ij}. Write the LP for the cheapest shipment xij≥0x_{ij}\ge0, its dual, and the complementary slackness conditions. Interpret the dual variables.

    Solution

    Primal: minimize ∑cijxij\sum c_{ij}x_{ij} subject to ∑jxij=ai\sum_jx_{ij}=a_i, ∑ixij=bj\sum_ix_{ij}=b_j, x≥0x\ge0. Dual: maximize ∑iaiui+∑jbjvj\sum_ia_iu_i+\sum_jb_jv_j subject to ui+vj≤ciju_i+v_j\le c_{ij} (free u,vu,v, because the primal constraints are equalities). Complementary slackness: xij>0⇒ui+vj=cijx_{ij}>0\Rightarrow u_i+v_j=c_{ij}. Read −ui-u_i as the price paid to pick up a unit at ii and vjv_j as the price it fetches at jj: goods only travel on routes where the price difference exactly covers the cost. This is the 1D picture behind optimal transport and the minimum-cost flow optimality conditions.

    From Boyd and Vandenberghe, Convex Optimization (Cambridge, 2004)

    Exercise numbers match the book (freely available from the authors). Each is restated in our own words; the hints and solutions are written for this page. The book covers gradient descent (§9.3) but not acceleration, which is why 2024 P2 is worth working on its own terms.

    Exercise 8.1Projections onto closed convex sets are unique

    Let C⊆ℝnC\subseteq\R^n be nonempty, closed and convex. Show that every x0x_0 has exactly one nearest point of CC in the Euclidean norm.

    Hint

    Existence: compactness. Uniqueness: the midpoint of two nearest points, and the parallelogram law.

    Solution

    Pick any c∈Cc\in C. The nearest point, if any, lies in C∩{x:‖x−x0‖≤‖c−x0‖}C\cap\{x:\lVert x-x_0\rVert\le\lVert c-x_0\rVert\}, which is closed and bounded, hence compact, and ‖x−x0‖\lVert x-x_0\rVert is continuous: a minimizer exists. If x≠yx\ne y both attain the minimum distance dd, then m=x+y2∈Cm=\frac{x+y}2\in C by convexity, and the parallelogram law gives ‖m−x0‖2=d2+d22−‖x−y‖24<d2\lVert m-x_0\rVert^2=\frac{d^2+d^2}2-\frac{\lVert x-y\rVert^2}4<d^2, a contradiction. With matrices and ⟨A,B⟩=tr(AB)\langle A,B\rangle=\mathrm{tr}(AB) in place of ℝn\R^n, this is the existence and uniqueness half of 2026 P1(2).

    Exercise 8.3 (a, b)Projections onto the orthant and the PSD cone

    (a) Show that the Euclidean projection of x0x_0 onto ℝ+n\R^n_+ replaces each negative entry by 0. (b) Show that the Frobenius projection of a symmetric X0=∑iλivivi⊤X_0=\sum_i\lambda_iv_iv_i^\top onto the PSD cone is ∑imax⁡(λi,0)vivi⊤\sum_i\max(\lambda_i,0)v_iv_i^\top.

    Hint

    (a) The problem separates coordinate by coordinate. (b) The Frobenius norm doesn't change under X↦Q⊤XQX\mapsto Q^\top XQ with QQ orthogonal; reduce to (a) on the diagonal.

    Solution

    (a) ‖x−x0‖2=∑k(xk−x0k)2\lVert x-x_0\rVert^2=\sum_k(x_k-x_{0k})^2, and each term is minimized over xk≥0x_k\ge0 at xk=max⁡(x0k,0)x_k=\max(x_{0k},0). (b) Exactly the argument of 2026 P1(2): in the eigenbasis of X0X_0, off-diagonal entries only add to the distance and the diagonal is problem (a). Part (a) also explains the variational inequality there: x0−P(x0)x_0-P(x_0) is the negative part of x0x_0, which is orthogonal to P(x0)P(x_0) and has non-positive inner product with every point of the orthant.

    Exercise 2.28The PSD cone in coordinates

    Describe 𝕊+n\mathbb S^n_+ by inequalities on the entries for n=1,2,3n=1,2,3, writing a general element as x1x_1, (x1x2x2x3)\begin{pmatrix}x_1&x_2\\x_2&x_3\end{pmatrix} and (x1x2x3x2x4x5x3x5x6)\begin{pmatrix}x_1&x_2&x_3\\x_2&x_4&x_5\\x_3&x_5&x_6\end{pmatrix}.

    Hint

    A symmetric matrix is PSD if and only if all principal minors are non-negative (leading ones are not enough for semidefiniteness).

    Solution

    n=1n=1: x1≥0x_1\ge0. n=2n=2: x1≥0x_1\ge0, x3≥0x_3\ge0, x1x3≥x22x_1x_3\ge x_2^2. n=3n=3: x1,x4,x6≥0x_1,x_4,x_6\ge0; x1x4≥x22x_1x_4\ge x_2^2, x1x6≥x32x_1x_6\ge x_3^2, x4x6≥x52x_4x_6\ge x_5^2; and det⁡≥0\det\ge0. For n=2n=2 the cone is a round cone in (x1,x2,x3)(x_1,x_2,x_3)-space (x1x3≥x22x_1x_3\ge x_2^2 with x1+x3≥0x_1+x_3\ge0), which is why the ellipse picture in module 2 works: each interior point of this cone is an ellipse. Only checking the leading minors x1≥0x_1\ge0, x1x3−x22≥0x_1x_3-x_2^2\ge0 would wrongly admit diag(0,−1)\mathrm{diag}(0,-1).

    Exercise 5.4The LP dual as the best bound from a single inequality

    For the LP min⁡{c⊤x:Ax⪯b}\min\{c^\top x:Ax\preceq b\} and any w⪰0w\succeq0, every feasible xx satisfies w⊤Ax≤w⊤bw^\top Ax\le w^\top b. (a) Find min⁡{c⊤x:w⊤Ax≤w⊤b}\min\{c^\top x:w^\top Ax\le w^\top b\}. (b) Write the problem of choosing ww to make this lower bound as large as possible. (c) Compare with the Lagrange dual.

    Solution

    (a) Minimizing a linear function over a half-space is −∞-\infty unless cc points out of it: unless c=−λA⊤wc=-\lambda A^\top w for some λ≥0\lambda\ge0. Then c⊤x=−λw⊤Ax≥−λw⊤bc^\top x=-\lambda w^\top Ax\ge-\lambda w^\top b, with equality on the boundary, so the minimum is −λw⊤b-\lambda w^\top b. (b) Maximize −λw⊤b-\lambda w^\top b over w⪰0w\succeq0, λ≥0\lambda\ge0 with c=−λA⊤wc=-\lambda A^\top w. (c) Put z=λwz=\lambda w: maximize −b⊤z-b^\top z subject to A⊤z+c=0A^\top z+c=0, z⪰0z\succeq0. That is the Lagrange dual (BV (5.22)). Duality is "the best lower bound you can get by adding up constraints with non-negative weights", the same reasoning as the worked example in module 10.

    Exercise 5.5The dual of a general LP

    Find the dual function and dual problem of min⁡{c⊤x:Gx⪯h, Ax=b}\min\{c^\top x:Gx\preceq h,\ Ax=b\}, with the implicit constraints made explicit.

    Solution

    L(x,λ,ν)=c⊤x+λ⊤(Gx−h)+ν⊤(Ax−b)=(c+G⊤λ+A⊤ν)⊤x−h⊤λ−b⊤νL(x,\lambda,\nu)=c^\top x+\lambda^\top(Gx-h)+\nu^\top(Ax-b)=(c+G^\top\lambda+A^\top\nu)^\top x-h^\top\lambda-b^\top\nu. Minimizing over xx: g(λ,ν)=−h⊤λ−b⊤νg(\lambda,\nu)=-h^\top\lambda-b^\top\nu if c+G⊤λ+A⊤ν=0c+G^\top\lambda+A^\top\nu=0, and −∞-\infty otherwise. Dual: maximize −h⊤λ−b⊤ν-h^\top\lambda-b^\top\nu subject to G⊤λ+A⊤ν+c=0G^\top\lambda+A^\top\nu+c=0, λ⪰0\lambda\succeq0. Inequality constraints get sign-constrained multipliers; equalities get free ones, which is the pattern behind the transportation dual above.

    Interactive2023 P1, 2023 P3, 2024 P3, 2025 P3; Stein and Shakarchi Ch. 2–3

    Analysis: approximation and integrals

    The analysis problems are about numerical mathematics seen through classical tools: how fast a quadrature rule converges and why, what fast approximation says about smoothness, and how a change of variables turns a question about densities into one about convex functions.

    The idea

    Residue theorem (Stein–Shakarchi Ch. 3, Theorem 2.1 and its corollaries). If gg is holomorphic inside and on a simple closed positively oriented curve Γ\Gamma except for isolated poles zkz_k inside, then ∮Γgdz=2πi∑kReszkg\oint_\Gamma g\,\d z=2\pi i\sum_k\mathrm{Res}_{z_k}g. At a simple pole of p/qp/q with q(zk)=0≠q′(zk)q(z_k)=0\ne q'(z_k), the residue is p(zk)/q′(zk)p(z_k)/q'(z_k); at a pole of order nn, use the derivative formula of Ch. 3, Theorem 1.4. The Cauchy inequalities (Ch. 2, Corollary 4.3), |f(n)(z0)|≤n!‖f‖C/Rn|f^{(n)}(z_0)|\le n!\,\lVert f\rVert_C/R^n, bound Taylor coefficients by ‖f‖R−n\lVert f\rVert R^{-n}, which is the other route to the trapezoid bound below.

    Parametrize the circle. On |z|=1|z|=1, z=eiθz=e^{i\theta} and dθ=−idz/z\d\theta=-i\,\d z/z, so ∫02πf(eiθ)dθ=∮−izf(z)dz\int_0^{2\pi}f(e^{i\theta})\d\theta=\oint\frac{-i}zf(z)\,\d z. Since zN−1zN−1\frac{z^{N-1}}{z^N-1} has simple poles of residue 1N\frac1N at the NN-th roots of unity, the equally weighted sum 2πN∑kf(e2πik/N)\frac{2\pi}N\sum_kf(e^{2\pi ik/N}) is also a contour integral. Subtracting the two and pushing the contour out to radius R<rR<r gives an error of order R−NR^{-N}: the trapezoid rule converges geometrically for periodic analytic integrands.

    Trigonometric polynomials. Bernstein's inequality: a trigonometric polynomial tt of degree nn has ‖t′‖∞≤n‖t‖∞\lVert t'\rVert_\infty\le n\lVert t\rVert_\infty. So if ff is approximated within c/n3c/n^3 by degree-nn ones, consecutive differences are O(n−3)O(n^{-3}), their derivatives O(n−2)O(n^{-2}), and the derivatives converge. Fast approximation implies smoothness (the converse direction to Jackson's theorem).
    Limits and derivatives. If tn→ft_n\to f uniformly and tn′→st_n'\to s uniformly with ss continuous, then ff is differentiable with f′=sf'=s. Proof: pass to the limit in tn(θ)−tn(0)=∫0θtn′t_n(\theta)-t_n(0)=\int_0^\theta t_n', then use the fundamental theorem of calculus.
    Quantile functions. If f>0f>0 is a density on (a,b)(a,b) with distribution function FF, then Q=F−1Q=F^{-1} satisfies Q′(u)=1/f(Q(u))Q'(u)=1/f(Q(u)), the mean is ∫01Q(u)du\int_0^1Q(u)\,\d u, and the median is Q(12)Q(\tfrac12). So "mean minus median" is ∫01/2(Q(12+v)+Q(12−v)−2Q(12))dv\int_0^{1/2}\big(Q(\tfrac12+v)+Q(\tfrac12-v)-2Q(\tfrac12)\big)\d v, which is positive whenever QQ is strictly convex, i.e. whenever ff is strictly decreasing.
    Exchanging limits. 2023 P1(3) takes n→∞n\to\infty and then m→∞m\to\infty. Each limit is a Riemann sum of a continuous function; say so explicitly rather than exchanging silently.

    Explore

    log10⁡|I(f)−IN(f)|\log_{10}|I(f)-I_N(f)| against NN. A straight line on this plot is geometric convergence. actual error prediction (for 1/(a−z)1/(a-z) the two coincide)
    Integrand on the unit circle

    Worked example

    2023 P3(4): show the constant 2π2\pi in |I(f)−IN(f)|≤2π‖f‖rN−1|I(f)-I_N(f)|\le\dfrac{2\pi\lVert f\rVert}{r^N-1} cannot be improved, i.e. lim supN⁡(rNsupf⁡|I(f)−IN(f)|/‖f‖)=2π\limsup_N\big(r^N\sup_f|I(f)-I_N(f)|/\lVert f\rVert\big)=2\pi.

    1. Which simple ff does the NN-point rule get completely wrong?

      f(z)=zNf(z)=z^N. Its integral over the circle is I=∫02πeiNθdθ=0I=\int_0^{2\pi}e^{iN\theta}\d\theta=0, but at every node zN=1z^N=1, so IN=2πI_N=2\pi. The error is 2π2\pi.

    2. Compute the ratio for this ff.

      ‖f‖=sup|z|<r⁡|z|N=rN\lVert f\rVert=\sup_{|z|<r}|z|^N=r^N, so rN|I−IN|/‖f‖=2πr^N|I-I_N|/\lVert f\rVert=2\pi. Hence the sup is at least 2π2\pi for every NN.

    3. Combine with the upper bound.

      From (3), the quantity is at most 2πrN/(rN−1)→2π2\pi r^N/(r^N-1)\to2\pi. With the lower bound 2π2\pi, the limsup (in fact the limit) is 2π2\pi.

    Check your understanding

    The NN-point trapezoid rule on the circle is exact for zkz^k exactly when:

    1. kk is not a nonzero multiple of NN
    2. |k|≤N|k|\le Nk=Nk=N is the worst case: error 2π2\pi.
    3. alwaysThe nodes can't tell zNz^N from the constant 1.
    1N∑j=1Nωjk\frac1N\sum_{j=1}^N\omega^{jk} is 1 if N|kN\mid k and 0 otherwise. This aliasing is the whole error: for f=∑akzkf=\sum a_kz^k, IN−I=2π∑m≥1amNI_N-I=2\pi\sum_{m\ge1}a_{mN}, and |amN|≤‖f‖r−mN|a_{mN}|\le\lVert f\rVert r^{-mN} by Cauchy's estimate, which is another proof of the bound.

    If ‖f−tn‖≤c/n3\lVert f-t_n\rVert\le c/n^3 for trigonometric polynomials tnt_n of degree nn, what can you conclude?

    1. ff is continuously differentiable
    2. ff is analyticAnalyticity needs geometric rates ρn\rho^n, not polynomial ones.
    3. Nothing beyond continuityBernstein's inequality converts the approximation rate into control of derivatives.
    This is 2024 P3. The same argument gives C1C^1 from any rate n−2−εn^{-2-\varepsilon}: after multiplying by nn it is still summable.

    A density is strictly decreasing on (a,b)(a,b). How do its mean and median compare?

    1. mean > median
    2. mean < medianThe long tail is on the right.
    3. It depends on the density2025 P3(3) proves the strict inequality in general.
    Q′=1/f(Q)Q'=1/f(Q) increases, so QQ is strictly convex and its average exceeds its middle value. The converse needs more: 2025 P3(1) has mean 34\tfrac34 above median 23\tfrac23 for a density that isn't decreasing, which is why part (4) asks about every sub-interval.

    Practice

    Past problems

    Restated in our own words. Official statements: 2023, 2024, 2025.

    2023 Problem 1A log-average dissimilarity

    For finite real sequences A={ai}i=1mA=\{a_i\}_{i=1}^m, B={bj}j=1nB=\{b_j\}_{j=1}^n, let f(A,B)=ln⁡(1m∑i1Ki)f(A,B)=\ln\Big(\frac1m\sum_i\frac1{K_i}\Big) with Ki=1n∑je−|ai−bj|K_i=\frac1n\sum_je^{-|a_i-b_j|}. (1) Show f≥0f\ge0 and find when f=0f=0. (2) Show f(A,C)≤f(A,B)+f(B,C)f(A,C)\le f(A,B)+f(B,C). (3) With Am(s)={s+i/m}A_m(s)=\{s+i/m\}, Bn={j/n}B_n=\{j/n\}, find hh with g(s)=limm⁡limn⁡f(Am(s),Bn)=ln⁡∫s1+sdzh(z)g(s)=\lim_m\lim_nf(A_m(s),B_n)=\ln\int_s^{1+s}\frac{\d z}{h(z)}. (4) Find the ss minimizing gg.

    Hint

    (2) e−|a−c|≥e−|a−b|e−|b−c|e^{-|a-c|}\ge e^{-|a-b|}e^{-|b-c|} gives, for every jj, 1KiAC≤e|ai−bj|KjBC\frac1{K^{AC}_i}\le\frac{e^{|a_i-b_j|}}{K^{BC}_j}. Average this over jj with weights proportional to e−|ai−bj|e^{-|a_i-b_j|}. (4) hh is symmetric about 12\tfrac12.

    Solution

    (1) 0<Ki≤10<K_i\le1, so each 1/Ki≥11/K_i\ge1 and f≥ln⁡1=0f\ge\ln1=0. Equality needs every Ki=1K_i=1, i.e. ai=bja_i=b_j for all i,ji,j: all entries of AA and BB are one common number. Conversely that gives f=0f=0.

    (2) Write KiABK^{AB}_i, KjBCK^{BC}_j, KiACK^{AC}_i for the three averages. For each jj, KiAC=1p∑le−|ai−cl|≥e−|ai−bj|KjBCK^{AC}_i=\frac1p\sum_le^{-|a_i-c_l|}\ge e^{-|a_i-b_j|}K^{BC}_j, so 1/KiAC≤e|ai−bj|/KjBC1/K^{AC}_i\le e^{|a_i-b_j|}/K^{BC}_j. Average over jj with weights qj=e−|ai−bj|/(nKiAB)q_j=e^{-|a_i-b_j|}/(nK^{AB}_i), which sum to 1: 1KiAC≤∑jqje|ai−bj|KjBC=1KiAB⋅1n∑j1KjBC\frac1{K^{AC}_i}\le\sum_jq_j\frac{e^{|a_i-b_j|}}{K^{BC}_j}=\frac1{K^{AB}_i}\cdot\frac1n\sum_j\frac1{K^{BC}_j}. Averaging over ii gives ef(A,C)≤ef(A,B)ef(B,C)e^{f(A,C)}\le e^{f(A,B)}e^{f(B,C)}.

    (3) As n→∞n\to\infty, KiK_i is a Riemann sum for h(ai)=∫01e−|ai−y|dyh(a_i)=\int_0^1e^{-|a_i-y|}\d y. Then the outer average is a Riemann sum for ∫01duh(s+u)\int_0^1\frac{\d u}{h(s+u)} (hh is continuous and positive). So h(z)=2−e−z−ez−1h(z)=2-e^{-z}-e^{z-1} for 0≤z≤10\le z\le1, h(z)=(1−e−1)ezh(z)=(1-e^{-1})e^z for z<0z<0, and h(z)=(1−e−1)e1−zh(z)=(1-e^{-1})e^{1-z} for z>1z>1.

    (4) G(s)=∫ss+1dz/h(z)G(s)=\int_s^{s+1}\d z/h(z) has G′(s)=1/h(s+1)−1/h(s)G'(s)=1/h(s+1)-1/h(s). Since h(z)=h(1−z)h(z)=h(1-z) and hh strictly increases on (−∞,12](-\infty,\tfrac12], G′<0G'<0 for s<0s<0 and G′>0G'>0 for s>0s>0 (the endpoint closer to 12\tfrac12 has the larger hh). The minimizer is s=0s=0: the sequences overlap exactly.

    2023 Problem 3The trapezoid rule for analytic functions

    For r>1r>1, ff holomorphic on Dr={|z|<r}D_r=\{|z|<r\}, ‖f‖=supDr⁡|f|\lVert f\rVert=\sup_{D_r}|f|, I(f)=∫02πf(eiθ)dθI(f)=\int_0^{2\pi}f(e^{i\theta})\d\theta and IN(f)=2πN∑k=1Nf(e2πik/N)I_N(f)=\frac{2\pi}N\sum_{k=1}^Nf(e^{2\pi ik/N}). (1) Show I(f)=∮|z|=1−izf(z)dzI(f)=\oint_{|z|=1}\frac{-i}zf(z)\,\d z. (2) Find the poles of gN[f](z)=−izN−1zN−1f(z)g_N[f](z)=\frac{-iz^{N-1}}{z^N-1}f(z) in DrD_r and the residues. (3) If ‖f‖<∞\lVert f\rVert<\infty, show |I(f)−IN(f)|≤2π‖f‖/(rN−1)|I(f)-I_N(f)|\le2\pi\lVert f\rVert/(r^N-1). (4) Show the constant 2π2\pi is optimal.

    Hint

    (3) Express both II and INI_N as integrals over |z|=R|z|=R for 1<R<r1<R<r, subtract, and simplify 1z−zN−1zN−1\frac1z-\frac{z^{N-1}}{z^N-1}.

    Solution

    (1) With z=eiθz=e^{i\theta}, dz=izdθ\d z=iz\,\d\theta, so dθ=−idz/z\d\theta=-i\,\d z/z.

    (2) The poles are the zeros of zN−1z^N-1, the roots of unity ωk=e2πik/N\omega_k=e^{2\pi ik/N}, all simple and inside DrD_r. Resωk=−iωkN−1f(ωk)NωkN−1=−iNf(ωk)\mathrm{Res}_{\omega_k}=\frac{-i\omega_k^{N-1}f(\omega_k)}{N\omega_k^{N-1}}=-\frac iNf(\omega_k) (the pole is removable if f(ωk)=0f(\omega_k)=0).

    (3) Fix 1<R<r1<R<r. By the residue theorem, ∮|z|=RgN=2πi∑k(−iN)f(ωk)=IN\oint_{|z|=R}g_N=2\pi i\sum_k(-\tfrac iN)f(\omega_k)=I_N. The integrand −if/z-if/z has only the pole at 0, so (1) also holds on |z|=R|z|=R. Subtracting, I−IN=∮|z|=R(−i)f(z)(1z−zN−1zN−1)dz=∮|z|=Rif(z)z(zN−1)dzI-I_N=\oint_{|z|=R}(-i)f(z)\Big(\frac1z-\frac{z^{N-1}}{z^N-1}\Big)\d z=\oint_{|z|=R}\frac{i\,f(z)}{z(z^N-1)}\d z. On |z|=R|z|=R, |zN−1|≥RN−1|z^N-1|\ge R^N-1, so |I−IN|≤2πR⋅‖f‖R(RN−1)|I-I_N|\le2\pi R\cdot\frac{\lVert f\rVert}{R(R^N-1)}. Let R↑rR\uparrow r.

    (4) The worked example.

    2024 Problem 3Fast approximation implies differentiability

    𝒯n\mathcal T_n is the set of functions θ↦P(eiθ)\theta\mapsto P(e^{i\theta}) with PP a complex polynomial of degree nn. ff is continuous and 2π2\pi-periodic, and for each nn some tn∈𝒯nt_n\in\mathcal T_n has ‖f−tn‖≤c/n3\lVert f-t_n\rVert\le c/n^3. (1) Show ‖tn+1−tn‖≤2c/n3\lVert t_{n+1}-t_n\rVert\le2c/n^3. (2) Using completeness of C[0,2π]C[0,2\pi] and ‖t′‖≤n‖t‖\lVert t'\rVert\le n\lVert t\rVert for t∈𝒯nt\in\mathcal T_n, show tn′t_n' converges uniformly to a continuous periodic ss. (3) Show ff is differentiable on ℝ\R.

    Solution

    (1) ‖tn+1−tn‖≤‖tn+1−f‖+‖f−tn‖≤c(n+1)3+cn3≤2cn3\lVert t_{n+1}-t_n\rVert\le\lVert t_{n+1}-f\rVert+\lVert f-t_n\rVert\le\frac c{(n+1)^3}+\frac c{n^3}\le\frac{2c}{n^3}.

    (2) tn+1−tnt_{n+1}-t_n comes from a polynomial of degree at most n+1n+1, so Bernstein's inequality (which holds for degree at most n+1n+1) gives ‖tn+1′−tn′‖≤(n+1)2cn3≤4cn2\lVert t_{n+1}'-t_n'\rVert\le(n+1)\frac{2c}{n^3}\le\frac{4c}{n^2}. For m>nm>n, ‖tm′−tn′‖≤∑k≥n4c/k2→0\lVert t_m'-t_n'\rVert\le\sum_{k\ge n}4c/k^2\to0: the sequence is Cauchy in the sup norm, so it converges uniformly to some continuous ss. Each tn′t_n' is 2π2\pi-periodic, hence so is ss.

    (3) tn(θ)−tn(0)=∫0θtn′t_n(\theta)-t_n(0)=\int_0^\theta t_n'. Let n→∞n\to\infty, using uniform convergence on both sides: f(θ)=f(0)+∫0θsf(\theta)=f(0)+\int_0^\theta s. Since ss is continuous, ff is differentiable with f′=sf'=s, on [0,2π][0,2\pi] and then on ℝ\R by periodicity.

    2025 Problem 3Mean versus median

    ℱa,b\mathcal F_{a,b} is the set of continuous densities on (a,b)(a,b) with inf⁡f>0\inf f>0. (1) For g∈ℱ0,5/3g\in\mathcal F_{0,5/3} equal to 32x+12\tfrac32x+\tfrac12 on (0,13](0,\tfrac13], −32x+32-\tfrac32x+\tfrac32 on (13,23](\tfrac13,\tfrac23], 12\tfrac12 on (23,53)(\tfrac23,\tfrac53), find the mean and median. (2) With Q=F−1Q=F^{-1}, show the mean is ∫01Q\int_0^1Q. (3) If ff is strictly decreasing, show mean > median. (4) If f′f' is continuous and for every a<c<d<ba<c<d<b the normalized restriction fcdf_{cd} has mean > median, show ff is strictly decreasing.

    Solution

    (1) The three pieces have mass 14,14,12\tfrac14,\tfrac14,\tfrac12, so the CDF at 23\tfrac23 is 12\tfrac12: median 23\tfrac23. ∫xg\int x\,g over the pieces is 5108+13108+63108=34\tfrac5{108}+\tfrac{13}{108}+\tfrac{63}{108}=\tfrac34: mean 34\tfrac34.

    (2) FF is C1C^1 with F′=f>0F'=f>0, a bijection (a,b)→(0,1)(a,b)\to(0,1). Substituting x=Q(u)x=Q(u), du=f(x)dx\d u=f(x)\d x: ∫abxf(x)dx=∫01Q(u)du\int_a^bxf(x)\d x=\int_0^1Q(u)\d u.

    (3) Q′(u)=1/f(Q(u))Q'(u)=1/f(Q(u)). As uu increases, Q(u)Q(u) increases and f(Q(u))f(Q(u)) strictly decreases, so Q′Q' strictly increases: QQ is strictly convex. Mean − median =∫01(Q(u)−Q(12))du=∫01/2(Q(12+v)+Q(12−v)−2Q(12))dv>0=\int_0^1(Q(u)-Q(\tfrac12))\d u=\int_0^{1/2}\big(Q(\tfrac12+v)+Q(\tfrac12-v)-2Q(\tfrac12)\big)\d v>0.

    (4) Contrapositive. Suppose ff is not strictly decreasing. If f′(x0)>0f'(x_0)>0 somewhere, then by continuity f′>0f'>0 on some [c,d][c,d], fcdf_{cd} is strictly increasing, and the mirror of (3) (QQ strictly concave) gives mean < median. Otherwise f′≤0f'\le0 everywhere, so ff is non-increasing, and not being strictly decreasing means f(x)=f(y)f(x)=f(y) for some x<yx<y: ff is constant on [x,y][x,y], and for c,dc,d in there fcdf_{cd} is uniform with mean = median. Either way the hypothesis fails.

    From Stein and Shakarchi, Complex Analysis (Princeton Lectures in Analysis II, 2003)

    Exercise numbers are from the exercises at the end of Chapter 3. Each is restated in our own words; the hints and solutions are written for this page.

    Exercise 3.8An integral over the circle by residues

    Show that ∫02πdθa+bcos⁡θ=2πa2−b2\displaystyle\int_0^{2\pi}\frac{\d\theta}{a+b\cos\theta}=\frac{2\pi}{\sqrt{a^2-b^2}} whenever a>|b|a>|b|, a,ba,b real.

    Hint

    Substitute z=eiθz=e^{i\theta}, so cos⁡θ=12(z+z−1)\cos\theta=\frac12(z+z^{-1}) and dθ=−idz/z\d\theta=-i\,\d z/z, as in 2023 P3(1).

    Solution

    For b=0b=0 it is immediate. Otherwise the integral becomes ∮|z|=1−2idzbz2+2az+b\oint_{|z|=1}\frac{-2i\,\d z}{bz^2+2az+b}. The roots z±=−a±a2−b2bz_\pm=\frac{-a\pm\sqrt{a^2-b^2}}b are real with z+z−=1z_+z_-=1, and |z+|<1<|z−||z_+|<1<|z_-|. The residue at z+z_+ is −2ib(z+−z−)=−2i2a2−b2\frac{-2i}{b(z_+-z_-)}=\frac{-2i}{2\sqrt{a^2-b^2}}, so the integral is 2πi⋅−ia2−b2=2πa2−b22\pi i\cdot\frac{-i}{\sqrt{a^2-b^2}}=\frac{2\pi}{\sqrt{a^2-b^2}}.

    Connection to the figure above: the integrand is analytic in the annulus |z+|<|z|<1/|z+||z_+|<|z|<1/|z_+|, so the NN-point trapezoid rule for it converges like |z+|N|z_+|^N. The closer aa is to |b||b|, the closer the poles are to the circle and the slower the convergence.

    Exercise 3.7Differentiate the previous answer

    Show that ∫02πdθ(a+cos⁡θ)2=2πa(a2−1)3/2\displaystyle\int_0^{2\pi}\frac{\d\theta}{(a+\cos\theta)^2}=\frac{2\pi a}{(a^2-1)^{3/2}} for a>1a>1.

    Hint

    A pole of order 2 works (Theorem 1.4), but there is a shortcut through Exercise 3.8.

    Solution

    By Exercise 3.8 with b=1b=1, F(a)=∫02πdθa+cos⁡θ=2π(a2−1)−1/2F(a)=\int_0^{2\pi}\frac{\d\theta}{a+\cos\theta}=2\pi(a^2-1)^{-1/2} for a>1a>1. Differentiating under the integral (the integrand is smooth in aa and bounded uniformly for aa in compact subsets of (1,∞)(1,\infty)): −∫02πdθ(a+cos⁡θ)2=F′(a)=−2πa(a2−1)−3/2-\int_0^{2\pi}\frac{\d\theta}{(a+\cos\theta)^2}=F'(a)=-2\pi a(a^2-1)^{-3/2}. Differentiating under the integral sign, with a sentence of justification, is exactly the step 2023 P4(2) needs.

    Exercise 3.1The poles of 1/sin πz

    Using sin⁡πz=eiπz−e−iπz2i\sin\pi z=\frac{e^{i\pi z}-e^{-i\pi z}}{2i}, show that the zeros of sin⁡πz\sin\pi z are exactly the integers, each of order 1, and find the residue of 1/sin⁡πz1/\sin\pi z at z=nz=n.

    Solution

    sin⁡πz=0⟺e2πiz=1⟺z∈ℤ\sin\pi z=0\iff e^{2\pi iz}=1\iff z\in\Z. The derivative πcos⁡πn=π(−1)n≠0\pi\cos\pi n=\pi(-1)^n\ne0, so each zero is simple, and the residue is 1πcos⁡πn=(−1)nπ\frac1{\pi\cos\pi n}=\frac{(-1)^n}\pi (the p/q′p/q' rule). The same rule gave the residues of gN[f]g_N[f] at the roots of unity in 2023 P3(2).

    Exercise 3.11An integral that vanishes by the mean-value property

    Show that ∫02πlog⁡|1−aeiθ|dθ=0\displaystyle\int_0^{2\pi}\log|1-ae^{i\theta}|\,\d\theta=0 when |a|<1|a|<1.

    Hint

    log⁡|1−az|\log|1-az| is the real part of a function holomorphic on a disc of radius more than 1.

    Solution

    For |z|<1/|a||z|<1/|a|, 1−az1-az lies in the disc of radius 1 about 1, where the principal logarithm is holomorphic; so f(z)=log⁡(1−az)f(z)=\log(1-az) is holomorphic there and Ref=log⁡|1−az|\mathrm{Re}\,f=\log|1-az|. The mean-value property (Ch. 3, Corollary 7.3) at z0=0z_0=0, r=1r=1 gives 12π∫02πlog⁡|1−aeiθ|dθ=log⁡|1−0|=0\frac1{2\pi}\int_0^{2\pi}\log|1-ae^{i\theta}|\,\d\theta=\log|1-0|=0. The same principle (the average of a holomorphic or harmonic function over a circle is its value at the centre) is why I(f)=2πf(0)I(f)=2\pi f(0) for every ff in 2023 P3.

    Interactive2020 P2, 2023 P4, 2024 P4, 2025 P4

    Probability and statistics

    The probability problems are built from a small kit: transform a variable and differentiate its distribution function, use memorylessness, write a likelihood and show it has one peak, compute a transform, or couple two variables on one probability space. Know each tool well enough to use it without hesitating.

    The idea

    Densities of transformed variables. Find P(Y≤y)P(Y\le y) in terms of the original variable, then differentiate. For Y=1/X2Y=1/X^2 with XX standard normal, P(Y≤y)=P(|X|≥y−1/2)P(Y\le y)=P(|X|\ge y^{-1/2}).
    Exponential and Poisson. X∼Exp(λ)X\sim\mathrm{Exp}(\lambda) is memoryless: X−cX-c given X≥cX\ge c is again Exp(λ)\mathrm{Exp}(\lambda). The minimum of independent Exp(λ1)\mathrm{Exp}(\lambda_1), Exp(λ2)\mathrm{Exp}(\lambda_2) is Exp(λ1+λ2)\mathrm{Exp}(\lambda_1+\lambda_2); a sum of nn i.i.d. Exp(λ)\mathrm{Exp}(\lambda) is Gamma(n,λ)\mathrm{Gamma}(n,\lambda) with density λnxn−1e−λx/(n−1)!\lambda^nx^{n-1}e^{-\lambda x}/(n-1)!; and the number of arrivals by time aa is Poisson(λa)\mathrm{Poisson}(\lambda a).
    Maximum likelihood. Write the likelihood of what you actually observe. Censored observations contribute probabilities, uncensored ones densities. To show a unique maximizer, reparametrize if it helps (θ=1/μ\theta=1/\mu) and show the score is strictly monotone, from +∞+\infty to a negative value.
    Transforms. The Laplace transform L(u)=E[e−uY]L(u)=E[e^{-uY}], moment generating function M(λ)=E[eλY]M(\lambda)=E[e^{\lambda Y}] and characteristic function φ(u)=E[eiuY]\varphi(u)=E[e^{iuY}] turn sums of independent variables into products. Convergence of characteristic functions to a continuous limit gives convergence in distribution (Lévy's continuity theorem).
    Coupling. For any two variables on one space, |P(S∈E)−P(T∈E)|≤P(S≠T)|P(S\in E)-P(T\in E)|\le P(S\ne T). Constructing ξ\xi and η\eta from the same uniform UU makes them equal as often as possible; summing over coordinates with a union bound gives Le Cam's inequality, |P(Bin(n,p)≤K)−P(Poisson(np)≤K)|≤np2|P(\mathrm{Bin}(n,p)\le K)-P(\mathrm{Poisson}(np)\le K)|\le np^2.

    Explore

    Bin(n,p)\mathrm{Bin}(n,p) Poisson(np)\mathrm{Poisson}(np), probabilities of each kk. The panel on the right compares the largest gap between their distribution functions with the bound np2np^2.
    Keep μ = np fixed at 3 and grow n

    Worked example

    2024 P4(4): X1,X2,…X_1,X_2,\dots i.i.d. Exp(λ)\mathrm{Exp}(\lambda), and NN is the number of partial sums Sk=X1+⋯+XkS_k=X_1+\dots+X_k that are ≤a\le a. Find the maximum likelihood estimate of λ\lambda from NN, and its mean and variance.

    1. Find the distribution of NN.

      N=kN=k means Sk≤a<Sk+Xk+1S_k\le a<S_k+X_{k+1}. Conditioning on Sk=sS_k=s (Gamma density) and using independence: P(N=k)=∫0aλksk−1e−λs(k−1)!e−λ(a−s)ds=e−λa(λa)kk!P(N=k)=\int_0^a\frac{\lambda^ks^{k-1}e^{-\lambda s}}{(k-1)!}e^{-\lambda(a-s)}\d s=e^{-\lambda a}\frac{(\lambda a)^k}{k!}. So N∼Poisson(λa)N\sim\mathrm{Poisson}(\lambda a) (and P(N=0)=e−λaP(N=0)=e^{-\lambda a} directly).

    2. Maximize the likelihood.

      ℓ(λ)=−λa+Nlog⁡λ+const\ell(\lambda)=-\lambda a+N\log\lambda+\text{const}, ℓ′(λ)=−a+N/λ\ell'(\lambda)=-a+N/\lambda. For N≥1N\ge1 the unique maximizer is λ^=N/a\hat\lambda=N/a. For N=0N=0, ℓ\ell decreases on λ>0\lambda>0 and the supremum is approached at λ→0\lambda\to0; the formula N/a=0N/a=0 is the natural boundary value, and worth a sentence in an answer.

    3. Mean and variance.

      Eλ^=EN/a=λE\hat\lambda=E N/a=\lambda (unbiased) and Varλ^=λa/a2=λ/a\mathrm{Var}\,\hat\lambda=\lambda a/a^2=\lambda/a.

    Check your understanding

    X1,X2X_1,X_2 i.i.d. Exp(λ)\mathrm{Exp}(\lambda). What is the distribution of max⁡(X1,X2)−min⁡(X1,X2)\max(X_1,X_2)-\min(X_1,X_2)?

    1. Exp(λ)\mathrm{Exp}(\lambda)
    2. Exp(2λ)\mathrm{Exp}(2\lambda)That is the minimum.
    3. Gamma(2,λ)\mathrm{Gamma}(2,\lambda)That is the sum.
    Once the first one fires, the other has a fresh Exp(λ)\mathrm{Exp}(\lambda) lifetime by memorylessness. (2024 P4(2).)

    Yk=1/Xk2Y_k=1/X_k^2 with XkX_k i.i.d. standard normal. What does (Y1+⋯+Yn)/n2(Y_1+\dots+Y_n)/n^2 do as n→∞n\to\infty?

    1. It has the same distribution as Y1Y_1 for every nn.
    2. It tends to 0 by the law of large numbers.E[Y]=∞E[Y]=\infty, and the scaling is n2n^2, not nn.
    3. It becomes normal after centring.The variance is infinite; the central limit theorem doesn't apply.
    φY(u)=exp⁡(−|u|(1−isgnu))\varphi_Y(u)=\exp(-\sqrt{|u|}(1-i\,\mathrm{sgn}\,u)), so φY(u/n2)n=φY(u)\varphi_Y(u/n^2)^n=\varphi_Y(u). This is the Lévy distribution, stable with index 12\tfrac12: sums are dominated by their largest term.

    Le Cam's inequality bounds |P(Bin(n,p)≤K)−P(Poisson(np)≤K)||P(\mathrm{Bin}(n,p)\le K)-P(\mathrm{Poisson}(np)\le K)| by:

    1. np2=μ2/nnp^2=\mu^2/n
    2. np=μnp=\muThat is what you get from P(ξj≠ηj)≤pP(\xi_j\ne\eta_j)\le p. The coupling does better: about p2p^2 per trial.
    3. 1/n1/\sqrt nThat is the Berry–Esseen rate for the normal approximation.
    Each Bernoulli–Poisson pair disagrees with probability p(1−e−p)≤p2p(1-e^{-p})\le p^2, and there are nn pairs. Use the figure: with μ\mu fixed, doubling nn halves the bound.

    Practice

    Past problems

    Restated in our own words. Official statements: 2020, 2023, 2024, 2025.

    2020 Problem 2Lifetimes censored at birth

    X1,…,XnX_1,\dots,X_n i.i.d. exponential with mean μ\mu. We observe Yi=aY_i=a if Xi≤aX_i\le a and Yi=XiY_i=X_i otherwise. (1) Find g(μ)=E[Y1]g(\mu)=E[Y_1]. (2) If Y‾>a\bar Y>a, show g(μ^)=Y‾g(\hat\mu)=\bar Y has a unique solution. (3) With M=#{i:Yi=a}M=\#\{i:Y_i=a\}, find hh with P(M=m,Y‾≤b)=∫abh(m,y;μ)dyP(M=m,\bar Y\le b)=\int_a^bh(m,y;\mu)\d y for 0≤m≤n−10\le m\le n-1, b>ab>a. (4) For m<nm<n, y>ay>a, show h(m,y;μ)h(m,y;\mu) has a unique maximizer in μ\mu.

    Hint

    (3) Given which mm are censored, the others are a+Eia+E_i with Ei∼ExpE_i\sim\mathrm{Exp} by memorylessness, and nY‾=na+∑Ein\bar Y=na+\sum E_i. (4) Put θ=1/μ\theta=1/\mu.

    Solution

    (1) g(μ)=aP(X≤a)+E[X;X>a]=a(1−e−a/μ)+(a+μ)e−a/μ=a+μe−a/μg(\mu)=aP(X\le a)+E[X;X>a]=a(1-e^{-a/\mu})+(a+\mu)e^{-a/\mu}=a+\mu e^{-a/\mu}.

    (2) g′(μ)=e−a/μ(1+a/μ)>0g'(\mu)=e^{-a/\mu}(1+a/\mu)>0, g(μ)→ag(\mu)\to a as μ→0+\mu\to0^+ and g→∞g\to\infty as μ→∞\mu\to\infty. By continuity and strict monotonicity, each value in (a,∞)(a,\infty) is taken exactly once.

    (3) Choose the censored set ((nm)\binom nm ways, probability (1−e−a/μ)m(1-e^{-a/\mu})^m). The other k=n−m≥1k=n-m\ge1 exceed aa (probability e−ka/μe^{-ka/\mu}) and, given that, are a+Eia+E_i with EiE_i i.i.d. mean μ\mu. Then Y‾=a+S/n\bar Y=a+S/n with S∼Gamma(k,1/μ)S\sim\mathrm{Gamma}(k,1/\mu). Changing variables, h(m,y;μ)=(nm)(1−e−a/μ)me−ka/μ⋅n(n(y−a))k−1e−n(y−a)/μμk(k−1)!h(m,y;\mu)=\binom nm(1-e^{-a/\mu})^me^{-ka/\mu}\cdot\frac{n\,(n(y-a))^{k-1}e^{-n(y-a)/\mu}}{\mu^k(k-1)!} for y>ay>a.

    (4) With θ=1/μ\theta=1/\mu, log⁡h=mlog⁡(1−e−aθ)−Tθ+klog⁡θ+const\log h=m\log(1-e^{-a\theta})-T\theta+k\log\theta+\text{const}, where T=ka+n(y−a)=ny−ma>0T=ka+n(y-a)=ny-ma>0. Then ddθlog⁡h=maeaθ−1+kθ−T\frac{\d}{\d\theta}\log h=\frac{ma}{e^{a\theta}-1}+\frac k\theta-T. The first two terms strictly decrease from +∞+\infty (as θ→0\theta\to0) to 0 (as θ→∞\theta\to\infty), so the derivative crosses zero exactly once, from positive to negative: a unique maximizer θ\theta, hence a unique μ\mu.

    2023 Problem 4The reciprocal of a squared normal

    XX standard normal, Y=1/X2Y=1/X^2 with density ff. (1) Find ff. (2) For L(u)=∫0∞e−uyf(y)dyL(u)=\int_0^\infty e^{-uy}f(y)\d y, show L′(u)=−L(u)/2uL'(u)=-L(u)/\sqrt{2u} for u>0u>0. (3) Find φ(u)=E[eiuY]\varphi(u)=E[e^{iuY}]. (4) For i.i.d. Yk∼fY_k\sim f, show (Y1+⋯+Yn)/n2(Y_1+\dots+Y_n)/n^2 converges in distribution and find the limit density.

    Hint

    (2) Write L(u)=2∫0∞12πe−x2/2−u/x2dxL(u)=2\int_0^\infty\frac1{\sqrt{2\pi}}e^{-x^2/2-u/x^2}\d x, differentiate, and substitute x=2u/tx=\sqrt{2u}/t, which swaps x2/2x^2/2 and u/x2u/x^2.

    Solution

    (1) P(Y≤y)=2(1−Φ(y−1/2))P(Y\le y)=2(1-\Phi(y^{-1/2})), so f(y)=12πy−3/2e−1/(2y)f(y)=\frac1{\sqrt{2\pi}}y^{-3/2}e^{-1/(2y)} for y>0y>0.

    (2) Differentiating under the integral (dominated for uu in compact subsets of (0,∞)(0,\infty)), L′(u)=−2∫0∞12πx−2e−x2/2−u/x2dxL'(u)=-2\int_0^\infty\frac1{\sqrt{2\pi}}x^{-2}e^{-x^2/2-u/x^2}\d x. With x=2u/tx=\sqrt{2u}/t, x−2dxx^{-2}\d x becomes 12udt\frac1{\sqrt{2u}}\d t (orientation reversed, limits swapped) and the exponent is unchanged, so L′(u)=−12uL(u)L'(u)=-\frac1{\sqrt{2u}}L(u).

    (3) Solving with L(0+)=1L(0^+)=1: L(u)=e−2uL(u)=e^{-\sqrt{2u}}. E[e−zY]E[e^{-zY}] is holomorphic for Rez>0\mathrm{Re}\,z>0 and continuous up to Rez=0\mathrm{Re}\,z=0; it agrees with e−2ze^{-\sqrt{2z}} (principal branch) on z>0z>0, hence on the half-plane by the identity theorem (Stein–Shakarchi Ch. 2, Corollary 4.9), and at z=−iuz=-iu: φ(u)=exp⁡(−−2iu)=exp⁡(−|u|(1−isgnu))\varphi(u)=\exp(-\sqrt{-2iu})=\exp\big(-\sqrt{|u|}\,(1-i\,\mathrm{sgn}\,u)\big).

    (4) The characteristic function of the scaled sum is φ(u/n2)n=exp⁡(−n|u|/n(1−isgnu))=φ(u)\varphi(u/n^2)^n=\exp\big(-n\sqrt{|u|}/n\,(1-i\,\mathrm{sgn}\,u)\big)=\varphi(u). So for every nn the scaled sum has density ff; it converges (trivially) in distribution, and the limit density is ff itself.

    2024 Problem 4Exponential clocks and a Poisson count

    X1,X2,…X_1,X_2,\dots i.i.d. Exp(λ)\mathrm{Exp}(\lambda). (1) Density of X1−cX_1-c given X1≥cX_1\ge c. (2) Densities of Y=min⁡(X1,X2)Y=\min(X_1,X_2) and Z−YZ-Y with Z=max⁡Z=\max. (3) Density of X1+⋯+XnX_1+\dots+X_n. (4) The MLE of λ\lambda from NN (defined by SN≤a<SN+1S_N\le a<S_{N+1}), its mean and variance.

    Solution

    (1) P(X1−c>x|X1≥c)=e−λ(x+c)/e−λc=e−λxP(X_1-c>x\mid X_1\ge c)=e^{-\lambda(x+c)}/e^{-\lambda c}=e^{-\lambda x}: density λe−λx\lambda e^{-\lambda x}, x≥0x\ge0.

    (2) P(Y>y)=e−2λyP(Y>y)=e^{-2\lambda y}, so YY has density 2λe−2λy2\lambda e^{-2\lambda y}. For Z−YZ-Y: P(Z−Y>w)=2∫0∞λe−λxe−λ(x+w)dx=e−λwP(Z-Y>w)=2\int_0^\infty\lambda e^{-\lambda x}e^{-\lambda(x+w)}\d x=e^{-\lambda w}, density λe−λw\lambda e^{-\lambda w} (and YY, Z−YZ-Y are independent).

    (3) By induction on convolutions, λnxn−1e−λx/(n−1)!\lambda^nx^{n-1}e^{-\lambda x}/(n-1)! for x>0x>0.

    (4) The worked example: λ^=N/a\hat\lambda=N/a, mean λ\lambda, variance λ/a\lambda/a.

    2025 Problem 4Poisson approximation by coupling

    (1) Show the sum of independent Poisson(λ1\lambda_1) and Poisson(λ2\lambda_2) is Poisson(λ1+λ2\lambda_1+\lambda_2). (2) For any ξj,ηj\xi_j,\eta_j on one space, show |P(∑ξj≤K)−P(∑ηj≤K)|≤∑jP(ξj≠ηj)|P(\sum\xi_j\le K)-P(\sum\eta_j\le K)|\le\sum_jP(\xi_j\ne\eta_j). (3) With UU uniform on (0,1)(0,1), ξ=𝟏[U>1−p]\xi=\mathbf 1[U>1-p] and η=min⁡{ℓ:U≤qℓ}\eta=\min\{\ell:U\le q_\ell\} where qℓ=e−p∑i≤ℓpi/i!q_\ell=e^{-p}\sum_{i\le\ell}p^i/i!, show P(ξ≠η)≤p2P(\xi\ne\eta)\le p^2. (4) Show |P(Y≤K)−e−μ∑i≤Kμi/i!|≤μ2/n|P(Y\le K)-e^{-\mu}\sum_{i\le K}\mu^i/i!|\le\mu^2/n for Y∼Bin(n,p)Y\sim\mathrm{Bin}(n,p), μ=np\mu=np.

    Solution

    (1) P(X1+X2=k)=∑j=0ke−λ1λ1jj!e−λ2λ2k−j(k−j)!=e−(λ1+λ2)k!∑j(kj)λ1jλ2k−j=e−(λ1+λ2)(λ1+λ2)kk!P(X_1+X_2=k)=\sum_{j=0}^ke^{-\lambda_1}\frac{\lambda_1^j}{j!}e^{-\lambda_2}\frac{\lambda_2^{k-j}}{(k-j)!}=\frac{e^{-(\lambda_1+\lambda_2)}}{k!}\sum_j\binom kj\lambda_1^j\lambda_2^{k-j}=e^{-(\lambda_1+\lambda_2)}\frac{(\lambda_1+\lambda_2)^k}{k!}.

    (2) Let E={∑ξj≤K}E=\{\sum\xi_j\le K\}, F={∑ηj≤K}F=\{\sum\eta_j\le K\}. |P(E)−P(F)|≤P(E△F)≤P(∑ξj≠∑ηj)≤P(⋃j{ξj≠ηj})≤∑jP(ξj≠ηj)|P(E)-P(F)|\le P(E\,\triangle\,F)\le P(\sum\xi_j\ne\sum\eta_j)\le P(\bigcup_j\{\xi_j\ne\eta_j\})\le\sum_jP(\xi_j\ne\eta_j).

    (3) η\eta is Poisson(pp) (it is the inverse-CDF construction) and ξ\xi is Bernoulli(pp). Since 1−p≤e−p=q01-p\le e^{-p}=q_0: on U≤1−pU\le1-p both are 0; on 1−p<U≤q01-p<U\le q_0, ξ=1≠0=η\xi=1\ne0=\eta; on q0<U≤q1q_0<U\le q_1 both are 1; on U>q1U>q_1, η≥2≠ξ\eta\ge2\ne\xi. So P(ξ≠η)=(e−p−(1−p))+(1−e−p(1+p))=p(1−e−p)≤p⋅pP(\xi\ne\eta)=(e^{-p}-(1-p))+(1-e^{-p}(1+p))=p(1-e^{-p})\le p\cdot p.

    (4) Build nn independent pairs (ξj,ηj)(\xi_j,\eta_j) from independent uniforms. ∑ξj∼Bin(n,p)\sum\xi_j\sim\mathrm{Bin}(n,p) and, by (1), ∑ηj∼Poisson(np)\sum\eta_j\sim\mathrm{Poisson}(np). By (2) and (3) the difference is at most np2=μ2/nnp^2=\mu^2/n.

    Simulation2026 P2, 2026 P4

    Concentration and random walks

    Two 2026 problems come from modern probability: the Johnson–Lindenstrauss lemma, proved with a Chernoff bound, and fixation in the Moran process, solved by first-step analysis. Both are standard theorems taught as a sequence of short steps, which is how the exam presents them.

    The idea

    Chernoff's method. For λ>0\lambda>0, Markov's inequality applied to eλZe^{\lambda Z} gives P(Z≥ε)≤MZ(λ)e−λεP(Z\ge\varepsilon)\le M_Z(\lambda)e^{-\lambda\varepsilon}. Compute MZM_Z for a sum of independent terms as a product, then choose λ\lambda to make the bound small. Exact optimization is not required: any λ\lambda in the allowed range gives a valid bound.
    Gaussian facts. If AA has i.i.d. N(0,1)N(0,1) entries and ‖b‖=1\lVert b\rVert=1, then the entries of AbAb are i.i.d. N(0,1)N(0,1), so ‖Ab‖2∼χm2\lVert Ab\rVert^2\sim\chi^2_m, with M(λ)=(1−2λ)−m/2M(\lambda)=(1-2\lambda)^{-m/2} for λ<12\lambda<\tfrac12.
    Johnson–Lindenstrauss. kk points in any dimension can be mapped linearly into m=O(η−2log⁡k)m=O(\eta^{-2}\log k) dimensions with all pairwise squared distances preserved within a factor 1±η1\pm\eta. A scaled Gaussian matrix does it with high probability, and the target dimension doesn't depend on the original dimension at all. The proof is a Chernoff bound for one pair plus a union bound over (k2)\binom k2 pairs.
    First-step analysis. For a chain absorbed at 0 or NN, let ϕi\phi_i be the probability of absorption at NN from ii. Conditioning on the first step: ϕi=piϕi+1+qiϕi−1+(1−pi−qi)ϕi\phi_i=p_i\phi_{i+1}+q_i\phi_{i-1}+(1-p_i-q_i)\phi_i, i.e. pi(ϕi+1−ϕi)=qi(ϕi−ϕi−1)p_i(\phi_{i+1}-\phi_i)=q_i(\phi_i-\phi_{i-1}). If pi/qi=rp_i/q_i=r is constant this is the gambler's ruin: ϕi=1−r−i1−r−N\phi_i=\frac{1-r^{-i}}{1-r^{-N}} (i/Ni/N when r=1r=1). Expected absorption times satisfy the same recursion with a source term: (pi+qi)Ti=1+piTi+1+qiTi−1(p_i+q_i)T_i=1+p_iT_{i+1}+q_iT_{i-1}.

    For more, the High-Dimensional Probability and Markov Chains pages go further in each direction.

    Explore: random projection

    For 40 random points in ℝ300\R^{300}, the ratio ‖bi′−bj′‖2/‖bi−bj‖2\lVert b_i'-b_j'\rVert^2/\lVert b_i-b_j\rVert^2 for all 780 pairs, after b↦1mAbb\mapsto\frac1{\sqrt m}Ab. 1±η1\pm\eta

    Explore: the Moran process

    ϕi\phi_i from the formula simulated, with a 95% interval. The dashed line is the neutral case i/Ni/N.

    Worked example

    2026 P2(3): for ‖b‖=1\lVert b\rVert=1 and 0<ε≤m0<\varepsilon\le m, show P(‖Ab‖2−m≥ε)≤e−ε2/(8m)P(\lVert Ab\rVert^2-m\ge\varepsilon)\le e^{-\varepsilon^2/(8m)}, given log⁡(1+x)≥x−x2\log(1+x)\ge x-x^2 for x≥−12x\ge-\tfrac12.

    1. Apply (1) and (2) of the problem.

      Z=‖Ab‖2∼χm2Z=\lVert Ab\rVert^2\sim\chi^2_m is a sum of mm independent X2X^2 terms, so MZ(λ)=(1−2λ)−m/2M_Z(\lambda)=(1-2\lambda)^{-m/2} and P(Z−m≥ε)≤(1−2λ)−m/2e−λ(m+ε)P(Z-m\ge\varepsilon)\le(1-2\lambda)^{-m/2}e^{-\lambda(m+\varepsilon)} for 0<λ<120<\lambda<\tfrac12.

    2. Use the hint on (1−2λ)−m/2(1-2\lambda)^{-m/2}. Where does it apply?

      With x=−2λ≥−12x=-2\lambda\ge-\tfrac12, i.e. λ≤14\lambda\le\tfrac14: −m2log⁡(1−2λ)≤−m2(−2λ−4λ2)=mλ+2mλ2-\tfrac m2\log(1-2\lambda)\le-\tfrac m2(-2\lambda-4\lambda^2)=m\lambda+2m\lambda^2. So the bound is at most exp⁡(−λε+2mλ2)\exp(-\lambda\varepsilon+2m\lambda^2).

    3. Choose λ\lambda.

      The exponent is minimized at λ=ε/(4m)\lambda=\varepsilon/(4m), which is ≤14\le\tfrac14 because ε≤m\varepsilon\le m. Its value is −ε24m+ε28m=−ε28m-\frac{\varepsilon^2}{4m}+\frac{\varepsilon^2}{8m}=-\frac{\varepsilon^2}{8m}. That is where the condition ε∈(0,m]\varepsilon\in(0,m] comes from.

    Check your understanding

    In Johnson–Lindenstrauss, how must the target dimension mm grow with the number of points kk (fixed η\eta, δ\delta)?

    1. Like log⁡k\log k
    2. Like kkThe union bound over k2k^2 pairs only costs a logarithm, since each pair fails with probability e−η2m/8e^{-\eta^2m/8}.
    3. Like the original dimension nnnn doesn't appear at all.
    m≥8η2log⁡k(k−1)2δm\ge\frac8{\eta^2}\log\frac{k(k-1)}{2\delta}. For the 40 points in the figure with η=0.3\eta=0.3 and δ=0.1\delta=0.1, the lemma asks for m≈800m\approx800, yet almost every pair is already within tolerance at m=200m=200. The constant is pessimistic, the shape is right.

    In the neutral Moran process (r=1r=1), what is the probability that type A takes over starting from ii individuals?

    1. i/Ni/N
    2. 1/21/2Larger starting groups are more likely to win.
    3. 1−(1−1/N)i1-(1-1/N)^iThat would be right if each A lineage independently had probability 1/N1/N; they aren't independent.
    With r=1r=1, XtX_t is a martingale, so EX∞=iE X_\infty=i, and X∞∈{0,N}X_\infty\in\{0,N\} gives Nϕi=iN\phi_i=i. Equivalently, every individual is equally likely to be the eventual common ancestor.

    A single mutant (i=1i=1) with r=1.1r=1.1 in a large population fixes with probability about:

    1. 1−1/r≈0.091-1/r\approx0.09
    2. 1/N1/NThat is the neutral answer; selection helps a lot.
    3. Close to 1Early on there is only one mutant, and it is easily lost by chance.
    ϕ1=(1−r−1)/(1−r−N)→1−1/r\phi_1=(1-r^{-1})/(1-r^{-N})\to1-1/r as N→∞N\to\infty. Most advantageous mutations are still lost to drift.

    Practice

    Past problems

    Restated in our own words. Official statement: 2026.

    2026 Problem 2The Johnson–Lindenstrauss lemma

    (1) For XX standard normal and Y=X2Y=X^2, show MY(λ)=(1−2λ)−1/2M_Y(\lambda)=(1-2\lambda)^{-1/2} for λ<12\lambda<\tfrac12. (2) Show P(Z≥ε)≤MZ(λ)/eλεP(Z\ge\varepsilon)\le M_Z(\lambda)/e^{\lambda\varepsilon} for ε,λ>0\varepsilon,\lambda>0. (3) For an m×nm\times n matrix AA of i.i.d. standard normals and ‖b‖=1\lVert b\rVert=1, ε∈(0,m]\varepsilon\in(0,m], show P(‖Ab‖2−m≥ε)≤e−ε2/(8m)P(\lVert Ab\rVert^2-m\ge\varepsilon)\le e^{-\varepsilon^2/(8m)}. (4) For b1,…,bk∈ℝnb_1,\dots,b_k\in\R^n, bi′=Abi/mb_i'=Ab_i/\sqrt m, and m≥8η2log⁡k(k−1)2δm\ge\frac8{\eta^2}\log\frac{k(k-1)}{2\delta}, show that with probability at least 1−δ1-\delta, ‖bi′−bj′‖2≤(1+η)‖bi−bj‖2\lVert b_i'-b_j'\rVert^2\le(1+\eta)\lVert b_i-b_j\rVert^2 for all i,ji,j.

    Solution

    (1) MY(λ)=∫12πe−(1−2λ)x2/2dx=(1−2λ)−1/2M_Y(\lambda)=\int\frac1{\sqrt{2\pi}}e^{-(1-2\lambda)x^2/2}\d x=(1-2\lambda)^{-1/2}, a Gaussian integral with variance 1/(1−2λ)1/(1-2\lambda).

    (2) 𝟏[Z≥ε]≤eλ(Z−ε)\mathbf 1[Z\ge\varepsilon]\le e^{\lambda(Z-\varepsilon)} pointwise; take expectations.

    (3) (Ab)i=∑jAijbj(Ab)_i=\sum_jA_{ij}b_j are independent N(0,‖b‖2)=N(0,1)N(0,\lVert b\rVert^2)=N(0,1), so ‖Ab‖2\lVert Ab\rVert^2 is a sum of mm independent copies of YY. The rest is the worked example.

    (4) For a pair with bi≠bjb_i\ne b_j, let u=(bi−bj)/‖bi−bj‖u=(b_i-b_j)/\lVert b_i-b_j\rVert. Then ‖bi′−bj′‖2=‖bi−bj‖2‖Au‖2/m\lVert b_i'-b_j'\rVert^2=\lVert b_i-b_j\rVert^2\lVert Au\rVert^2/m, and the bad event is ‖Au‖2−m>ηm\lVert Au\rVert^2-m>\eta m. With ε=ηm∈(0,m]\varepsilon=\eta m\in(0,m], (3) bounds its probability by e−η2m/8≤2δk(k−1)e^{-\eta^2m/8}\le\frac{2\delta}{k(k-1)}. Pairs with bi=bjb_i=b_j, and i=ji=j, never fail. A union bound over the (k2)\binom k2 unordered pairs gives total failure probability at most δ\delta.

    2026 Problem 4Fixation in the Moran process

    A population of N≥2N\ge2 has XtX_t individuals of type A (fitness fAf_A) and the rest type B (fBf_B), r=fA/fBr=f_A/f_B. Each step one individual is chosen uniformly; with utu_t uniform on (0,1)(0,1), a chosen A becomes B if ut>fAXtfAXt+fB(N−Xt)u_t>\frac{f_AX_t}{f_AX_t+f_B(N-X_t)}, and a chosen B becomes A if utu_t is at most that. With pi=P(X1=i+1|X0=i)p_i=P(X_1=i+1\mid X_0=i) and qi=P(X1=i−1|X0=i)q_i=P(X_1=i-1\mid X_0=i): (1) show pi/qi=rp_i/q_i=r. (2) Relate ϕi+1,ϕi,ϕi−1\phi_{i+1},\phi_i,\phi_{i-1}, where ϕi\phi_i is the probability that Xt→NX_t\to N. (3) Find ϕi\phi_i. (4) Relate Ti+1,Ti,Ti−1T_{i+1},T_i,T_{i-1}, where TiT_i is the expected absorption time. (5) For r=1r=1, write TiT_i using ii, NN, LNL_N, Li+1L_{i+1}, LN−i+1L_{N-i+1}, where Lj=∑k=1j−11/kL_j=\sum_{k=1}^{j-1}1/k (L1=0L_1=0) and ∑j=1nLj=nLn+1−n\sum_{j=1}^nL_j=nL_{n+1}-n.

    Hint

    (5) With Di=Ti−Ti−1D_i=T_i-T_{i-1}, the recursion is Di+1−Di=−N(1i+1N−i)D_{i+1}-D_i=-N\big(\frac1i+\frac1{N-i}\big). Sum twice, then fix D1D_1 from TN=0T_N=0.

    Solution

    (1) Let ρi=riri+N−i\rho_i=\frac{ri}{ri+N-i}. pi=N−iNρi=(N−i)riN(ri+N−i)p_i=\frac{N-i}N\rho_i=\frac{(N-i)ri}{N(ri+N-i)} and qi=iN(1−ρi)=i(N−i)N(ri+N−i)q_i=\frac iN(1-\rho_i)=\frac{i(N-i)}{N(ri+N-i)}. The ratio is rr.

    (2) First-step analysis: ϕi=piϕi+1+qiϕi−1+(1−pi−qi)ϕi\phi_i=p_i\phi_{i+1}+q_i\phi_{i-1}+(1-p_i-q_i)\phi_i, i.e. pi(ϕi+1−ϕi)=qi(ϕi−ϕi−1)p_i(\phi_{i+1}-\phi_i)=q_i(\phi_i-\phi_{i-1}).

    (3) The differences satisfy di+1=di/rd_{i+1}=d_i/r, with ϕ0=0\phi_0=0, ϕN=1\phi_N=1. So ϕi=d1∑k=0i−1r−k\phi_i=d_1\sum_{k=0}^{i-1}r^{-k}, and normalizing, ϕi=1−r−i1−r−N\phi_i=\frac{1-r^{-i}}{1-r^{-N}} for r≠1r\ne1, ϕi=i/N\phi_i=i/N for r=1r=1.

    (4) Ti=1+piTi+1+qiTi−1+(1−pi−qi)TiT_i=1+p_iT_{i+1}+q_iT_{i-1}+(1-p_i-q_i)T_i, i.e. pi(Ti+1−Ti)−qi(Ti−Ti−1)=−1p_i(T_{i+1}-T_i)-q_i(T_i-T_{i-1})=-1, with T0=TN=0T_0=T_N=0.

    (5) With r=1r=1, pi=qi=i(N−i)/N2p_i=q_i=i(N-i)/N^2, giving the hint's recursion. Summing, Dj=D1−N(Lj+LN−LN−j+1)D_j=D_1-N\big(L_j+L_N-L_{N-j+1}\big), and summing again with the given identity, Ti=iD1−N(iLi+1+(N−i)LN−i+1−(N−i)LN−1)T_i=iD_1-N\big(iL_{i+1}+(N-i)L_{N-i+1}-(N-i)L_N-1\big). TN=0T_N=0 forces D1=NLND_1=NL_N. Therefore

    Ti=N(NLN+1−iLi+1−(N−i)LN−i+1).T_i=N\big(NL_N+1-iL_{i+1}-(N-i)L_{N-i+1}\big).

    Check N=2N=2: T1=2(2+1−1−1)=2T_1=2(2+1-1-1)=2, matching T1=1+12T1T_1=1+\tfrac12T_1.

    Step-through2020 P5, 2024 P5, 2025 P5, 2026 P5; Kleinberg and Tardos Ch. 3, 6, 7, 11

    Algorithms: design and proof

    Problem 5 always asks for an algorithm with a running-time bound, and the marks go to the argument as much as the pseudocode. The earlier parts usually hand you the structural lemma the algorithm needs; spot it, then the algorithm is a short loop.

    The idea

    An answer to an algorithm part should have four pieces, each short: the algorithm (numbered steps or pseudocode), the invariant or lemma it relies on, why it is correct, and its running time with the data structure that achieves it. "Linear time" on a graph means O(n+m)O(n+m) with adjacency lists: each vertex and edge handled a constant number of times.

    Peeling (Kleinberg–Tardos §3.6). Many linear-time graph algorithms repeatedly remove a vertex that is forced, maintaining counters and a queue (or bucket array) of candidates. Topological sorting removes sources; the degeneracy ordering removes a minimum-degree vertex. Both are O(n+m)O(n+m) because each edge decrements a counter once. The proof that a DAG always has a source, and so a topological order, is K&T (3.19)–(3.20).
    Lower bounds on the optimum (K&T §11.1). To prove an approximation ratio, find simple quantities the optimum can't beat. For scheduling: T*≥1m∑wℓwT^*\ge\frac1m\sum_w\ell_w (average load) and T*≥maxw⁡ℓwT^*\ge\max_w\ell_w (some machine runs the longest job). Graham's greedy rule comes within T*+max⁡ℓ≤2T*T^*+\max\ell\le2T^*: these are K&T (11.1)–(11.3), essentially 2024 P5(2) word for word. Sorting the jobs longest first adds a third bound, T*≥2tm+1T^*\ge2t_{m+1} (11.4), and improves the ratio to 32\tfrac32 (11.5).
    Reductions (K&T §§7.1, 7.5, 6.8, 6.10). Assignment with capacities is a flow problem; "max total weight of a walk" is a shortest-path problem after negating weights; "is there an unbounded walk" is negative-cycle detection (Bellman–Ford, O(n3)O(n^3) on a dense graph).
    The max-plus view. If every entry of AA is a monomial xzijx^{z_{ij}} with positive coefficient, the entries of AℓA^\ell are sums over walks of length ℓ\ell of x(walk weight)x^{\text{(walk weight)}}, and no cancellation can happen. So the top degree of (Sk)ij(S_k)_{ij} is the largest weight of an i→ji\to j walk of length at most kk: matrix powers become longest walks (2025 P5).
    Isotonic regression. The best non-decreasing fit BB to data AA in squared error is a projection onto a convex cone, so it is unique and characterized by a variational inequality, as in module 2. Its solution is a sequence of blocks, each set to the mean of its data. The pool-adjacent-violators algorithm (PAVA) builds it left to right with a stack: push each point as a block, and while the last two blocks are out of order, merge them. Each element is pushed once and merged at most once: O(n)O(n).

    Explore

    data A[i]A[i] (drag up and down) blocks on the stack so far a violation about to be merged

    Worked example

    2026 P5(3): in linear time, find an acyclic orientation of GG minimizing the maximum in-degree.

    1. Turn an ordering of the vertices into an acyclic orientation. What is each in-degree?

      Given an order vσ(1),…,vσ(n)v_{\sigma(1)},\dots,v_{\sigma(n)}, orient every edge from the later vertex to the earlier one. Every edge points backwards, so there is no cycle. The in-degree of a vertex is its number of neighbours that come after it.

    2. Which ordering makes the largest such count small?

      Repeatedly remove a vertex of minimum degree in the remaining graph, and list vertices in removal order. When vv is removed, its remaining degree is exactly its number of later neighbours. So the maximum in-degree is k=maxv⁡(degree of v at removal)k=\max_v(\text{degree of }v\text{ at removal}), the degeneracy of GG.

    3. Why can't any acyclic orientation do better?

      At the moment the removed vertex had degree kk, the remaining subgraph HH had minimum degree kk. In any acyclic orientation of GG, restricted to HH, take the last vertex of HH in a topological order: all its HH-edges point into it, so its in-degree is at least kk.

    4. Make it linear time.

      Keep vertices in buckets by current degree (degrees are at most n−1n-1) and a pointer to the lowest non-empty bucket. Removing a vertex moves each neighbour down one bucket in O(1)O(1), and the pointer only drops by one per removal, so the total is O(n+m)O(n+m) (Matula and Beck).

    Check your understanding

    Greedy list scheduling (each job to the currently least-loaded machine) has makespan at most 2T*2T^*. Which two facts does the proof use?

    1. T*≥1m∑ℓwT^*\ge\frac1m\sum\ell_w and T*≥max⁡ℓwT^*\ge\max\ell_w
    2. T*≥∑ℓwT^*\ge\sum\ell_w and T*≤mmax⁡ℓwT^*\le m\max\ell_wThe first is false when m>1m>1; the second is an upper bound, not useful here.
    3. The jobs are sorted by length firstSorting (LPT) improves the ratio to 4/3, but the plain greedy bound needs no sorting.
    The last job ww placed on the busiest machine started when that machine had the minimum load, at most 1m∑w′≠wℓw′\frac1m\sum_{w'\ne w}\ell_{w'}. Adding ℓw\ell_w gives at most T*+T*T^*+T^*.

    Why does the top degree of (Sk)ij(S_k)_{ij} equal the largest weight of an i→ji\to j walk of length at most kk?

    1. All coefficients are positive integers (they count walks), so nothing cancels.
    2. Because zij≤0z_{ij}\le0.The sign of the exponents doesn't matter for this; positivity of the coefficients does.
    3. It doesn't; cancellation can lower the degree.Cancellation needs negative coefficients, and every entry of AA has coefficient 1.
    (Aℓ)ij=∑walksxziv1+⋯+zvℓ−1j(A^\ell)_{ij}=\sum_{\text{walks}}x^{z_{iv_1}+\dots+z_{v_{\ell-1}j}}. The identity term A0A^0 contributes x0x^0 on the diagonal, which is why Dn[i,i]≥0D_n[i,i]\ge0.

    To maximize ∑icidG→(vi)\sum_ic_i\,d_{\vec G}(v_i) over acyclic orientations, orient each edge:

    1. into the endpoint with larger cc (ties by index)
    2. into the endpoint of larger degreeThe objective counts cc at the head of each edge, not degrees.
    3. along a DFS tree, then the rest arbitrarilyThat ignores cc entirely.
    The objective is ∑edgeschead≤∑uv∈Emax⁡(cu,cv)\sum_{\text{edges}}c_{\text{head}}\le\sum_{uv\in E}\max(c_u,c_v), and this rule attains it. It is acyclic because every edge goes up in the total order by (c,index)(c,\text{index}). That is 2026 P5(4), in O(n+m)O(n+m).

    Practice

    Past problems

    Restated in our own words. Official statements: 2020, 2024, 2025, 2026. 2023 P5 is in module 9.

    2020 Problem 5Isotonic regression

    An approximate array of AA (length nn) is a non-decreasing BB minimizing ∑(A[i]−B[i])2\sum(A[i]-B[i])^2. Let A′A' be AA with one element appended, and B,B′B,B' the approximate arrays of A,A′A,A'. (1-1) If A′[n+1]≥B[n]A'[n+1]\ge B[n], show B′=(B,A′[n+1])B'=(B,A'[n+1]). (1-2) If BB is constant and A′[n+1]<B[n]A'[n+1]<B[n], show B′B' is constant with B′[n+1]<B[n]B'[n+1]<B[n], and find it. (2) Give a polynomial-time algorithm for the approximate array.

    Hint

    The feasible set is a closed convex cone, so the minimizer is unique and BB is optimal if and only if ∑i(A[i]−B[i])(D[i]−B[i])≤0\sum_i(A[i]-B[i])(D[i]-B[i])\le0 for every non-decreasing DD. For a constant B≡tB\equiv t, writing DD as D[1]D[1] plus non-negative increments shows this is equivalent to: ∑i(A[i]−t)=0\sum_i(A[i]-t)=0 and every tail sum ∑i≥j(A[i]−t)≤0\sum_{i\ge j}(A[i]-t)\le0.

    Solution

    Uniqueness: the objective is strictly convex and the set of non-decreasing arrays is convex and closed, so each approximate array is unique.

    (1-1) (B,A′[n+1])(B,A'[n+1]) is non-decreasing and costs costA(B)\mathrm{cost}_A(B). Any non-decreasing CC of length n+1n+1 costs at least costA(C[1..n])≥costA(B)\mathrm{cost}_A(C[1..n])\ge\mathrm{cost}_A(B). So the candidate is optimal, hence equal to B′B'.

    (1-2) Let cc be the constant value of BB; optimality among constants gives c=1n∑A[i]c=\frac1n\sum A[i], and the hint's tail condition gives ∑i=jn(A[i]−c)≤0\sum_{i=j}^n(A[i]-c)\le0 for j≥2j\ge2 (take D=c+δ𝟏i≥jD=c+\delta\mathbf 1_{i\ge j}). Set t=nc+A′[n+1]n+1t=\frac{nc+A'[n+1]}{n+1}, the mean of A′A'; clearly t<ct<c. The total sum ∑(A′[i]−t)=0\sum(A'[i]-t)=0. For 2≤j≤n+12\le j\le n+1, the tail sum is ∑i=jn(A[i]−c)+(n+1−j)(c−t)+(A′[n+1]−t)\sum_{i=j}^n(A[i]-c)+(n+1-j)(c-t)+(A'[n+1]-t), and the last two terms combine to (c−A′[n+1])1−jn+1<0(c-A'[n+1])\frac{1-j}{n+1}<0. So all tail sums are ≤0\le0, the constant array tt satisfies the optimality condition, and B′≡t=nB[n]+A′[n+1]n+1<B[n]B'\equiv t=\frac{nB[n]+A'[n+1]}{n+1}<B[n].

    (2) PAVA, as in the figure. Maintain a stack of blocks (sum, count). For each ii: push (A[i],1)(A[i],1); while the stack has two blocks with mean(second-to-top) >> mean(top), merge them. Output each block's mean over its range. Correctness: keep the invariant that block means increase up the stack and, inside each block with mean tt, every tail sum ∑i≥j(A[i]−t)\sum_{i\ge j}(A[i]-t) over the block is ≤0\le0. A new single-element block satisfies it. Merging a block of mean pp with the next of mean q<pq<p gives mean t∈(q,p)t\in(q,p); tails starting in the second part only gain (q−t)(q-t) per element, and tails starting in the first part change by (p−t)(tail length−|P|)≤0(p-t)(\text{tail length}-|P|)\le0, so the invariant survives (this is the computation of (1-2)). At the end, for any non-decreasing DD, each block contributes ∑(A[i]−t)D[i]≤0\sum(A[i]-t)D[i]\le0 (write DD as its first value plus non-negative increments), and ∑i(A[i]−B[i])B[i]=0\sum_i(A[i]-B[i])B[i]=0; together, ∑(A−B)(D−B)≤0\sum(A-B)(D-B)\le0, so BB is optimal. Each element is pushed once and each merge removes a block, so the running time is O(n)O(n).

    2024 Problem 5Minimum makespan

    Jobs wiw_i with lengths ℓwi∈ℕ\ell_{w_i}\in\mathbb N, each allowed only on machines Vwi⊆VV_{w_i}\subseteq V. Minimize the maximum machine load. (1) If all lengths are equal, give a polynomial-time algorithm. (2) If every Vw=VV_w=V, show the greedy rule (each job, in order, to a currently least-loaded allowed machine) has T(πALG)≤2T*T(\pi_{\mathrm{ALG}})\le2T^*.

    Solution

    (1) With common length ℓ\ell, the makespan is ℓ\ell times the largest number of jobs on one machine. For a capacity kk, build a flow network: source → each job (capacity 1), job → each allowed machine (capacity 1), machine → sink (capacity kk). An assignment with at most kk jobs per machine exists if and only if the max flow is nn (integrality of max flow). Binary search k∈{1,…,n}k\in\{1,\dots,n\}: O(log⁡n)O(\log n) max-flow computations, each polynomial. Output the assignment from the integral flow at the smallest feasible kk.

    (2) Let vv be a machine with T(πALG,v)=T(πALG)T(\pi_{\mathrm{ALG}},v)=T(\pi_{\mathrm{ALG}}), and ww the last job put on vv. When ww was placed, vv had the minimum load LL, so L≤1m∑w′≠wℓw′≤1m∑ℓ≤T*L\le\frac1m\sum_{w'\ne w}\ell_{w'}\le\frac1m\sum\ell\le T^*. Then T(πALG)=L+ℓw≤T*+T*T(\pi_{\mathrm{ALG}})=L+\ell_w\le T^*+T^*, since some machine must run ww.

    2025 Problem 5Degrees of matrix powers

    A[i,j]=xzijA[i,j]=x^{z_{ij}} for integers zijz_{ij}, Sk=∑ℓ=0kAℓS_k=\sum_{\ell=0}^kA^\ell, and Dk[i,j]D_k[i,j] is the top degree of Sk[i,j]S_k[i,j]. (1) For zij≤0z_{ij}\le0, reduce computing DnD_n to shortest paths in polynomial time. (2) Show: every entry of DkD_k converges as k→∞k\to\infty if and only if Dn[i,i]≤0D_n[i,i]\le0 for all ii. (3) Decide convergence in polynomial time. (4) With zij=sij+tijλz_{ij}=s_{ij}+t_{ij}\lambda, decide in polynomial time whether Λ={λ∈ℤ:every entry of Dk converges}\Lambda=\{\lambda\in\Z:\text{every entry of }D_k\text{ converges}\} is empty.

    Hint

    Read Dk[i,j]D_k[i,j] as the largest weight of a walk of length at most kk (length-0 walk at i=ji=j included). For (4), the condition at λ\lambda is "no cycle CC with s(C)+λt(C)>0s(C)+\lambda t(C)>0", and a positive cycle found at λ\lambda tells you which direction to move.

    Solution

    (1) By the max-plus view, Dn[i,j]=max⁡D_n[i,j]=\max weight of an i→ji\to j walk of length ≤n\le n. Make the complete digraph with edge weights cij=−zij≥0c_{ij}=-z_{ij}\ge0. With non-negative weights, a shortest walk can be taken to be a simple path (length ≤n−1\le n-1), so Dn[i,j]=−distc(i,j)D_n[i,j]=-\mathrm{dist}_c(i,j) (with dist(i,i)=0\mathrm{dist}(i,i)=0). That is n2n^2 shortest-path queries (or nn runs of Dijkstra).

    (2) DkD_k is non-decreasing in kk and integer-valued, so each entry converges if and only if it is bounded. If some closed walk has positive weight, repeating it makes Dk[i,i]→∞D_k[i,i]\to\infty. If none does, every walk decomposes into a simple path plus closed walks of weight ≤0\le0, so walk weights are bounded by the best simple path. A positive closed walk exists if and only if a positive simple cycle exists (decompose), and simple cycles have length ≤n\le n, so if and only if some Dn[i,i]>0D_n[i,i]>0. Since Dn[i,i]≥0D_n[i,i]\ge0 always, convergence ⟺Dn[i,i]≤0\iff D_n[i,i]\le0 for all ii.

    (3) Run Bellman–Ford (or Floyd–Warshall) with weights −zij-z_{ij} and report whether a negative cycle exists: O(n3)O(n^3).

    (4) Every cycle gives a linear constraint s(C)+λt(C)≤0s(C)+\lambda t(C)\le0, so Λ\Lambda is the set of integers in an interval (possibly empty or unbounded). Each breakpoint −s(C)/t(C)-s(C)/t(C) has absolute value at most M=nmax⁡|sij|M=n\max|s_{ij}|, so if Λ≠∅\Lambda\ne\emptyset it meets [−M−1,M+1][-M-1,M+1]. Binary search on that range: at the midpoint λ\lambda, run (3). If there is no positive cycle, Λ≠∅\Lambda\ne\emptyset. Otherwise Bellman–Ford returns a positive cycle CC: if t(C)=0t(C)=0, s(C)>0s(C)>0 and Λ=∅\Lambda=\emptyset; if t(C)>0t(C)>0, every λ′≥λ\lambda'\ge\lambda also fails, so search left; if t(C)<0t(C)<0, search right. This takes O(log⁡M)O(\log M) rounds of O(n3)O(n^3), polynomial in the input size.

    2026 Problem 5Acyclic orientations

    G=(V,E)G=(V,E) is simple with nn vertices and mm edges, in adjacency lists. (1) Show distinct acyclic orientations have distinct in-degree sequences. (2) In linear time, decide whether some acyclic orientation has in-degree sequence (h1,…,hn)(h_1,\dots,h_n). (3) In linear time, find an acyclic orientation minimizing the maximum in-degree. (4) In linear time, find one maximizing ∑icid(vi)\sum_ic_id(v_i).

    Solution

    (1) Induction on nn. An acyclic orientation has a source ss (in-degree 0). If two acyclic orientations share in-degrees, ss has in-degree 0 in both, so all its edges point out of ss in both. Delete ss: both orientations of G−sG-s are acyclic and have equal in-degree sequences (each neighbour of ss lost exactly one incoming edge in both). By induction they agree, so the originals agree.

    (2) Keep a counter h(v)h(v) (required in-degree from vertices not yet removed) and a queue of vertices with h=0h=0. Repeatedly pop vv, orient all its remaining edges out of vv, decrement hh of each remaining neighbour, failing if any goes negative and enqueuing any that reach 0. Answer yes if and only if all nn vertices are removed. Each edge is processed once: O(n+m)O(n+m). Correctness: if a valid orientation exists, any remaining vertex with h=0h=0 has no incoming edges from remaining vertices, so it is a source there, and removing it keeps the remaining requirements valid; the queue empties early only if no remaining vertex is a source, impossible for an acyclic orientation. If the algorithm succeeds, the orientation it built is acyclic (edges point from earlier-removed to later) with the right in-degrees.

    (3) The worked example: the degeneracy ordering, O(n+m)O(n+m).

    (4) Orient each edge uvuv towards the endpoint larger in the order (c,index)(c,\text{index}). Acyclic, attains the upper bound ∑uvmax⁡(cu,cv)\sum_{uv}\max(c_u,c_v), and O(n+m)O(n+m).

    From Kleinberg and Tardos, Algorithm Design (Pearson, 2006)

    Exercise numbers are chapter and exercise (3.3 is Exercise 3 of Chapter 3). Each is restated in our own words; the hints and solutions are written for this page.

    Exercise 3.3A topological order, or a cycle as proof that there is none

    Extend the source-removal algorithm of §3.6 so that on any directed graph it outputs either a topological ordering or a directed cycle, in O(m+n)O(m+n) time.

    Hint

    If the algorithm gets stuck, every remaining node has an incoming edge from another remaining node. Follow those edges backwards.

    Solution

    Keep in-degree counters and a queue of nodes with count 0; repeatedly remove one, output it, and decrement its out-neighbours. If all nn nodes are output, that is a topological order. If the queue empties early, every remaining node vv has an edge (u,v)(u,v) with uu remaining. Start anywhere among them and repeatedly step to such a predecessor, marking nodes; within nn steps a node repeats, and the nodes between its two visits, reversed, form a directed cycle. Everything is a constant amount of work per node and edge: O(m+n)O(m+n). This is the certificate pattern that 2026 P5(2) uses: the peeling algorithm either succeeds or shows exactly why no answer exists.

    Exercise 6.13Arbitrage: a cycle whose product exceeds 1

    For nn assets, one unit of ii trades for rijr_{ij} units of jj. An opportunity cycle is a cycle of trades along which the product of the ratios exceeds 1. Give a polynomial-time algorithm that finds one if it exists.

    Hint

    Logarithms turn products into sums.

    Solution

    Give edge (i,j)(i,j) the cost cij=−log⁡rijc_{ij}=-\log r_{ij}. A cycle has ∏rij>1\prod r_{ij}>1 exactly when ∑cij<0\sum c_{ij}<0, so opportunity cycles are negative cycles. Add a source joined to every node at cost 0 and run Bellman–Ford for nn rounds (§6.10): if some distance still improves in round nn, a negative cycle exists, and following predecessor pointers from an improved node recovers it. Time O(n3)O(n^3) on the complete graph. Compare 2025 P5: there the weights are exponents zijz_{ij}, the question is whether a cycle has positive total weight, and the same detection with costs −zij-z_{ij} answers it.

    Exercise 11.5Why greedy is much better than 2 in practice

    Ten machines run Greedy-Balance (§11.1). Every job has length 1≤ti≤501\le t_i\le50, and the total load ∑ti\sum t_i is always at least 3,000. Prove that the makespan is never more than 20% above the average load 110∑ti\frac1{10}\sum t_i.

    Hint

    The proof of (11.3) actually shows T≤1m∑ti+max⁡tiT\le\frac1m\sum t_i+\max t_i, which is sharper than 2T*2T^*.

    Solution

    Let A=110∑ti≥300A=\frac1{10}\sum t_i\ge300. Take the busiest machine and the last job jj put on it. When jj arrived that machine had the least load, at most AA, so T≤A+tj≤A+50≤A+A6=76A<1.2AT\le A+t_j\le A+50\le A+\frac A6=\frac76A<1.2A. The factor 2 is only approached when one job is comparable to the whole average load; with many small jobs, greedy is nearly optimal. Bounds in terms of the instance, not just worst-case ratios, are what you need when an exam part asks you to explain observed behaviour.

    Calculator2020 P3, 2023 P5

    Algebra and number representations

    Algebra appears less often, but when it does the problems reward the same habit: find a normal form. Every polynomial reduces to one in which xix_i and yiy_i never meet; every integer has exactly one signed binary expansion with no two adjacent nonzero digits.

    The idea

    Ideals and homomorphisms. For a ring homomorphism φ:R→L\varphi:R\to L, the preimage of an ideal is an ideal, ker⁡φ\ker\varphi is an ideal, and if φ\varphi is onto, L≅R/ker⁡φL\cong R/\ker\varphi (first isomorphism theorem).

    Normal forms prove kernels. To show ker⁡φ=I\ker\varphi=I for an explicit ideal I=(g1,…,gn)I=(g_1,\dots,g_n): first I⊆ker⁡φI\subseteq\ker\varphi (check the generators). For the other inclusion, show every pp can be written p=∑higi+rp=\sum h_ig_i+r with rr in a set of "reduced" polynomials on which φ\varphi is injective. This is the idea behind Gröbner bases: {xiyi−1}\{x_iy_i-1\} is one, and its normal forms are the polynomials in which no monomial contains both xix_i and yiy_i.

    Signed binary. A ternary (signed-digit) representation of dd is d=∑i=0ndi2id=\sum_{i=0}^nd_i2^i with di∈{−1,0,1}d_i\in\{-1,0,1\} and dn=1d_n=1. It is sparse, the non-adjacent form (NAF), if di−1di=0d_{i-1}d_i=0 for all ii.
    The NAF rule. If dd is even, the last digit is 0. If dd is odd, it is +1+1 when d≡1(mod4)d\equiv1\pmod4 and −1-1 when d≡3(mod4)d\equiv3\pmod4, which makes (d−d0)/2(d-d_0)/2 even, so the next digit is 0. Repeating this on (d−d0)/2(d-d_0)/2 builds the NAF; there is no choice at any step, which proves uniqueness. It has the fewest nonzero digits of any signed representation, and about one third of its digits are nonzero on average, against one half for binary.

    Why it matters. In elliptic-curve cryptography, computing dPdP by double-and-add costs one addition per nonzero digit; negating a point is free, so the NAF cuts the additions from about n/2n/2 to n/3n/3. The department's cryptography group works on exactly this kind of efficiency question, alongside post-quantum schemes.

    Explore

    Worked example

    Find the NAF of d=59d=59 (binary 111011111011, five nonzero digits).

    1. 59≡3(mod4)59\equiv3\pmod4. What are d0d_0 and the next number?

      d0=−1d_0=-1 and (59+1)/2=30(59+1)/2=30.

    2. Continue: 3030, then what?

      3030 is even: d1=0d_1=0, next 1515. 15≡3(mod4)15\equiv3\pmod4: d2=−1d_2=-1, next 88. Then 8,4,28,4,2 give d3=d4=d5=0d_3=d_4=d_5=0, and 11 gives d6=1d_6=1.

    3. Write the result and check it.

      (d0,…,d6)=(−1,0,−1,0,0,0,1)(d_0,\dots,d_6)=(-1,0,-1,0,0,0,1): 64−4−1=5964-4-1=59. Three nonzero digits instead of five, and no two adjacent.

    Check your understanding

    What is the NAF of 7?

    1. 1,1,11,1,1 (that is, 4+2+14+2+1)Adjacent nonzero digits aren't allowed.
    2. 8−18-1: digits (−1,0,0,1)(-1,0,0,1)
    3. 8−2+18-2+1Correct value, but −2+1-2+1 puts nonzero digits side by side.
    7≡3(mod4)7\equiv3\pmod4 gives d0=−1d_0=-1, then 4→2→14\to2\to1. Runs of ones become one +1+1 and one −1-1.

    In 2020 P3, why is φ\varphi (substituting yi=xi−1y_i=x_i^{-1}) injective on polynomials where no monomial contains both xix_i and yiy_i?

    1. Distinct such monomials map to distinct Laurent monomials.
    2. Because φ\varphi is a ring homomorphism.It isn't injective on all of RR: x1y1−1↦0x_1y_1-1\mapsto0.
    3. Because KK is a field.The field matters for linear independence of monomials, but the key is the exponent bookkeeping.
    ∏xiaiyibi↦∏xiai−bi\prod x_i^{a_i}y_i^{b_i}\mapsto\prod x_i^{a_i-b_i}, and when aibi=0a_ib_i=0 the exponent ai−bia_i-b_i determines both aia_i and bib_i. Since distinct Laurent monomials are linearly independent over KK, φ(r)=0\varphi(r)=0 forces r=0r=0.

    The largest number with an (n+1)(n+1)-digit NAF, LnL_n, equals:

    1. ⌊2n+2/3⌋\lfloor2^{n+2}/3\rfloor
    2. 2n+1−12^{n+1}-1That is the largest with n+1n+1 binary digits; it needs a NAF digit at position n+1n+1.
    3. 2n2^nToo small: 2n+2n−2+…2^n+2^{n-2}+\dots is allowed.
    Take dn=1d_n=1 and alternate 0,1,0,1,…0,1,0,1,\dots downwards: 2n+2n−2+…2^n+2^{n-2}+\dots. For nn even this is (2n+2−1)/3(2^{n+2}-1)/3; for nn odd, (2n+2−2)/3(2^{n+2}-2)/3.

    Practice

    Past problems

    Restated in our own words. Official statements: 2020, 2023.

    2020 Problem 3Laurent polynomials as a quotient ring

    L=K[x1±1,…,xn±1]L=K[x_1^{\pm1},\dots,x_n^{\pm1}], R=K[x1,…,xn,y1,…,yn]R=K[x_1,\dots,x_n,y_1,\dots,y_n], and φ:R→L\varphi:R\to L substitutes yi=xi−1y_i=x_i^{-1}. (1) Show φ−1(J)\varphi^{-1}(J) is an ideal for every ideal JJ of LL. (2) With gi=xiyi−1g_i=x_iy_i-1 and R′R' the polynomials in which no monomial contains both xix_i and yiy_i (for every ii), show every p∈Rp\in R is ∑higi+r\sum h_ig_i+r with r∈R′r\in R'. (3) For I=(g1,…,gn)I=(g_1,\dots,g_n), show ker⁡φ=I\ker\varphi=I and L≅R/IL\cong R/I.

    Solution

    (1) If a,b∈φ−1(J)a,b\in\varphi^{-1}(J) and s∈Rs\in R: φ(a−b)=φ(a)−φ(b)∈J\varphi(a-b)=\varphi(a)-\varphi(b)\in J and φ(sa)=φ(s)φ(a)∈J\varphi(sa)=\varphi(s)\varphi(a)\in J. Also 0∈φ−1(J)0\in\varphi^{-1}(J).

    (2) For a monomial uxiayibu\,x_i^ay_i^b with a,b≥1a,b\ge1: xiayib=xia−1yib−1(gi+1)x_i^ay_i^b=x_i^{a-1}y_i^{b-1}(g_i+1), so uxiayib≡uxia−1yib−1u\,x_i^ay_i^b\equiv u\,x_i^{a-1}y_i^{b-1} modulo a multiple of gig_i. Each replacement lowers ∑imin⁡(ai,bi)\sum_i\min(a_i,b_i) for that monomial, so after finitely many steps (induction on this quantity, summed over monomials) every monomial is in R′R', and the multiples of gig_i collected along the way give the hih_i.

    (3) φ(gi)=xixi−1−1=0\varphi(g_i)=x_ix_i^{-1}-1=0, so I⊆ker⁡φI\subseteq\ker\varphi. Conversely let φ(p)=0\varphi(p)=0 and write p=∑higi+rp=\sum h_ig_i+r by (2). Then φ(r)=0\varphi(r)=0. As in the quiz above, φ\varphi maps distinct monomials of R′R' to distinct Laurent monomials, which are linearly independent over KK, so r=0r=0 and p∈Ip\in I. φ\varphi is onto, since xi−1=φ(yi)x_i^{-1}=\varphi(y_i) and φ\varphi is a homomorphism, so L≅R/IL\cong R/I by the first isomorphism theorem.

    2023 Problem 5The non-adjacent form

    (1) Find the largest LnL_n with a sparse ternary representation (d0,…,dn)(d_0,\dots,d_n). (2) Show the sparse representation of each dd is unique. (3) Give an O(log⁡d)O(\log d) algorithm from binary to sparse ternary. (4) Show the sparse representation has the fewest nonzero digits among all ternary representations of dd. (5) For XnX_n uniform on {1,…,Ln}\{1,\dots,L_n\} and YnY_n the number of nonzero digits of its sparse representation, show E[Yn]/n→13E[Y_n]/n\to\tfrac13.

    Hint

    (4) Let W(d)W(d) be the minimum weight over all signed representations. Show W(x)≤W(y)+1W(x)\le W(y)+1 when |x−y|=1|x-y|=1, and that when dd is odd, W(d)=1+min⁡(W(d−12),W(d+12))W(d)=1+\min(W(\frac{d-1}2),W(\frac{d+1}2)) is attained by the even neighbour. (5) Count digit strings built from blocks "0" and "±1\pm1 then 0".

    Solution

    (1) Greedy from the top: dn=1d_n=1, dn−1=0d_{n-1}=0, dn−2=1,…d_{n-2}=1,\dots This is the maximum: sparsity forces dn−1=0d_{n-1}=0, so d≤2n+Ln−2d\le2^n+L_{n-2} (with L−1=0L_{-1}=0, L0=1L_0=1), and induction gives Ln=2n+2n−2+⋯L_n=2^n+2^{n-2}+\cdots. Ln=⌊2n+2/3⌋L_n=\lfloor2^{n+2}/3\rfloor.

    (2) Induction on dd. d0≡d(mod2)d_0\equiv d\pmod2. If dd is even, d0=0d_0=0. If dd is odd, d0=±1d_0=\pm1 and sparsity forces d1=0d_1=0, so d≡d0(mod4)d\equiv d_0\pmod4, fixing d0d_0. Then (d1,…,dn)(d_1,\dots,d_n) is a sparse representation of (d−d0)/2(d-d_0)/2, which is a smaller positive integer for d≥2d\ge2 (and d=1d=1 has only (1)(1)). By induction it is unique.

    (3) Scan the bits b0,b1,…b_0,b_1,\dots of dd with a carry c∈{0,1}c\in\{0,1\}. At position ii let t=bi+ct=b_i+c. If t=0t=0: digit 0, carry 0. If t=2t=2: digit 0, carry 1. If t=1t=1: digit +1+1, carry 0 when bi+1=0b_{i+1}=0; digit −1-1, carry 1 when bi+1=1b_{i+1}=1. Continue past the top bit until the carry is 0. This is the mod-4 rule applied to the running value, with O(1)O(1) work per bit, so O(log⁡d)O(\log d) in total.

    (4) A signed representation can be seen as a multiset of terms ±2i\pm2^i; combining equal or opposite terms never increases the count, so WW is the same whether or not repeated positions are allowed. Adding one term ±1\pm1 shows W(x)≤W(y)+1W(x)\le W(y)+1 for |x−y|=1|x-y|=1. For even dd, any representation has d0=0d_0=0, so W(d)=W(d/2)W(d)=W(d/2). For odd dd, W(d)=1+min⁡(W(a),W(b))W(d)=1+\min(W(a),W(b)) where a,b=(d∓1)/2a,b=(d\mp1)/2; one, say aa, is even. Then bb is odd and W(b)=1+min⁡(W(b−12),W(b+12))W(b)=1+\min(W(\frac{b-1}2),W(\frac{b+1}2)); one of these arguments is a/2a/2 and the other is a/2±1a/2\pm1, so by the lemma W(b)≥1+(W(a/2)−1)=W(a)W(b)\ge1+(W(a/2)-1)=W(a). Hence the minimum is always attained at the even neighbour, which is exactly the NAF's choice, and by induction the NAF has weight W(d)W(d).

    (5) The numbers 1,…,Ln1,\dots,L_n are exactly those whose NAF has at most n+1n+1 digits. Reading from the bottom, a NAF of length at most n+1n+1 (allowing leading zeros, with the top nonzero digit +1+1) is a sequence of blocks "0" (length 1) and "±1\pm10" (length 2, two choices). The number of block sequences of length ℓ\ell satisfies aℓ=aℓ−1+2aℓ−2a_\ell=a_{\ell-1}+2a_{\ell-2}, growing like 2ℓ2^\ell. In a long uniformly random such sequence, each block is "0" with probability 1⋅2−1=121\cdot2^{-1}=\tfrac12 and "±1\pm10" with probability 2⋅2−2=122\cdot2^{-2}=\tfrac12, independently in the limit, so a block has mean length 32\tfrac32 and carries 12\tfrac12 nonzero digit on average: a density of 13\tfrac13. Making this precise with the generating function ∑ℓaℓ(u)zℓ=1/(1−z−2uz2)\sum_\ell a_\ell(u)z^\ell=1/(1-z-2uz^2) (uu marks nonzero digits) and differentiating in uu at u=1u=1 gives E[Yn]=n3+O(1)E[Y_n]=\tfrac n3+O(1); the sign constraint on the top digit and the boundary change only the O(1)O(1) term.

    Play it yourself2026 doctoral papers (summer and winter)

    The doctoral keyword essay

    The doctoral written exam is different in kind: ninety minutes, a list of keywords, and you explain three of them. It rewards the ability to state things precisely and connect them, which is also what the oral exam probes.

    The idea

    Format (2026 papers, 2027 guide). Online, 90 minutes. Choose three keywords from a list (ten in summer 2026, six in winter 2026). For each, describe its mathematical-informatics side: definition, relevant theorems, examples and applications, in at most three pages, each keyword on separate pages. Answer in Japanese or English. Applicants finishing a UTokyo master's may be exempted; the application also requires a research report of up to ten pages, an English summary and a two-page Q&A on aims, methods, state of the field, novelty and contribution.

    The department says the doctoral paper tests whether you can describe and explain advanced topics across the fields of mathematical informatics. In practice that means 30 minutes per keyword, and a fixed shape for every answer:

    1. Definition, with symbols

      One precise definition, with every symbol introduced. If there are two standard formulations (primal/dual, discrete/continuous), give the one you will use and mention the other.

    2. One theorem, stated exactly

      Hypotheses and conclusion, with a proof or proof idea in a few lines. A precise statement of one theorem beats vague mentions of five.

    3. A small example, worked

      Numbers, a picture, or a two-variable case that the reader can check. This is where understanding shows.

    4. Algorithms and complexity

      How you compute it, and how fast. Most keywords on these lists are methods, so this is often half the answer.

    5. Applications and connections

      Two concrete applications and one link to another keyword on the list (LP duality ↔ interior point methods ↔ minimum-cost flow; diffusion models ↔ Lévy processes and MCMC; optimal control ↔ reinforcement learning ↔ state space models).

    Drill

    Draw from
    1:30:00
    Tick each part of the outline as you write it. In the real exam you choose your three from the whole list, so spend the first few minutes choosing the ones where you can state a theorem exactly.

    Worked example

    Outline an answer for "linear programming duality" in the five-part shape.

    1. Definition.

      Primal max⁡{c⊤x:Ax≤b, x≥0}\max\{c^\top x:Ax\le b,\ x\ge0\}, dual min⁡{b⊤y:A⊤y≥c, y≥0}\min\{b^\top y:A^\top y\ge c,\ y\ge0\}. The dual arises by bounding the primal objective with non-negative combinations of the constraints: if A⊤y≥cA^\top y\ge c, y≥0y\ge0, then c⊤x≤y⊤Ax≤y⊤bc^\top x\le y^\top Ax\le y^\top b.

    2. Theorems.

      Weak duality (the line above). Strong duality: if either problem has a finite optimum, both do and the optima are equal; proof via Farkas' lemma (a separating hyperplane argument), or as a by-product of the simplex method. Complementary slackness: feasible x,yx,y are both optimal if and only if yi(b−Ax)i=0y_i(b-Ax)_i=0 and xj(A⊤y−c)j=0x_j(A^\top y-c)_j=0 for all i,ji,j.

    3. Example.

      max⁡x1+x2\max\,x_1+x_2 s.t. x1+2x2≤4x_1+2x_2\le4, 3x1+x2≤63x_1+x_2\le6, x≥0x\ge0. Optimum x=(1.6,1.2)x=(1.6,1.2), value 2.82.8. Dual min⁡4y1+6y2\min\,4y_1+6y_2 s.t. y1+3y2≥1y_1+3y_2\ge1, 2y1+y2≥12y_1+y_2\ge1, y≥0y\ge0: y=(0.4,0.2)y=(0.4,0.2), value 2.82.8. Both primal constraints are tight and both yi>0y_i>0, as complementary slackness requires. Read yiy_i as the marginal value of resource ii (shadow prices).

    4. Algorithms.

      The simplex method maintains primal feasibility and finishes when the implied dual is feasible. Interior point methods follow the central path xjsj=μx_js_j=\mu (with s=A⊤y−cs=A^\top y-c) as μ→0\mu\to0, shrinking the duality gap c⊤xc^\top x-vs-b⊤yb^\top y, in polynomial time. Duality gaps are the standard stopping certificate.

    5. Applications and connections.

      Max-flow min-cut and König's theorem are LP duality for totally unimodular matrices. Minimum-cost flow optimality is complementary slackness with node potentials. In game theory, von Neumann's minimax theorem is LP duality; in machine learning, the SVM dual leads to kernels. Lagrangian duality and KKT conditions generalize it to convex programs.

    Check your understanding

    When does strong duality hold for a linear program?

    1. Whenever the primal (or the dual) has a finite optimum.
    2. Only under Slater's condition.Slater's condition is needed for general convex programs, not for LPs.
    3. Only when the optimal solution is unique.Uniqueness is irrelevant.
    For LPs, feasibility and boundedness suffice. If the primal is unbounded the dual is infeasible, and both can be infeasible at once.

    Why does the Metropolis–Hastings chain have the target π\pi as its stationary distribution?

    1. Its acceptance probability makes the chain satisfy detailed balance with respect to π\pi.
    2. Because the proposal distribution equals π\pi.The proposal can be almost anything; that is the point.
    3. Because it is irreducible.Irreducibility gives uniqueness and convergence, not which distribution is stationary.
    π(x)q(x,y)α(x,y)=min⁡(π(x)q(x,y),π(y)q(y,x))\pi(x)q(x,y)\alpha(x,y)=\min(\pi(x)q(x,y),\pi(y)q(y,x)) is symmetric in x,yx,y, so π\pi is reversible and stationary. Add irreducibility and aperiodicity for convergence, and only ratios π(y)/π(x)\pi(y)/\pi(x) are needed, so the normalizing constant can be unknown.

    A positive largest Lyapunov exponent for a dynamical system indicates:

    1. sensitive dependence on initial conditions: nearby orbits separate exponentially
    2. an asymptotically stable fixed pointThat has all exponents negative.
    3. that a Lyapunov function existsDifferent Lyapunov idea: Lyapunov functions certify stability.
    λ=lim⁡1tlog⁡‖DΦt(x)v‖\lambda=\lim\frac1t\log\lVert D\Phi_t(x)v\rVert. For the logistic map at r=4r=4, λ=log⁡2\lambda=\log2. Keep the two Lyapunov notions apart in an essay; the contrast is worth a sentence.

    Practice

    Model outlines

    Write your own first, then compare. Each is the skeleton of a three-page answer, not the answer.

    Markov chain Monte Carlo2026 summer
    Outline
    • Definition: sample from π\pi (known up to a constant) by running a Markov chain with stationary distribution π\pi; estimate EπfE_\pi f by ergodic averages.
    • Theorems: detailed balance ⇒ stationarity; ergodic theorem for irreducible aperiodic chains; convergence in total variation at a rate set by the spectral gap; a CLT for ergodic averages with asymptotic variance involving the autocorrelation.
    • Example: random-walk Metropolis on a 1D bimodal density; show slow mixing between modes, cured by tempering.
    • Algorithms: Metropolis–Hastings, Gibbs sampling, Hamiltonian Monte Carlo, Langevin (link to diffusion models). Diagnostics: effective sample size, R^\hat R.
    • Applications: Bayesian posteriors, the Ising model, counting via rapidly mixing chains.
    Proximal gradient descent2026 winter
    Outline
    • Definition: for F=f+gF=f+g, ff LL-smooth convex, gg closed convex, xk+1=proxg/L(xk−∇f(xk)/L)x_{k+1}=\mathrm{prox}_{g/L}(x_k-\nabla f(x_k)/L).
    • Theorems: prox is firmly non-expansive; F(xk)−F*≤L‖x0−x*‖2/(2k)F(x_k)-F^*\le L\lVert x_0-x^*\rVert^2/(2k); FISTA accelerates to O(1/k2)O(1/k^2) (energy argument as in 2024 P2); linear rate under strong convexity.
    • Example: lasso, where the prox is soft-thresholding (ISTA). Work one step by hand.
    • Connections: projected gradient (gg an indicator), the PSD projection of 2026 P1, ADMM, mirror descent.
    • Applications: sparse regression, compressed sensing, matrix completion with the nuclear norm (prox = singular value thresholding).
    Minimum-cost flow problem2026 winter
    Outline
    • Definition: directed graph, capacities uu, costs cc, supplies bb; minimize ∑cexe\sum c_ex_e over flows with 0≤x≤u0\le x\le u and conservation.
    • Theorems: optimal iff the residual graph has no negative-cost cycle; equivalently, there are node potentials pp with reduced costs ce+pu−pv≥0c_e+p_u-p_v\ge0 on residual arcs (LP duality); integrality for integer data (total unimodularity).
    • Example: a four-node network; cancel one negative cycle by hand.
    • Algorithms: cycle cancelling, successive shortest paths with potentials (Dijkstra), cost scaling; strongly polynomial algorithms exist (Tardos, Orlin).
    • Applications: transportation and assignment, optimal transport, image segmentation via cuts; special cases are shortest path and max flow.
    Diffie–Hellman key exchange2026 summer
    Outline
    • Definition: in a cyclic group G=⟨g⟩G=\langle g\rangle of order qq, Alice sends gag^a, Bob sends gbg^b, both compute gabg^{ab}.
    • Theorems: security rests on the computational/decisional Diffie–Hellman assumptions, implied to be no harder than discrete log; generic-group lower bound Ω(q)\Omega(\sqrt q); Pohlig–Hellman shows why qq needs a large prime factor.
    • Example: p=23p=23, g=5g=5, a=6a=6, b=15b=15: shared key 22.
    • Algorithms: fast exponentiation (signed digits, see module 9), elliptic-curve groups for shorter keys; attacks by baby-step giant-step, Pollard rho, index calculus in 𝔽p*\mathbb F_p^*.
    • Applications and connections: TLS key exchange; man-in-the-middle needs authentication; Shor's algorithm breaks it, motivating post-quantum cryptography (another keyword on the list).
    State space model2026 winter
    Outline
    • Definition: hidden state xt=Fxt−1+wtx_t=Fx_{t-1}+w_t, observation yt=Hxt+vty_t=Hx_t+v_t (linear Gaussian), or general p(xt|xt−1)p(x_t\mid x_{t-1}), p(yt|xt)p(y_t\mid x_t).
    • Theorems: the Kalman filter computes p(xt|y1:t)p(x_t\mid y_{1:t}) exactly in the linear Gaussian case; observability and controllability; the Riccati recursion and its steady state.
    • Example: tracking position and velocity from noisy positions; write one predict–update step.
    • Algorithms: Kalman filter and RTS smoother, EM for parameters, extended/unscented Kalman filters, particle filters (sequential Monte Carlo).
    • Connections: optimal control (LQG duality with LQR), hidden Markov models, recent deep state space models for sequences.