= Paper 2 {scope} https://www.maths.cam.ac.uk/undergrad/pastpapers/files/2022/paperia_2_2022.pdf = 1A {parent=Paper 2} {scope} {title2=Differential Equations} = Solution {parent=1A} first gives $$ I'(x)=\int_0^\pi \cos\theta\,e^{x\cos\theta}\,d\theta. $$ On the other hand, $$ \frac d{d\theta}\left(\sin\theta\,e^{x\cos\theta}\right) =\cos\theta\,e^{x\cos\theta} -x\sin^2\theta\,e^{x\cos\theta}. $$ Its integral is zero because $\sin\theta$ vanishes at both endpoints. Hence $$ \boxed{I'(x)=\int_0^\pi x\sin^2\theta\,e^{x\cos\theta}\,d\theta}. $$ Differentiating once more, $$ I''(x)=\int_0^\pi\cos^2\theta\,e^{x\cos\theta}\,d\theta. $$ For $x\ne0$, the preceding identity and $\sin^2\theta+\cos^2\theta=1$ give $$ I''+\frac1xI'-I =\int_0^\pi(\cos^2\theta+\sin^2\theta-1)e^{x\cos\theta}\,d\theta=0. $$ The equation extends through $x=0$ in its regular limiting form. Solved by gpt-5.6-sol high. = 2B {parent=Paper 2} {scope} {title2=Differential Equations} = Solution {parent=2B} The characteristic polynomial of the is $$ r^3-6r^2+12r-8=(r-2)^3. $$ The repeated-root rule therefore gives $$ x_n=(A+Bn+Cn^2)2^n. $$ The condition $x_0=0$ gives $A=0$. The other two conditions give $$ 2(B+C)=4,\qquad 4(2B+4C)=24, $$ so $B+C=2$ and $B+2C=3$. Thus $B=C=1$, and $$ \boxed{x_n=n(n+1)2^n}. $$ Solved by gpt-5.6-sol high. = 3F {parent=Paper 2} {scope} {title2=Probability} = Solution {parent=3F} A function $f$ on an interval is a if $$ f(tx+(1-t)y)\leq tf(x)+(1-t)f(y) \qquad(0\leq t\leq1). $$ states that for an integrable random variable $X$, when all terms are defined, $$ f(\mathbb E X)\leq\mathbb E[f(X)]. $$ The function $\phi(x)=x\log x$ is convex on $(0,\infty)$ because $$ \phi''(x)=\frac1x>0. $$ Applying Jensen's inequality to the uniform distribution on the positive numbers $x_1,\ldots,x_n$ gives $$ \frac1n\sum_{i=1}^nx_i\log x_i \geq \left(\frac1n\sum_{i=1}^nx_i\right) \log\left(\frac1n\sum_{i=1}^nx_i\right). $$ Writing $S=\sum_i x_i$ and multiplying by $n/S$ yields $$ \boxed{ \frac{\sum_{i=1}^nx_i\log x_i}{\sum_{i=1}^nx_i} \geq\log\left(\frac{\sum_{i=1}^nx_i}{n}\right)}. $$ Solved by gpt-5.6-sol high. = 4F {parent=Paper 2} {scope} {title2=Probability} = Solution {parent=4F} Expanding around the $\mu$, $$ G(a)=\mathbb E[(X-\mu+\mu-a)^2] =\mathbb E[(X-\mu)^2]+(\mu-a)^2, $$ because $\mathbb E[X-\mu]=0$. Therefore $$ \boxed{G(a)=\sigma^2+(\mu-a)^2\geq\sigma^2}, $$ with equality exactly when $a=\mu$. For the absolute loss, $$ H(a)=\int_{-\infty}^a(a-x)f(x)\,dx +\int_a^\infty(x-a)f(x)\,dx. $$ Leibniz differentiation gives, with $F(a)=\int_{-\infty}^af(x)\,dx$, $$ H'(a)=F(a)-(1-F(a))=2F(a)-1. $$ Thus $H$ decreases while $F(a)<1/2$ and increases while $F(a)>1/2$. It is minimized at any , characterized in the continuous case by $$ \boxed{\int_{-\infty}^af(x)\,dx=\frac12}. $$ Solved by gpt-5.6-sol high. = 5C {parent=Paper 2} {scope} {title2=Differential Equations} = a {parent=5c} {scope} = Solution {parent=a} For a normalized equation $$ y''+P(x)y'+Q(x)y=0, $$ $x_0$ is an ordinary point when $P,Q$ are analytic there. It is a regular singular point when $(x-x_0)P(x)$ and $(x-x_0)^2Q(x)$ are analytic there. These are the and . Here $$ P(x)=\frac1x-1,\qquad Q(x)=\frac{\lambda}{x}, $$ so $x=0$ is regular singular. Seek a $$ y=\sum_{n=0}^{\infty}a_nx^n. $$ Equating the coefficient of $x^n$ gives $$ (n+1)^2a_{n+1}+(\lambda-n)a_n=0, $$ and hence $$ a_{n+1}=\frac{n-\lambda}{(n+1)^2}a_n. $$ Therefore $$ \boxed{ a_n=a_0\frac{\prod_{j=0}^{n-1}(j-\lambda)}{(n!)^2}}, \qquad y=a_0\sum_{n=0}^{\infty} \frac{\prod_{j=0}^{n-1}(j-\lambda)}{(n!)^2}x^n. $$ The series terminates exactly when $\lambda=N$ is a nonnegative integer: the factor with $j=N$ then makes $a_{N+1}=0$. Thus the polynomial solutions occur for $$ \boxed{\lambda=0,1,2,\ldots}. $$ Solved by gpt-5.6-sol high. = b {parent=5c} {scope} = Solution {parent=b} After division by $x$, the coefficient of $y'$ is $P(x)=1/x-1$. The for the gives $$ W'=-P(x)W=\left(1-\frac1x\right)W, $$ so $$ \boxed{W(x)=C\frac{e^x}{x}}. $$ For $\lambda=1$, direct substitution confirms that $y_1=1-x$. gives a second solution proportional to $$ y_2=(1-x)\int\frac{e^x}{x(1-x)^2}\,dx. $$ To extract the requested coefficients, put $$ y_2=(1-x)\log x+b_1x+b_2x^2+\cdots. $$ For the differential operator $$ L[y]=xy''+(1-x)y'+y, $$ one finds $$ L[(1-x)\log x]=x-3. $$ The analytic correction $h=\sum_{n\geq1}b_nx^n$ must therefore satisfy $L[h]=3-x$. Its constant and linear coefficients give $$ b_1=3,\qquad 4b_2=-1. $$ Hence $$ \boxed{ y_2=(1-x)\log x+3x-\frac14x^2+\cdots}. $$ Solved by gpt-5.6-sol high. = 6A {parent=Paper 2} {scope} {title2=Differential Equations} = a {parent=6a} {scope} = Solution {parent=a} The multivariable gives, at $(x,y)=(a+t\cos\gamma,b+t\sin\gamma)$, $$ g'(t)=f_x\cos\gamma+f_y\sin\gamma, $$ $$ g''(t)=f_{xx}\cos^2\gamma +2f_{xy}\sin\gamma\cos\gamma +f_{yy}\sin^2\gamma. $$ Sufficient conditions for a strict local minimum at $t=0$ are $g'(0)=0$ and $g''(0)>0$. At a , $g'(0)=0$ in every direction. Its second derivative is the quadratic form of the . If $$ f_{yy}>0,\qquad f_{xx}f_{yy}-f_{xy}^2>0, $$ then completing the square gives $$ f_{xx}u^2+2f_{xy}uv+f_{yy}v^2 =f_{yy}\left(v+\frac{f_{xy}}{f_{yy}}u\right)^2 +\frac{f_{xx}f_{yy}-f_{xy}^2}{f_{yy}}u^2>0 $$ for every nonzero direction $(u,v)$. The Hessian is therefore [positive definite], and the stationary point is a strict local minimum. Solved by gpt-5.6-sol high. = b {parent=6a} {scope} = Solution {parent=b} The stationary equations are $$ 4x^3-6x+2y=0,\qquad 2x+2y=0. $$ Thus $y=-x$ and $4x(x^2-2)=0$, giving $$ (0,0),\qquad(\sqrt2,-\sqrt2),\qquad(-\sqrt2,\sqrt2). $$ The is $$ H=\begin{pmatrix}12x^2-6&2\\2&2\end{pmatrix}. $$ At either nonzero stationary point, $$ H=\begin{pmatrix}18&2\\2&2\end{pmatrix}, \qquad \det H=32>0, $$ so both are strict local minima. Along a line through the origin, $$ g(t)=f(t\cos\gamma,t\sin\gamma) =t^2q(\gamma)+t^4\cos^4\gamma, $$ where $$ q(\gamma)=-3\cos^2\gamma +2\sin\gamma\cos\gamma+\sin^2\gamma. $$ When $\cos\gamma\ne0$ and $r=\tan\gamma$, $$ q(\gamma)=\cos^2\gamma(r-1)(r+3). $$ Consequently the origin is a local minimum along the line when $$ \boxed{\tan\gamma\leq-3\quad\text{or}\quad\tan\gamma\geq1}, $$ including the equality cases because the positive quartic term then leads. It is also a minimum on the vertical line. It is a local maximum along the line when $$ \boxed{-3<\tan\gamma<1}. $$ In the first case the graph is locally bowl-shaped. In the second it initially bends downward from the origin, but the positive quartic term eventually turns it upward, producing the usual double-well profile. Solved by gpt-5.6-sol high. = 7C {parent=Paper 2} {scope} {title2=Differential Equations} = a {parent=7c} {scope} = Solution {parent=a} The is $$ \det(A-\lambda I)=\lambda(\lambda-1). $$ For $\lambda_1=0$ and $\lambda_2=1$, corresponding are $$ u_1=\begin{pmatrix}2\\1\end{pmatrix}, \qquad u_2=\begin{pmatrix}3\\1\end{pmatrix}. $$ They are linearly independent, so the general homogeneous solution is $$ \boxed{ z(t)=\alpha\begin{pmatrix}2\\1\end{pmatrix} +\beta e^t\begin{pmatrix}3\\1\end{pmatrix}}. $$ Solved by gpt-5.6-sol high. = b {parent=7c} {scope} = Solution {parent=b} Resolve the forcing in the eigenbasis: $$ \begin{pmatrix}1\\a\end{pmatrix} =(3a-1)u_1+(1-2a)u_2. $$ In the zero-eigenvalue direction, a constant forcing produces the particular integral $(3a-1)t\,u_1$. In the unit-eigenvalue direction, a constant particular integral is $-(1-2a)u_2$. Thus a particular integral depends on time exactly when $$ \boxed{a\ne\frac13}. $$ Adding the complementary solution from part (a), the general solution is $$ \boxed{ z(t)=\alpha u_1+\beta e^tu_2 +(3a-1)t\,u_1-(1-2a)u_2}. $$ This is the eigenvector form of the usual calculation. Solved by gpt-5.6-sol high. = c {parent=7c} {scope} = Solution {parent=c} For either eigenpair above, $\lambda_i\in\{0,1\}$ and hence $\lambda_i^n=\lambda_i$ for every positive integer $n$. Therefore $$ \frac{d^n}{dt^n}(u_i e^{\lambda_it}) =\lambda_i^n u_i e^{\lambda_it} =A u_i e^{\lambda_it}, $$ so both terms in the solution from part (a), and every linear combination of them, solve the higher-order system. A system of two scalar differential equations of order $n$ has a $2n$-dimensional solution space. The displayed family supplies two independent solutions, so there must be $$ \boxed{2n-2} $$ further linearly independent solutions. Solved by gpt-5.6-sol high. = 8B {parent=Paper 2} {scope} {title2=Differential Equations} = a {parent=8b} {scope} = Solution {parent=a} Write the vector field as $$ \dot x=2x(4-x-y^2),\qquad \dot y=y(x-1). $$ The in the closed first quadrant are $$ \boxed{(0,0),\quad(4,0),\quad(1,\sqrt3)}. $$ The is $$ J(x,y)= \begin{pmatrix} 8-4x-2y^2&-4xy\\ y&x-1 \end{pmatrix}. $$ At $(0,0)$ its eigenvalues are $8,-1$, so this is a . Its unstable direction is the positive $x$-axis and its stable direction is the positive $y$-axis; to first order, nearby trajectories satisfy $\dot x=8x$, $\dot y=-y$. At $(4,0)$ the eigenvalues are $-8,3$, so it is also a saddle. The $x$-axis is the stable direction, while trajectories entering the quadrant in the $y$ direction move away. At $(1,\sqrt3)$, $$ J=\begin{pmatrix}-2&-4\sqrt3\\ \sqrt3&0\end{pmatrix}, $$ whose eigenvalues are $$ -1\mathbin{\pm}i\sqrt{11}. $$ It is therefore a . A point immediately to its right moves upward, so nearby trajectories spiral counterclockwise into the equilibrium. These eigendirections and the inward spiral give the requested local phase-portrait sketches. Solved by gpt-5.6-sol high. = b {parent=8b} {scope} = Solution {parent=b} The only positive equilibrium solves $1-y=0$ and $x-1=0$, hence is $$ \boxed{(x,y)=(1,1)}. $$ Away from a nullcline, $$ \frac{dy}{dx} =\frac{3y(x-1)}{x(1-y)}. $$ This is separable: $$ \left(\frac1y-1\right)dy =3\left(1-\frac1x\right)dx. $$ Integration gives the $$ \log y-y=3x-3\log x+C. $$ Thus one convenient conserved quantity is $$ \boxed{E(x,y)=3x-3\log x+y-\log y}. $$ Its gradient is $$ \nabla E=\left(3-\frac3x,\,1-\frac1y\right), $$ so $(1,1)$ is its only stationary point in the positive quadrant. Its is $$ \nabla^2E= \begin{pmatrix}3/x^2&0\\0&1/y^2\end{pmatrix}, $$ which is positive definite everywhere. Hence $(1,1)$ is a strict, indeed global, minimum. The nearby level curves of $E$ are closed curves surrounding this minimum. Since $E$ is constant along every trajectory, a solution starting on a sufficiently small nearby level set cannot leave the region bounded by a slightly larger level set. This proves of the equilibrium: solutions initially close to $(1,1)$ remain close for all time. Solved by gpt-5.6-sol high. = 9F {parent=Paper 2} {scope} {title2=Probability} = a {parent=9f} {scope} = Solution {parent=a} Because $U$ and $V$ are bounded, their exponential series may be integrated term by term for every real $t$. Thus their satisfy $$ M_U(t)=\mathbb E[e^{tU}] =\sum_{j=0}^{\infty}\frac{t^j}{j!}\mathbb E[U^j], $$ and similarly for $V$. Equality of every moment gives equality term by term, so $$ \boxed{M_U(t)=M_V(t)\quad\text{for every }t\in\mathbb R}. $$ Solved by gpt-5.6-sol high. = b {parent=9f} {scope} = Solution {parent=b} Normalization of the gives $$ A=\frac1{\sqrt{2\pi}}. $$ Completing the square, $$ tx-\frac{x^2}{2} =-\frac{(x-t)^2}{2}+\frac{t^2}{2}. $$ Therefore $$ M_X(t)=\frac1{\sqrt{2\pi}} \int_{-\infty}^{\infty}e^{tx-x^2/2}\,dx =e^{t^2/2}, $$ and hence $$ \boxed{M_X(t)=e^{t^2/2}}. $$ Solved by gpt-5.6-sol high. = c {parent=9f} {scope} = Solution {parent=c} The normalizing constant satisfies $$ B^{-1}=\sum_{n\in\mathbb Z}e^{-n^2/2}. $$ For an integer $k$, $$ \mathbb E[e^{kY}] =B\sum_{n\in\mathbb Z}e^{kn-n^2/2} =Be^{k^2/2}\sum_{n\in\mathbb Z}e^{-(n-k)^2/2}. $$ Translation by the integer $k$ merely permutes the summation indices, so the final sum is $B^{-1}$. Consequently $$ \boxed{\mathbb E[e^{kY}]=e^{k^2/2} =\mathbb E[e^{kX}]}. $$ The last equality uses the of the standard normal variable from part (b). Solved by gpt-5.6-sol high. = d {parent=9f} {scope} = Solution {parent=d} No. A standard counterexample comes from the . Let $$ f(x)=\frac1{x\sqrt{2\pi}} \exp\left(-\frac{(\log x)^2}{2}\right), \qquad x>0, $$ and, for a fixed $0<|\varepsilon|\leq1$, let $$ f_\varepsilon(x) =f(x)\left[1+\varepsilon\sin(2\pi\log x)\right]. $$ This is a nonnegative density distinct from $f$. For every nonnegative integer $n$, substituting $z=\log x$ makes the difference of the $n$th moments proportional to $$ \mathbb E[e^{nZ}\sin(2\pi Z)], \qquad Z\sim N(0,1). $$ It is the imaginary part of $$ \mathbb E[e^{(n+2\pi i)Z}] =\exp\left(\frac{(n+2\pi i)^2}{2}\right), $$ which vanishes because its phase is $2\pi n$. The case $n=0$ also proves that $f_\varepsilon$ is normalized. Thus the two distributions have every finite moment equal but are different. Unbounded random variables need not be determined by their moments. Solved by gpt-5.6-sol high. = 10F {parent=Paper 2} {scope} {title2=Probability} = a {parent=10f} {scope} = Solution {parent=a} The is $$ G_X(s)=\sum_{m=1}^{\infty}\mathbb P(X=m)s^m. $$ Differentiating $n$ times, $$ G_X^{(n)}(s) =\sum_{m=n}^{\infty} \frac{m!}{(m-n)!}\mathbb P(X=m)s^{m-n}. $$ At $s=0$, only the term $m=n$ remains. Hence $$ \boxed{\mathbb P(X=n)=\frac{G_X^{(n)}(0)}{n!}}. $$ Solved by gpt-5.6-sol high. = b {parent=10f} {scope} = Solution {parent=b} For $0\leq s\leq1$, independence gives $$ G_{X+Y}(s) =\mathbb E[s^{X+Y}] =\mathbb E[s^Xs^Y] =\mathbb E[s^X]\,\mathbb E[s^Y]. $$ Therefore $$ \boxed{G_{X+Y}(s)=G_X(s)G_Y(s)}. $$ Solved by gpt-5.6-sol high. = c {parent=10f} {scope} = Solution {parent=c} For the on $\{1,2,\ldots\}$, $$ \mathbb P(X=m)=p(1-p)^{m-1}. $$ Summing the , $$ G_X(s) =\sum_{m=1}^{\infty}p(1-p)^{m-1}s^m =\boxed{\frac{ps}{1-(1-p)s}}. $$ Solved by gpt-5.6-sol high. = d {parent=10f} {scope} = Solution {parent=d} When $r$ red marbles remain, the next draw reduces their number with probability $r/n$. The waiting time $W_r$ for that reduction has a on $\{1,2,\ldots\}$ and therefore $$ G_{W_r}(s) =\frac{(r/n)s}{1-(1-r/n)s} =\frac{rs}{n-(n-r)s}. $$ The successive waiting times are independent, and $$ T=W_n+W_{n-1}+\cdots+W_1. $$ Using the product rule for probability-generating functions, $$ \boxed{ G_T(s)=\prod_{r=1}^{n} \frac{rs}{n-(n-r)s}}. $$ Solved by gpt-5.6-sol high. = 11F {parent=Paper 2} {scope} {title2=Probability} = a {parent=11f} {scope} = Solution {parent=a} The number of heads has the . Choosing the $k$ head positions gives $$ \boxed{\mathbb P(\text{exactly }k\text{ heads}) =\binom nk p^k(1-p)^{n-k}}. $$ Solved by gpt-5.6-sol high. = b {parent=11f} {scope} = Solution {parent=b} Conditioned on exactly $k$ heads, every $k$-element set of head positions is equally likely. There are $\binom nk$ such sets. A run containing all $k$ heads can begin at any of the positions $$ 1,2,\ldots,n-k+1, $$ and each beginning determines one admissible set. Thus, for $k\geq1$, $$ \boxed{ \mathbb P(\text{the }k\text{ heads are consecutive}\mid \text{exactly }k\text{ heads}) =\frac{n-k+1}{\binom nk}}. $$ Solved by gpt-5.6-sol high. = c {parent=11f} {scope} = Solution {parent=c} For the process to stop on toss $n$, the last toss must be the $k$th head, while the first $n-1$ tosses must contain exactly $k-1$ heads. Hence the gives $$ \boxed{ \mathbb P(T=n) =\binom{n-1}{k-1}p^k(1-p)^{n-k}}, \qquad n\geq k. $$ Solved by gpt-5.6-sol high. = d {parent=11f} {scope} = Solution {parent=d} Let $E_j$ be the expected additional number of tosses when the current terminal run contains $j$ consecutive heads. Then $E_k=0$, and for $0\leq j for the nonnegative indicators, $$ \mathbb E[N] =\mathbb E\left[\sum_{n\geq1}\mathbf1_{A_n}\right] =\sum_{n\geq1}\mathbb P(A_n). $$ If this is finite, then $N$ is finite almost surely: alternatively, gives $$ \mathbb P(N\geq m)\leq\frac{\mathbb E[N]}m\longrightarrow0. $$ Since $\{N=\infty\}\subseteq\{N\geq m\}$ for every $m$, $$ \boxed{\mathbb P(N=\infty)=0}. $$ This is the first [Borel-Cantelli lemma]. Solved by gpt-5.6-sol high. = b {parent=12f} {scope} = Solution {parent=b} Write $p_n=\mathbb P(A_n)$. Independence gives, first for finite partial counts and then by monotone convergence, $$ \mathbb E[2^{-N}] =\prod_{n\geq1} \mathbb E[2^{-\mathbf1_{A_n}}] =\prod_{n\geq1}\left(1-\frac{p_n}{2}\right). $$ Using $1-x\leq e^{-x}$ factor by factor, $$ \boxed{ \mathbb E[2^{-N}] \leq\exp\left(-\frac12\sum_{n\geq1}p_n\right) =e^{-\mathbb E[N]/2}}. $$ Solved by gpt-5.6-sol high. = c {parent=12f} {scope} = Solution {parent=c} If $\sum_n\mathbb P(A_n)=\infty$, part (b) gives $$ 0\leq\mathbb E[2^{-N}]\leq e^{-\infty}=0. $$ Thus $2^{-N}=0$ almost surely. By the convention in the question, this occurs exactly when $N=\infty$. Therefore $$ \boxed{\mathbb P(N=\infty)=1}. $$ This is the second [Borel-Cantelli lemma] for independent events. Solved by gpt-5.6-sol high. = d {parent=12f} {scope} = Solution {parent=d} Divide the keystrokes into disjoint blocks of five, and let $A_n$ be the event that block $n$ is exactly HELLO. The events are , and $$ \mathbb P(A_n)=26^{-5}. $$ Consequently $$ \sum_{n=1}^{\infty}\mathbb P(A_n)=\infty. $$ Part (c) shows that infinitely many of these block events occur almost surely. Each occurrence is an occurrence of HELLO in the full typed sequence, so $$ \boxed{\mathbb P(\text{HELLO appears infinitely often})=1}. $$ Solved by gpt-5.6-sol high.