Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 3 2G Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2007 ii Paper 3 1F Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2008 ii Paper 3 12F b Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2010 ii Paper 3 1G ii Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 3 9H Solution Created 2026-09-24 Updated 2026-10-06
For a simple continued fraction, defineMultiplying the matrices givesTheir determinants also give . If the infinite tail is , the same formula impliesThe denominators of these continued fraction convergents tend to infinity, since . Hence they converge to .
The square-root algorithm for the periodic continued fraction of a quadratic irrational, using , and , givesThe first four continued fraction convergents are . Direct substitution gives positive solutions to the requested Pell-type equations:
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 324 1 ii Solution Created 2026-10-03 Updated 2026-10-06
Let . In the Shor algorithm, first use classical arithmetic to deal with even and perfect powers, and to reject prime inputs. Perfect-power recognition and primality testing have polynomial-time classical algorithms. Factoring a perfect power , with , already gives a nontrivial factor . We may therefore consider an odd composite with at least two distinct prime factors.
Choose uniformly from and compute its greatest common divisor with using the Euclidean algorithm. A proper nontrivial divisor ends the computation. Otherwise is a unit, and the remaining task is quantum order finding. SetPrepare a uniform quantum superposition in a -qubit register and use quantum modular exponentiation in a second register to obtainRepeated squaring and reversible modular multiplication implement this step with polynomially many quantum gates in . Apply the inverse quantum Fourier transform to the first register and perform a quantum measurement in the computational basis, obtaining . Measuring the second register first, and Fourier-transforming the resulting periodic coset, gives the same distribution of .
Here is a quantitative quantum Fourier sampling bound for order finding. If , multiplication by cycles its orbit states. The Fourier eigenstates of that cycle have eigenvalues , and the initial state has squared overlap with each, for . ThereforeConditioned on a particular eigenphase , its nearest integer outcome obeys and has probability at least . Indeed the absolute amplitude is , where . For , the numerator is at least and the denominator at most ; the limiting value at is one.
If , the fraction is reduced, and givesUse continued-fraction recovery in quantum order finding. The relevant approximation theorem says that reduced fractions satisfying are continued fraction convergents of . For an input rational of digits, their candidates can be enumerated classically in time, and their denominators are at most the reduced input denominator. This is the supplied continued-fraction result; discard candidate denominators exceeding . A zero measurement is treated as a failed order-finding sample.
For each remaining even candidate denominator , compute by repeated squaring, and try and . Return only a divisor with ; otherwise repeat the quantum sample or choose another . This candidate-denominator gcd post-processing cannot return an incorrect factor, since its output is checked directly. When the recovered denominator is the true even multiplicative order and the square root of one is nontrivial, part (i) guarantees success. Checking before trying the gcds is also a valid, more restrictive convention; the single-run distinction matters in part (iii).
Two further standard quantitative facts explain why repetitions remain efficient. First, for a uniformly chosen unit modulo an odd integer with at least two distinct prime divisors, the probability of a useful unit in Shor factorization is at least : its true multiplicative order is even and . To see the source of this bound, the Chinese remainder theorem for unit groups makes the prime-power components independent. Each odd-prime-power unit group is cyclic. If its 2-primary order is , the probability of the largest possible value of is , and the probability of any specified smaller value is at most . Failure requires all components to have the same : either all zero, making odd, or all the same positive value, making the halfway power in every component. Conditioning on one component, the chance another component matches it is at most , so total failure is at most .
Second, the fraction of phase numerators coprime to is , where is the Euler totient function. The elementary totient-ratio lower bound suffices: if the distinct prime divisors are , then and . The totient product formula therefore givesThus for a good , the probability of sampling a coprime phase numerator with the required accuracy is at least . This is inverse-polynomial in the input length, so polynomially many repetitions achieve any fixed success probability. The quantum Fourier transform uses elementary rotations and Hadamard gates in the ideal gate description, and the other quantum and classical stages are polynomial in .
The reduction is therefore polynomial in the bit length:A small denominator need not itself be the true multiplicative order; verification of the final factor is essential, and no guarantee is claimed for every individual sample.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 3 10G a Solution Created 2026-09-24 Updated 2026-10-05
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 3 10G d Solution Created 2026-09-24 Updated 2026-10-05
The continued fraction convergents of begin . The last one yieldsChanging either sign gives another valid integer solution.
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 11I b Solution Created 2026-09-24 Updated 2026-10-03
Let be the complete quotient after . Part (a) writes the irrational number asso lies between the adjacent continued fraction convergents and . Their separation isBecause all are positive integers, the recurrence implies . Hence this separation tends to zero, and the squeeze theorem gives
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 3 10D d Solution Created 2026-09-24 Updated 2026-10-03
The quantum Fourier transform measurement supplies a rational approximationwhere is the desired multiplicative order. HereIts reduced continued fraction convergent has denominator two, so continued-fraction recovery in quantum order finding proposes . Direct order verification from divisors confirms it:HenceAs a check, the classical final step of the Shor algorithm gives
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 .
Simple continued fraction 2026-10-06
A continued fraction with integer and positive integer for . Its partial numerators are all one. The continued fraction convergents have the standard two-term numerator and denominator recurrences.