Level 3 — ProductionAdvanced Topics (Elite Level)

Advanced Topics (Elite Level)

45 minutes60 marksprintable — key stays hidden on paper

Level 3 — Production: from-scratch derivations, code-from-memory, explain-out-loud Time limit: 45 minutes Total marks: 60


Q1. (10 marks) — Euler–Lagrange derivation (from scratch). Consider a functional J[y]=abF(x,y,y)dxJ[y] = \int_{a}^{b} F(x, y, y')\,dx with fixed endpoints y(a)=yay(a)=y_a, y(b)=yby(b)=y_b. (a) Introduce a variation yy+εηy \to y + \varepsilon\eta with η(a)=η(b)=0\eta(a)=\eta(b)=0 and derive the first-order condition δJ=0\delta J = 0, obtaining the Euler–Lagrange equation. State clearly where integration by parts and the fundamental lemma of the calculus of variations are used. (7) (b) Show that if FF does not depend explicitly on xx, then FyF/yF - y'\,\partial F/\partial y' is conserved (the Beltrami identity). (3)

Q2. (12 marks) — Residue theorem for a real integral. Evaluate I=dxx4+1I = \int_{-\infty}^{\infty} \frac{dx}{x^4 + 1} using contour integration. (a) Explain the choice of contour and justify that the arc contribution vanishes. (4) (b) Identify the poles inside the contour and compute the relevant residues. (6) (c) State the final value of II. (2)

Q3. (10 marks) — Cauchy–Riemann and analyticity (explain-out-loud). (a) State the Cauchy–Riemann equations for f(z)=u(x,y)+iv(x,y)f(z)=u(x,y)+iv(x,y) and explain, in words, why they (together with continuity of partials) guarantee complex differentiability. (4) (b) Determine whether f(z)=zz=z2f(z) = z\,\overline{z} = |z|^2 is analytic anywhere. Justify using CR equations. (3) (c) For u(x,y)=x2y2u(x,y) = x^2 - y^2, find a harmonic conjugate vv so that f=u+ivf=u+iv is analytic, and identify f(z)f(z) in terms of zz. (3)

Q4. (10 marks) — Markov chain steady state (code-from-memory + math). A random walker moves on 3 states with transition matrix (rows = from, columns = to) P=(0.50.500.250.50.2500.50.5).P = \begin{pmatrix} 0.5 & 0.5 & 0 \\ 0.25 & 0.5 & 0.25 \\ 0 & 0.5 & 0.5 \end{pmatrix}. (a) Write the stationary distribution condition πP=π\pi P = \pi, iπi=1\sum_i \pi_i = 1, and solve for π\pi. (6) (b) Write pseudocode (or Python) that computes the steady state numerically by power iteration, and explain when this converges. (4)

Q5. (10 marks) — Metric tensor / index gymnastics (from scratch). In 2D polar coordinates (r,θ)(r,\theta) the line element is ds2=dr2+r2dθ2ds^2 = dr^2 + r^2\,d\theta^2. (a) Write the metric tensor gijg_{ij} and its inverse gijg^{ij}. (3) (b) Using the Einstein summation convention, given a covariant vector Ai=(Ar,Aθ)A_i = (A_r, A_\theta), write the contravariant components Ai=gijAjA^i = g^{ij}A_j explicitly. (3) (c) Compute the Christoffel symbol Γθθr\Gamma^{r}_{\theta\theta} from Γijk=12gkl(iglj+jglilgij)\Gamma^{k}_{ij} = \tfrac12 g^{kl}(\partial_i g_{lj} + \partial_j g_{li} - \partial_l g_{ij}). (4)

Q6. (8 marks) — Uniform vs pointwise (explain-out-loud) + KKT. (a) Give the precise ε\varepsilonδ\delta definitions of pointwise and uniform convergence of fnff_n \to f on a set, and state the key structural difference. Use fn(x)=xnf_n(x)=x^n on [0,1][0,1] to illustrate non-uniformity. (4) (b) State the KKT conditions for minimizing f(x)f(x) subject to gi(x)0g_i(x)\le 0 and hj(x)=0h_j(x)=0. Name each condition. (4)


End of paper.

Answer keyMark scheme & solutions

Q1 (10)

(a) Let y(x)+εη(x)y(x)+\varepsilon\eta(x), η(a)=η(b)=0\eta(a)=\eta(b)=0. Define Φ(ε)=abF(x,y+εη,y+εη)dx\Phi(\varepsilon)=\int_a^b F(x,y+\varepsilon\eta, y'+\varepsilon\eta')dx. (1) Necessary condition for extremum: Φ(0)=0\Phi'(0)=0. Differentiate under integral: Φ(0)=ab(Fyη+Fyη)dx=0.\Phi'(0)=\int_a^b\left(\frac{\partial F}{\partial y}\eta + \frac{\partial F}{\partial y'}\eta'\right)dx=0. (2) Integrate the second term by parts: abFyηdx=[Fyη]ababddx ⁣(Fy)ηdx.\int_a^b \frac{\partial F}{\partial y'}\eta'\,dx = \Big[\frac{\partial F}{\partial y'}\eta\Big]_a^b - \int_a^b \frac{d}{dx}\!\left(\frac{\partial F}{\partial y'}\right)\eta\,dx. Boundary term vanishes since η(a)=η(b)=0\eta(a)=\eta(b)=0. (2) Hence ab(FyddxFy)ηdx=0\int_a^b\left(\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'}\right)\eta\,dx=0 for all admissible η\eta. By the fundamental lemma (integrand continuous, arbitrary η\eta), the bracket is identically zero: (1) FyddxFy=0.\boxed{\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} = 0.} (1)

(b) Compute ddx ⁣(FyFy)=Fx+Fyy+FyyyFyyddxFy\frac{d}{dx}\!\left(F - y'\frac{\partial F}{\partial y'}\right) = F_x + F_y y' + F_{y'}y'' - y''F_{y'} - y'\frac{d}{dx}F_{y'} =Fx+y(FyddxFy)= F_x + y'\big(F_y - \frac{d}{dx}F_{y'}\big). (2) The bracket is zero by E-L, so if Fx=0F_x=0 then the derivative is 0FyFy=0 \Rightarrow F - y'F_{y'}=const. (1)


Q2 (12)

(a) Use upper-half-plane semicircle: segment [R,R][-R,R] plus arc of radius RR. On the arc z4+1R41|z^4+1|\ge R^4-1 so arcπR/(R41)0|\int_{arc}|\le \pi R/(R^4-1)\to 0 as RR\to\infty. (4)

(b) Poles: z4=1z=eiπ/4,ei3π/4,ei5π/4,ei7π/4z^4=-1 \Rightarrow z=e^{i\pi/4}, e^{i3\pi/4}, e^{i5\pi/4}, e^{i7\pi/4}. In UHP: z1=eiπ/4z_1=e^{i\pi/4}, z2=ei3π/4z_2=e^{i3\pi/4}. (2) Residue at simple pole zkz_k: 14zk3=zk4zk4=zk4\dfrac{1}{4z_k^3} = \dfrac{z_k}{4z_k^4} = \dfrac{z_k}{-4} (since zk4=1z_k^4=-1). (2) Resz1+Resz2=14(eiπ/4+ei3π/4)=14(22(1+i)+22(1+i))\text{Res}_{z_1}+\text{Res}_{z_2} = -\tfrac14(e^{i\pi/4}+e^{i3\pi/4}) = -\tfrac14(\tfrac{\sqrt2}{2}(1+i) + \tfrac{\sqrt2}{2}(-1+i)) =14i2=i24= -\tfrac14\cdot i\sqrt2 = -\tfrac{i\sqrt2}{4}. (2)

(c) I=2πiRes=2πi(i24)=2π24=π2=π22.I = 2\pi i \sum \text{Res} = 2\pi i\cdot(-\tfrac{i\sqrt2}{4}) = \dfrac{2\pi\sqrt2}{4} = \boxed{\dfrac{\pi}{\sqrt2} = \dfrac{\pi\sqrt2}{2}}. (2)


Q3 (10)

(a) CR: ux=vyu_x=v_y, uy=vxu_y=-v_x. (2) Complex differentiability requires the limit f(z+h)f(z)h\frac{f(z+h)-f(z)}{h} be independent of direction of hh. Equating limits along real and imaginary directions yields CR; with continuity of partials these become sufficient for differentiability. (2)

(b) f=z2=x2+y2f=|z|^2 = x^2+y^2, so u=x2+y2u=x^2+y^2, v=0v=0. Then ux=2xu_x=2x, vy=0v_y=0: CR needs 2x=02x=0; uy=2yu_y=2y, vx=0-v_x=0: needs 2y=02y=0. Both hold only at (0,0)(0,0). So ff is complex-differentiable only at z=0z=0, nowhere analytic (analyticity needs a neighborhood). (3)

(c) u=x2y2u=x^2-y^2. vy=ux=2xv=2xy+g(x)v_y=u_x=2x \Rightarrow v=2xy+g(x); vx=2y+g(x)v_x=2y+g'(x) must equal uy=2yg=0-u_y=2y \Rightarrow g'=0. So v=2xyv=2xy (+const). f=x2y2+2ixy=(x+iy)2=z2f=x^2-y^2+2ixy=(x+iy)^2=z^2. (3)


Q4 (10)

(a) Solve πP=π\pi P=\pi: with π=(a,b,c)\pi=(a,b,c):

  • a=0.5a+0.25ba = 0.5a+0.25b
  • b=0.5a+0.5b+0.5cb = 0.5a+0.5b+0.5c
  • c=0.25b+0.5cc = 0.25b+0.5c From first: 0.5a=0.25bb=2a0.5a=0.25b\Rightarrow b=2a. From third: 0.5c=0.25bb=2ca=c0.5c=0.25b\Rightarrow b=2c\Rightarrow a=c. (3) Normalize a+b+c=1a+b+c=1: a+2a+a=4a=1a=1/4a+2a+a=4a=1\Rightarrow a=1/4, b=1/2b=1/2, c=1/4c=1/4. π=(14,12,14).\boxed{\pi=(\tfrac14,\tfrac12,\tfrac14).} (3)

(b)

import numpy as np
P = np.array([[.5,.5,0],[.25,.5,.25],[0,.5,.5]])
pi = np.array([1/3,1/3,1/3])
for _ in range(1000):
    pi = pi @ P
print(pi)  # -> [0.25 0.5 0.25]

Converges because the chain is irreducible and aperiodic (regular), so PnP^n tends to a rank-1 matrix with rows π\pi; power iteration converges at rate governed by second-largest λ|\lambda|. (4)


Q5 (10)

(a) gij=(100r2)g_{ij}=\begin{pmatrix}1&0\\0&r^2\end{pmatrix}, gij=(1001/r2)g^{ij}=\begin{pmatrix}1&0\\0&1/r^2\end{pmatrix}. (3)

(b) Ar=grrAr=ArA^r=g^{rr}A_r=A_r, Aθ=gθθAθ=Aθ/r2A^\theta=g^{\theta\theta}A_\theta=A_\theta/r^2. (3)

(c) Γθθr=12grl(θglθ+θglθlgθθ)\Gamma^r_{\theta\theta}=\tfrac12 g^{rl}(\partial_\theta g_{l\theta}+\partial_\theta g_{l\theta}-\partial_l g_{\theta\theta}). Only l=rl=r contributes (grr=1g^{rr}=1): =12(2θgrθrgθθ)=12(0rr2)=12(2r)=r.=\tfrac12(2\partial_\theta g_{r\theta}-\partial_r g_{\theta\theta}) = \tfrac12(0 - \partial_r r^2)=\tfrac12(-2r)=\boxed{-r}. (4)


Q6 (8)

(a) Pointwise: xε>0N(x,ε)\forall x\,\forall\varepsilon>0\,\exists N(x,\varepsilon) s.t. nNfn(x)f(x)<εn\ge N\Rightarrow|f_n(x)-f(x)|<\varepsilon. (1) Uniform: ε>0N(ε)\forall\varepsilon>0\,\exists N(\varepsilon) (independent of xx) s.t. nNsupxfn(x)f(x)<εn\ge N\Rightarrow \sup_x|f_n(x)-f(x)|<\varepsilon. (1) Difference: NN works uniformly across all xx. (1) fn(x)=xnf_n(x)=x^n on [0,1][0,1]: pointwise limit f(x)=0f(x)=0 for x<1x<1, f(1)=1f(1)=1; supxfnf=1\sup_x|f_n-f|=1 for all nn (near x=1x=1^-), so not uniform (and limit is discontinuous). (1)

(b) KKT for min ff s.t. gi0g_i\le0, hj=0h_j=0: (4, 1 each)

  1. Stationarity: f+μigi+λjhj=0\nabla f + \sum\mu_i\nabla g_i + \sum\lambda_j\nabla h_j=0.
  2. Primal feasibility: gi(x)0g_i(x)\le0, hj(x)=0h_j(x)=0.
  3. Dual feasibility: μi0\mu_i\ge0.
  4. Complementary slackness: μigi(x)=0\mu_i g_i(x)=0.

[
 {"claim":"Integral of 1/(x^4+1) over R equals pi/sqrt2","code":"x=symbols('x'); I=integrate(1/(x**4+1),(x,-oo,oo)); result = simplify(I - pi/sqrt(2))==0"},
 {"claim":"Sum of UHP residues of 1/(x^4+1) is -i*sqrt2/4","code":"z=symbols('z'); z1=exp(I*pi/4); z2=exp(I*3*pi/4); r=z1/(-4)+z2/(-4); result = simplify(r + I*sqrt(2)/4)==0"},
 {"claim":"Stationary distribution is (1/4,1/2,1/4)","code":"P=Matrix([[Rational(1,2),Rational(1,2),0],[Rational(1,4),Rational(1,2),Rational(1,4)],[0,Rational(1,2),Rational(1,2)]]); pi=Matrix([[Rational(1,4),Rational(1,2),Rational(1,4)]]); result = (pi*P)==pi"},
 {"claim":"Christoffel Gamma^r_theta_theta = -r for polar metric","code":"r=symbols('r'); g_theta_theta=r**2; Gamma = -Rational(1,2)*diff(g_theta_theta,r); result = simplify(Gamma + r)==0"}
]