Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 44 4 b Solution Created 2026-10-03 Updated 2026-10-14
Under the no-death assumption, use the mixture of the two community-service paths. Of 10,000 initially assigned offenders, 4,000 breach and leave their subsequent 60-day prison term at day 120. Their remaining 240 days of follow-up match the supplied reconviction window. The 6,000 completers finish community service at day 180 and have the supplied 180-day post-completion follow-up.
The expected value of the number reconvicted is consequentlyThus the initial-policy 360-day reconviction probability is . This is a mixture calculation for the initially sentenced cohort, not the 40% rate of its selected completers alone. It uses the supplied windows and assumes they capture the reconvictions being counted, rather than adding unspecified reconvictions during the earlier order or custody periods.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 44 4 d Solution Created 2026-10-03 Updated 2026-10-14
Interpret the quoted daily death rates as piecewise constant hazard functions, and use the custody schedules described in the problem. This means community service itself has the ordinary community hazard, a completer has no prison exposure, and a breacher is imprisoned from day 60 to day 120. Subsequent imprisonment after another conviction is not specified, so it is not added to the exposure schedule. The abbreviated “CS180” denotes the same initial community-service policy.
For a completer, all 360 days have the baseline rate, giving integrated hazardFor a breacher, the four periods are 60 community days, 60 prison days, 30 high-risk days immediately after release, and 210 further community days. ThusThe piecewise-exponential survival model gives death probabilities and . Average these over the stated 60%/40% mixture of paths. Equivalently, everyone first survives the common initial 60-day community interval, and survivors then take the two paths in those proportions. The expected value among 10,000 initial assignments isThis accounts for removal of people after death. Since the daily hazards and endpoint death probabilities are small, the usual person-time approximation replaces by and givesBoth calculations use the same specified schedules. The latter treats all planned exposure as if contributed and is slightly larger. Additional custody histories would change the exposure-weighted integrated hazard; the provided reconviction proportions alone do not determine those histories.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 44 4 e Solution Created 2026-10-03 Updated 2026-10-14
Mortality requires its own sample size calculation, rather than using the much commoner reconviction endpoint. Under the same specified exposure assumptions, the P30 schedule has 30 prison days, 30 high-risk post-release days, and 300 ordinary days. Its integrated hazard isHence its 360-day death probability is . For initial community-service assignment the preceding mixture gives . The absolute risk difference is therefore only about , or 16.8 fewer deaths per 10,000 initial assignments. The person-time approximation gives 145 versus 128 deaths per 10,000, a difference of 17.
As an illustrative design target, take two-sided significance level , statistical power and equal individual allocation. Apply the sample size for comparing two proportions formula with these mortality probabilities:It gives about 74,600 participants per arm, or 149,200 altogether; using the simpler exposure approximations gives about 73,130 per arm. At 30,000 sentences per year, even if every offender were eligible and enrolled, this requires roughly five years of recruitment and another year to complete the final cohort's follow-up.
For scale, one year's equally allocated cohort has 15,000 per arm, with roughly 216 expected deaths after P30 and 191 after community-service assignment. The standard error of the risk difference is about , so the expected standardized separation is only about , below the usual two-sided 5% critical value. A one-year trial would consequently have poor statistical power for this mortality difference.
Thus mortality discrimination is much more demanding than reconviction discrimination. National recruitment and reliable linkage to death records could make a multiyear study feasible, but restricted eligibility, incomplete follow-up, or lower recruitment would lengthen it. A trial sized only for the 4-percentage-point reconviction difference would not provide a precise mortality comparison. The numerical conclusion depends on the supplied daily hazards, custody schedules, and the chosen power and significance targets; the prompt does not specify a mortality design target of its own.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 1 ii Solution Created 2026-10-03 Updated 2026-10-14
Label the two paternal ancestral marker copies and the two maternal copies . Treat these as four distinct ancestral copies in an outbred pedigree; equal observed alleles need not imply identity by descent. By Mendelian segregation, each child independently receives either paternal copy with probability . Thus the indicator that the two full siblings inherit the same paternal copy satisfiesThe same argument gives for the maternal copy. Paternal and maternal meioses are independent, so and are independent. Consequently the number of copies shared identical by descent has a binomial distribution, givingThis is Mendelian IBD sharing of full siblings. It describes an ordinary, unselected sib pair: conditioning on a shared disease phenotype can change the distribution if there is genetic linkage to its causal locus.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 1 iv Solution 2026-10-14
Let denote the disease allele. Complete penetrance with recessive inheritance makes each affected child . The unaffected parents must therefore both be genetic carriers. Condition on these parental genotypes and the fully informative marker; the distinct paternal and maternal marker copies identify which parent's copies are shared. Average over the two equally likely marker-disease haplotype phases in each parent. This is the phase-symmetric model implicit in the requested pedigree likelihood identities.
For one parent, suppose first that both children receive the same marker copy. If that marker copy is on the parental chromosome carrying , both children receive with probability ; in the opposite phase the probability is . The phase-averaged probability isIf the children receive different marker copies, one disease-allele transmission is recombinant and the other is nonrecombinant in either phase. The probability that both receive is thereforePaternal and maternal transmissions are independent. Sharing zero marker copies means the different-copy case for both parents; sharing two means the same-copy case for both; sharing one means one of each. Thus the recessive affected-sib-pair likelihood isHere is the probability that both children are affected conditional on the marker sharing state , not the probability of conditional on their being affected. Since ,At , all three conditional disease probabilities equal , as expected from two independent children of an mating. At , only the two-copy-sharing state can produce two affected children. Phase weights other than would require a different likelihood function and need not obey these identities.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 1 vi Solution 2026-10-14
Put and . The usual recombination fraction range gives , and the preceding likelihood function becomesTo see its relation to nonparametric linkage analysis, use Bayes' theorem and the constant disease probability to obtain the affected-pair marker-sharing probabilitiesTheir multinomial likelihood has exactly the same -dependent kernel, since its extra factor is constant. Set and . Then , and is the total number of shared ancestral copies. At fixed , the Fisher-Neyman factorization theorem makes a sufficient statistic. The observed mean shared proportion is , and the binomial likelihood kernel givesThe unlinked null is , whereas linkage corresponds to , or expected shared proportion . If , the constrained likelihood is maximized at the unlinked null. For , its log likelihood ratio iswhose derivative in is . Hence it orders samples exactly by excess IBD sharing. Under this fully penetrant recessive model, parametric linkage testing and a one-sided test of the overall IBD-sharing proportion use the same information. This is allele-sharing sufficiency for recessive linkage, not a general equivalence for all disease models. Use limiting values for terms such as , and assume for the estimators.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 1 v Solution 2026-10-14
Take the affected sib pairs from independent families with the same disease model. Conditional on their marker sharing states, multiply the recessive affected-sib-pair likelihoods:Write , so that and . ConsequentlyFor an unordered count sample there can also be a multinomial likelihood coefficient, and the Mendelian probabilities of the observed marker sharing states supply further factors. All these factors are independent of .
If genetic-study ascertainment explicitly conditions on both children being affected, the normalizing disease probability is constant:Thus the conditional sharing likelihood differs from the displayed likelihood function only by factors independent of the recombination fraction. Multiple pairs drawn from the same larger sibship would not, in general, justify treating these pair likelihoods as independent.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 2 a Solution 2026-10-14
The kinship coefficient is the probability that a randomly selected allele copy from individual and an independently selected copy from individual at the same genetic locus are identical by descent. The sampling is of gene copies, not of whole genotypes. For a noninbred individual , sampling its two copies with replacement gives ; in general , where is its inbreeding coefficient.
For two full siblings in an outbred pedigree, the two sampled copies are both paternal with probability , both maternal with probability , and of different parental origin with probability . Given that both are paternal, their independent Mendelian segregation transmissions select the same paternal ancestral copy with probability ; likewise for both maternal. The different-parent case cannot be identical by descent when the parents are unrelated. ThereforeEquivalently, conditional on an IBD-sharing count , the chance that the two random copies match is , so . The expected shared proportion and the usual additive relationship coefficient are twice this kinship coefficient; confusing these conventions would double the subsequent inbreeding coefficient.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 2 b Solution 2026-10-14
Let the first cousins be , with parents and respectively, where are full siblings and have no ancestral relationship to one another or to that sibling family. To compute , choose one allele copy from each cousin. They originate from and with probability . All other parental combinations have zero kinship coefficient under the otherwise outbred pedigree assumption. HenceThe two gene copies within a child of are random transmissions from these parents. They are identical by descent precisely in the event defining parental kinship, so the child's inbreeding coefficient isFor a direct ancestral-path check, there are two shared noninbred grandparents. Through either grandparent, the two cousin-to-grandparent paths have two meioses each, and matching the ancestral grandparental copy supplies a further factor . Each contributes , giving the same first-cousin inbreeding coefficient. Additional ancestral relationships or inbred grandparents would change the result.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 2 c Solution 2026-10-14
Assume a single disease allele , complete penetrance of , no disease in or , and Hardy-Weinberg equilibrium in the outbred population. If its population frequency is , the disease prevalence is , so .
For a child with inbreeding coefficient , the two inherited copies are identical by descent with probability . In that component there is just one ancestral allele draw, and it is with probability . In the remaining component there are two independent ancestral draws, with probability of . Thus the inbreeding genotype frequencies giveUsing the first-cousin inbreeding coefficient , the disease-risk ratio isThe absolute risk in this model is . This calculation averages over the parental genotypes in first-cousin marriages before observing an affected child. It is not the risk conditional on both parents being known genetic carriers, and assumes the specified cousin relationship is independent of disease status rather than conditioning on a selected disease pedigree.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 2 d Solution 2026-10-14
Assume the parents are unaffected, the disease has complete penetrance with a single recessive causal allele, and there are no phenocopies, new disease mutations or alternative causal loci. An affected first child has genotype , so each unaffected parent must be a heterozygote . Conditional on these parental genotypes, Mendelian segregation in the second child's paternal and maternal meioses is independent of the transmissions to the first child. ThereforeThis is the same sibling recurrence risk as for unrelated, unaffected parents under the same recessive model. Parental kinship increases the prior probability that both parents carry the same rare disease allele; after both are identified as carriers, it does not alter their Mendelian transmission probabilities. The factor from the preceding part is therefore not an additional multiplier on the sibling recurrence risk.
If unaffected parents are not explicitly required, the rare-disease assumption is an approximation supporting the usual carrier-by-carrier calculation, rather than a logically exact consequence of an affected child alone. Under complete penetrance, the compatible parental matings are , and , with second-child risks respectively. Let their prior probabilities be , including both orders in . Conditioning on the affected first child givesWithout negligible or excluded affected-parent matings, this mixture need not equal and may depend on consanguinity. Likewise incomplete penetrance or disease heterogeneity invalidates the assertion that an affected child of unaffected parents necessarily identifies an mating. The stated answer uses the unaffected-parent, fully penetrant single-locus assumptions.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 3 iii Solution Created 2026-10-03 Updated 2026-10-14
Let , with all , and put . The independent exponential epoch times have joint densityTake a proper prior distribution density on , independent of the neutral genealogy. Independence is appropriate because the specified neutral Kingman's coalescent does not depend on the mutation parameter. The conditional observed-count likelihood function isIts prior predictive probability, or Bayesian model evidence, isAssuming , Bayes' theorem gives the joint posterior of mutation rate and coalescent times:It is zero outside the prior support and positive-time region. For , use the usual convention in the Poisson mass. An improper prior cannot be sampled as the proposal in the following algorithm, even in cases where its formal posterior can be normalized.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 3 iv Solution Created 2026-10-03 Updated 2026-10-14
Use the joint prior density as the proposal for rejection sampling. Since the Poisson probability lies in , the following algorithm is valid:
- Draw from the proper prior distribution .
- Independently draw from the exponential distributions with rates , for , and calculate .
- Draw uniformly on , independently of all previous draws. Retain if ; otherwise restart.
The joint density of a proposed pair together with its acceptance event is . Its integral is , so conditioning on acceptance gives precisely , the desired posterior density. Repeating independent proposal trials until each acceptance produces independent posterior observations. This is Bayesian rejection sampling for a segregating-site count.
An equivalent implementation simulates and accepts exactly when . Its acceptance probability is the same Poisson mass. Propose from the joint prior and accept according to the exact observed-count likelihood. No approximation to the posterior distribution is involved in the accepted draws.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 3 v Solution Created 2026-10-03 Updated 2026-10-14
Integrating the acceptance probability over the joint-prior proposal givesThe mean number of independent proposal trials per acceptance is , by the geometric distribution. To make the acceptance rate explicit for an arbitrary specified prior, define the segregating-site likelihood under the neutral coalescent by . ThenFor the last identity, is the sum of independent exponential variables with rates ; combine their Laplace transforms with the conditional Poisson probability generating function. If an explicit mass is wanted, also has density : it is the maximum of independent unit exponential variables, whose successive spacings have exactly these exponential rates. Expanding and integrating the Poisson mass givesUse for . The positive integral or generating-function expression may be numerically preferable to this alternating sum.
A sharper rejection envelope improves the algorithm without changing its proposal. For , maximize the Poisson mass over :It increases until and decreases afterwards, so its maximum is . For , the maximum is . Replace the acceptance rule by . This is bounded by one, and its accepted density is unchanged because the factor cancels on normalization. ThusFor it is strictly more efficient, with improvement factor by Stirling's formula. For this envelope improvement gives no increase. Evaluating the Poisson mass and using a uniform draw also avoids generating a Poisson count only to discard it. A proposal concentrated near the posterior can improve efficiency further, but then its density and a valid rejection bound must be included.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 45 4 v Solution Created 2026-10-03 Updated 2026-10-14
Five consequences of the ancestral recombination graph are:
- Linkage disequilibrium and its distance dependence. Nearby sites often inherit the same local genealogy, so mutations on their shared ancestral branches produce correlated alleles. The chance of an ancestral breakpoint between sites increases with their genetic distance, reducing shared genealogy and, on average, linkage disequilibrium. This gives the genealogical explanation of the two-locus decay calculation.
- Haplotype blocks and recombination hotspots. With a varying recombination map, the ARG has relatively few breakpoints within low-recombination regions and many near recombination hotspots. Long intervals can consequently retain a small number of common ancestral haplotypes, while genealogical relationships change more frequently across the intervening regions. This explains why LD blocks are heterogeneous rather than equally spaced units.
- Mosaic inheritance and shared ancestral tracts. Backward splits assign different pieces of one contemporary chromosome to different ancestral chromosomes. Two sampled chromosomes can therefore share a recent ancestor over one interval but not its neighbors. For a specified total of independent ancestral meioses, a tract of genetic length has approximately expected crossovers under a Poisson crossover model, so its probability of remaining intact is . This relates long IBD segments to recent common ancestry, while distinguishing tract-boundary sampling from length-biased sampling at a random genomic point.
- Incompatible site patterns and four observed gametes. Under an infinite sites mutation model on a single rooted tree, the descendant sets of two mutations are nested or disjoint. They cannot cross, so all four haplotypes cannot occur. Recombination permits different local trees: one site's derived clade can be and the other's , producing all four without repeated mutation. The four-gamete test therefore detects a failure of the unrecombined, single-mutation-per-site model. Recurrent mutation would be an alternative explanation if the infinite-sites assumption were dropped.
- Variation in local diversity and allele frequencies. Coalescent mergers describe genetic drift; their random times produce different branch lengths and descendant-group sizes. Recombination makes these genealogies vary along the chromosome. Conditional on a local genealogy, its segregating site count is Poisson with mean , so a longer tree tends to contain more variants. A mutation on a branch subtending of the samples appears at sample frequency . Together, random branch lengths, descendant counts and mutations explain heterogeneous local diversity and the distribution of allele frequencies without requiring selection.
Different local genealogies can generate all four haplotypes with one mutation per site
. Details. Shared ancestry explains correlation; recombination makes ancestry a mosaic; mutation on the resulting branches converts genealogy into observed variation. These explanations use the neutral ARG, with a variable recombination map where stated. Selection, population subdivision or changing population size can also be studied genealogically, but require extending the event model rather than being consequences of the constant-size panmictic neutral process alone.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 47 3 b iii Solution Created 2026-10-03 Updated 2026-10-14
Assume . Draw an independent component indicator with a Bernoulli distribution of success probability . On success, generate the normal distribution from part (i) and return its absolute value; this has the half-normal distribution probability density function on . On failure, generate the Weibull distribution from part (ii). Use fresh independent uniforms for the chosen component.
The law of total probability gives the output probability density functionas required. The factor two belongs inside the half-normal component; the probability of choosing that component is , not .
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 47 3 b ii Solution Created 2026-10-03 Updated 2026-10-14
For , integrating the Weibull distribution probability density function givesThe inverse transform sampling method takes uniform on and solves . HenceSince is also uniform, is an equivalent implementation. For any , the resulting event has probability , verifying its distribution.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 47 3 b i Solution Created 2026-10-03 Updated 2026-10-14
Use the ratio-of-uniforms method onWriting gives and . Consequentlybecause the derivative vanishes at . Thus the normal ratio-of-uniforms envelope is the rectangle , .
Generate independent with uniform distribution on , set and , and accept precisely whenReject and repeat otherwise. On acceptance return . One can compare logarithms instead of exponentials to avoid underflow.
For a proof, the change of variables has Jacobian determinant . A uniform point in therefore gives an -density proportional toNormalizing yields the required normal distribution with mean zero and variance . The region area is ; dividing it by the rectangle area gives acceptance probability .
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 47 5 a Solution Created 2026-10-14 Updated 2026-10-20
The Metropolis–Hastings algorithm is useful when a target posterior can be evaluated up to a normalizing constant but direct independent sampling or simple conditional sampling is unavailable. It constructs a Markov chain with that posterior as invariant law. After adequate convergence, averages of functions of the chain estimate posterior expectations, and the retained draws approximate marginal distributions, quantiles and credible intervals.
For the random-walk Metropolis algorithm, at current propose , where has a symmetric distribution, often . With a symmetric proposal the acceptance probability isAccept the proposal when an independent uniform is below this probability; otherwise retain the current value. For a nonsymmetric proposal , include in the ratio. Detailed balance follows because the accepted flow is the minimum of the two proposed directional flows; rejection supplies the remaining self-transition probability. Irreducibility, appropriate recurrence and aperiodicity are also needed for convergence.
In the displayed trace plots, the first parameter moves in small increments with pronounced long-term wandering and a shift from its early region to a later region. This is consistent with an undersized proposal or a strongly correlated slow direction. Measure its acceptance rate: if it is very high, increase that coordinate's proposal variance. The second parameter moves rapidly within regions but changes its level around iteration 4500; that is evidence against treating the full run as a settled stationary sample, and it suggests investigating dependence with the first parameter or separated posterior regions. Its local scale may already be reasonable, so a blanket reduction of all proposal variances would be unwarranted. The third parameter has conspicuous long plateaus, indicating many repeated states: if the recorded acceptance is low, reduce its proposal variance; also check constraints and dependence before deciding that scale alone is the cause.
Rerun with coordinate-specific scale changes, inspect joint dependence, consider a covariance-based block proposal, and run longer chains from dispersed starting points. The MCMC trace diagnosis and proposal tuning should include actual acceptance rates and effective sample sizes; the three marginal trace plots do not by themselves identify correlations or prove convergence. Further practical details are in the three subparts.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 47 5 b Solution Created 2026-10-03 Updated 2026-10-14
For each observation time, use only the currently susceptible risk set , with new-infection indicators . PutThis is the spatial Bernoulli infection model, under conditional independence of the indicators. Distances must be positive. Already infected trees should not be included as new susceptible trials. The minus sign in the power kernel is present in the original PDF, although it is absent in the converted TeX.
The parameter must be nonnegative: for and positive exposure, is not a probability. Therefore the stated unrestricted normal prior distribution cannot literally define the model. A coherent interpretation is a normal prior distribution restricted to ,Here is the standard normal distribution function. Use the same proper prior distribution in both kernel models. The given Gaussian prior distributions for and are mathematically valid on the real line for finite positive distances, though restricting them to positive values would impose decaying kernels and would require the corresponding normalized prior distributions.
The full conditional kernels areNeither is generally normal or another elementary conjugate family: the infection factors contain , and depends nonlinearly on . Thus a simple conjugate Gibbs sampler is unavailable. This does not make Gibbs sampling logically impossible; exact rejection or slice conditional draws could be used if implemented. A straightforward alternative is Metropolis–Hastings algorithm updates within each coordinate.
For example, put and use symmetric Gaussian random-walk proposals for . The target in these coordinates isThe factor is the Jacobian determinant and must be retained. Accept according to the ratio of this target, either for a block or one coordinate at a time. Posterior averages and quantiles of and estimate the requested marginal posterior distributions.
To compare kernels, introduce with positive model prior distribution probabilities . Under model two replace by , defining . The joint model/parameter target iswhere or and is its normalized proper prior distribution. Within each model use the preceding random-walk updates. For a concrete model switch, keep , propose the other model's kernel parameter independently from its prior distribution, and use equal forward and reverse switch-selection probabilities. A move from draws and has ratioAccept with the minimum of this ratio and one. The auxiliary-coordinate swap has absolute Jacobian determinant one, so no additional factor occurs; unequal switch-selection probabilities would require their reverse/forward ratio. This is a valid model-switching Markov chain Monte Carlo construction even though the two active models have equal parameter dimension. Prior distribution proposals may be inefficient, so fitted proposals can be substituted provided their probability densities remain in the acceptance ratio.
After checking mixing, estimate posterior model probabilities by the fractions of retained iterations in each model. The Bayes factor in favor of the first kernel isUse the posterior distributions within each model as well as these odds to assess the competing distance kernels. Proper prior distributions and their model-dependent normalizing constants are essential for this comparison.
