Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 1G Solution Created 2026-09-24 Updated 2026-10-03
Suppose first that a simple continued fraction is eventually periodic. Its periodic tail is fixed by the Möbius transformation represented by the continued-fraction matrix of one full period:ThusThe infinite tail is not rational, since a rational simple continued fraction terminates. Hence is a quadratic irrational, and the finite initial block expresses the original number as another rational Möbius transform of . Therefore every eventually periodic simple continued fraction represents a quadratic irrational.
Apply the continued-fraction algorithm to :The complete quotient then repeats, givingThe convergents through one term before the final areThe last of these satisfies the Pell equationso a positive solution is
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 4 10D b Solution Created 2026-09-24 Updated 2026-10-03
Choose a power of two withSince the multiplicative order is less than , this guarantees . Prepare two quantum registers in the stateand use quantum modular exponentiation to obtain
Measure the second register. The order as the exact period of modular exponentiation implies that, conditional on the measured value, the first register is a normalized truncated periodic cosetwhere is the largest integer for which .
Apply the quantum Fourier transform to the first register and measure it, obtaining . The supplied Fourier-transform theorem states that, with probability of order , is an integer nearest to for some coprime to . On that event,The supplied continued-fraction theorem, applied through continued-fraction recovery in quantum order finding, therefore recovers the reduced fraction from . Because and are coprime, its denominator is the exact order . The candidate is checked classically by verifying .
The quantum Fourier transform, quantum modular exponentiation, continued-fraction algorithm, and final modular check all take polynomial time in . Since , the successful event has probability of order , as required.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 2 1H Solution Created 2026-09-24 Updated 2026-09-29
Write the continued fraction as and define its convergents byInduction using these recurrences givesIn particular, consecutive convergents have coprime numerator and denominator. The standard best-approximation consequence of the same determinant identity is that, for and ,Dividing by givesThe contrapositive proves that any strictly better approximation has .
For , the continued-fraction algorithm givesand the remainder then repeats. HenceThe convergent supplies a solution of the Pell equation:
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 2 15D c Solution Created 2026-09-24 Updated 2026-09-25
The two registers start in . A quantum Fourier transform on the first and evaluation of giveThe first measurement, on the function register, returns . The compatible inputs are , so the normalized state becomes
Apply to the first register and put . Its state isThe geometric sum vanishes unless . Thus this isup to the unchanged second register. The outcomes each have probability , in accordance with the quantum Fourier transform of a periodic coset state.
For the stated second outcome,The continued-fraction algorithm therefore returns denominator . Since the numerator is coprime to the true period, exact period recovery from a Fourier sample succeeds, and direct evaluation confirms that the least period is
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 2 15D d Solution Created 2026-09-24 Updated 2026-09-25
All steps through the transformed state are the same as in part (c), but the second measurement now gives . The classical fraction isso reduction or the continued-fraction algorithm proposes denominator . This is not a period, since for exampleEquivalently, the sample has and true period , with , so it reveals only . The algorithm does not succeed from this sample and must be repeated.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 1G Solution Created 2026-09-23 Updated 2026-09-25
Apply the continued-fraction algorithm. Since ,The successive complete quotients areandTaking one more reciprocal returns to , so the continued fraction of the square root of eleven is
WriteThe first convergents are and , whenceThe continued fraction convergent recurrence iswhere for even and for odd .
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 4 2I Solution Created 2026-09-23 Updated 2026-09-25
Every finite continued fraction is rational, since it is built from integers by finitely many additions and reciprocals. Conversely, if is rational in lowest terms, thenWhen , the next complete quotient is . Thus each step is an application of the Euclidean algorithm and replaces the denominator by a smaller nonnegative remainder. The process must terminate. This proves the termination criterion for a simple continued fraction.