Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 5 c Solution by
Codex 0 2026-10-20
This is an immigration--death process, equivalently an M-M-infinity queue: admission occurs at rate regardless of occupancy, and each of animals is discharged independently at rate . Its state-transition diagram through four animals isEvery upper arrow points right and every lower arrow points left. Thus and for , with no discharge from zero. Four is only the limit of the requested sketch, not an absorbing state or a capacity boundary.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 5 b Solution by
Codex 0 2026-10-20
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 4 d Solution by
Codex 0 2026-10-20
Before introduction there is no local infection exposure. Let years, using the actual elapsed time between introduction and sampling if exact dates are available. A lifelong resident aged has therefore had onlyyears of possible exposure. With a constant post-introduction force of infection , replace age by this exposure duration:Fit the same binomial regression with as its offset. The predicted seroprevalence increases with age up to 19 and then reaches a plateau, since older residents all began local exposure at introduction.
This is equivalent to using a calendar-time force of infection of zero before 2005 and afterwards. With a changing post-introduction rate, the more general exposure is . Account separately for migration or infection acquired elsewhere, since current residence alone need not specify lifetime exposure. Subjects with exactly zero exposure have model probability zero and cannot be included by taking as an ordinary finite offset; handle them through the original probability model.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 4 c Solution by
Codex 0 2026-10-20
A susceptible person must have the same annual force of infection at every age. Thus the difference between age groups is their length of exposure, not an age-dependent infection hazard. To interpret one fitted constant as a historical annual force of infection, also assume that this common rate was sufficiently stable over the calendar years represented by the sampled birth cohorts. Otherwise an age pattern can reflect past outbreaks or cohort exposure, and the fitted constant is only a model-dependent summary. Representative sampling and comparable antibody detection across ages are additional conditions on interpreting the observed seroprevalence.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 4 b Solution by
Codex 0 2026-10-20
Assume a constant annual force of infection across ages and calendar years. For independent sampled people with ages and binary results , fitApplying the complementary log-log link givesTherefore fit a binomial regression with the complementary log-log link, an intercept, and as an offset with coefficient fixed at one. Age is measured in years. An ordinary freely fitted coefficient of age, or even a freely fitted coefficient of , would describe a different exposure model. The annual force of infection estimate isAn infection-naive person's one-year infection probability is , which is approximately only when that rate is small.
The log-likelihood being maximized is, apart from constants,A confidence interval for can be exponentiated to give a positive interval for . For groups of people at a common age , use with the same offset. If an age band is broad, use individual ages or average over the band's age distribution instead of treating its midpoint as exact. No numerical estimate is possible without the survey observations.
The biological interpretation assumes that immunoglobulin G positivity records previous infection, persists over the relevant ages, and is not substantially produced by maternal antibodies or vaccination. These are conditions to check, rather than conclusions from the fitted curve. Use known-positive and known-negative serum controls to assess the assay threshold, and validate specificity against relevant other infections. Cross-reactive antibodies to other flaviviruses can produce positive dengue virus serology, so a positive result need not be a marker specific to dengue virus exposure.[ref]
Serologic Tests for Dengue Virus by the Centers for Disease Control and Prevention. IgG Tests: persistence after previous exposure and cross-reactivity with other flaviviruses
If independently established assay diagnostic sensitivity and diagnostic specificity are and , the observed positive probability isUse that observation model in the binomial likelihood; it is generally no longer the simple intercept-plus-offset complementary log-log link fit. With only the stated survey, one cannot freely estimate , , antibody loss and an arbitrary infection history simultaneously. A single binary result also does not identify how many subsequent infections a person has experienced.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 4 a Solution by
Codex 0 2026-10-20
Let be the true seroprevalence at age , and the force of infection, meaning the instantaneous rate of a first infection among people still uninfected. In an irreversible serocatalytic model, people begin seronegative and retain detectable antibodies after infection. Their seronegative fraction obeysHenceEquivalently, where differentiation is possible, . This identifies the force of infection as a hazard function and as the survival function for remaining uninfected. For constant exposure , . A single calendar-time survey reflects each birth cohort's accumulated exposure; interpreting the same age curve as a timeless age effect requires assumptions about historical transmission.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 3 d Solution by
Codex 0 2026-10-20
The two descendant branches of an equal-rate Jukes-Cantor model compose to a single branch of duration . More explicitly, the model is symmetric, so summing over the ancestral base gives and a total mismatch probability . Thus use the pairwise difference fraction directly with , rather than halving the differences and correcting the halves separately:This is the parameter in the printed formula of (c). For a mutation rate measured as actual changes per site per year, the conversion derived in (b) givesThe latter is directly comparable to the naive estimate in (a): allowing repeated changes raises that estimate by about . The exponent parameter and actual event rate are two conventions for the same fitted process, not two different biological estimates.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 3 c Solution by
Codex 0 2026-10-20
Under the independent-site Jukes-Cantor model, the number of differences from a known ancestor has a binomial distribution with mismatch probabilityFor an interior estimate, maximum likelihood estimation gives . Equating this to the model probability and rearranging givesThis is finite for . At , the estimate tends to infinity: the endpoint distribution has reached its limiting saturation and no finite rate can reproduce it exactly. For , the displayed logarithm is not defined as a real number; within this model the constrained likelihood is maximized only as . For the boundary estimate is zero. The corresponding estimate of the actual event mutation rate is .
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 3 b Solution by
Codex 0 2026-10-20
The printed “otherwise” branch requires correction. Its factor is the probability of ending at any of the three bases different from the initial base, not of ending at one specified different base. Assigning that probability to each of three alternatives would make a row of the transition matrix sum to , which exceeds one for . This distinction is present in the source PDF, not introduced by the transcription.
For a consistent Jukes-Cantor model, let each ordered change from one nucleotide to a specified different nucleotide have instantaneous rate . Its continuous-time Markov chain has diagonal generator entries and off-diagonal entries . If is the probability of still having the same base as at time zero, its Kolmogorov equations giveSolving the linear ordinary differential equation givesSet to match the exponent used in the question. Symmetry then gives the properly normalized transition probabilitiesSumming the three different-base outcomes yieldsThe assumptions are a time-homogeneous Markov process, the same change rate between every distinct ordered base pair, identical rates across independent sites, and no insertions or deletions. The stationary distribution is uniform over the four bases; starting the process in that distribution is not required for this conditional calculation.
There is also a parameter-convention issue. The actual total mutation rate out of a base is . Thus the exponent parameter in (b)–(d) is times the event rate used in the elementary counting interpretation of (a). Keeping this conversion explicit avoids changing the meaning of “mutation rate” halfway through the calculation.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 3 a Solution by
Codex 0 2026-10-20
Let be the time since the two sampled mitochondrial genomes shared their ancestor. Under the stipulated one-change-per-difference approximation, both descendant lineages contribute, giving a total evolutionary duration . Therefore the per-site, per-lineage mutation rate estimate isThis is not a whole-genome event rate; multiplying by the number of usable sites would give that rate. Without equal lineage rates, the pairwise data identify their sum rather than either rate separately.
The calculation assumes an accurate sequence alignment of corresponding ancestral sites, negligible errors in DNA sequencing, and an appropriate divergence-time calibration for the sampled mitochondrial genomes. It assumes a constant molecular clock on each lineage, comparable rates across sites for this simple average, and no extra differences introduced by incorrectly aligned insertions or deletions. It treats observed nucleotide substitutions as a record of mutations; interpreting a substitution-based rate as the underlying mutation rate additionally requires a suitable neutral model rather than strong filtering by natural selection. Independence between sites is useful for a simple sampling model and uncertainty calculation. The supplied time must refer to the common ancestor of these sequences: a species split need not coincide exactly with a sampled gene's ancestral split.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 2 e Solution by
Codex 0 2026-10-20
Let be the hidden state. With the usual convention and , the Markov property and the conditional independence of emissions factor the joint probability asThe requested state-path probability after observing the complete data is the corresponding conditional probability:Here the forward algorithm and backward algorithm give the same normalizer at any interior time,There is no extra factor : it is already included in . If an unconditioned joint probability with the observations is intended, it is the numerator alone. Summing the boxed expression over all gives one.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 2 d Solution by
Codex 0 2026-10-20
For the same uniform background and base-two log-likelihood ratio, replace every emission probability by . The background specifies independent letters, not a competing hidden-state process. Its single emitting state has continuation factor one when scoring a fixed-length word, so each model transition contributes ; dividing every transition by would incorrectly count the background twice.
The complete transition-score diagram isEvery omitted transition has score . Silent Start and End supply no emission score. The complete table of emission scores isFor the unique nonzero path identified in (b), add the five emission scores and all transition scores:This equals (c). For a sequence with several nonzero hidden paths, the full log-likelihood ratio is the log-sum-exp of their path scores; selecting only the largest score would instead compute a best-path approximation.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 2 c Solution by
Codex 0 2026-10-20
Use a uniform independent DNA background, so each nucleotide has probability . Conditional on length five, its sequence probability is . The requested score, often called log-odds in sequence analysis, is a log-likelihood ratio against this background:Using natural logarithms instead gives . Identically distributed independent positions do not, by themselves, require equal base frequencies. If the intended background instead has specified frequencies , the general answer isThe numerical value above uses the conventional equal-frequency random DNA model.
Taking a logarithm only after multiplying probabilities does not prevent floating-point underflow: the product may already have rounded to zero, and its logarithm is then . Accumulate logarithms before forming tiny products; where alternative paths must be added, use log-sum-exp in the forward algorithm or rescale its intermediate probabilities.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 2 b Solution by
Codex 0 2026-10-20
The sequence has five characters, while the four match states account for four compulsory emissions. Consequently exactly one insertion state emission is needed. An insertion at would have to emit T, which has probability zero there. The only nonzero hidden path is thereforeMultiply its transition probabilities and emission probabilities, including the probability of exiting immediately and bypassing :Normally the forward algorithm sums over all compatible paths. Here all other paths have probability zero, so this single path gives the full sequence probability.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 2 a Solution by
Codex 0 2026-10-20
With no deletion states allowed, each match state must emit once in every aligned sequence. Thus the four gap-free alignment columns, , become . Columns and form one optional run, represented by a single looping insertion state ; column requires a separate insertion state after . Two insertion states are sufficient and minimal in an ordered profile hidden Markov model: the two optional regions are separated by a compulsory emission and occupy different positions in the profile.
Estimate each transition probability by the number of observed uses of that transition divided by all transitions leaving its source state. The complete arrow diagram is given below; repeated labels denote the same state, so the second and third lines supply the branches of the first line. Start and End are silent:Three aligned sequences visit , giving three exits to , while one sequence emits twice there, giving one self-transition. Thus its exit and loop probabilities are and , respectively. Two sequences visit and two bypass it. All absent transitions have probability zero.
The probability mass functions of the emitting states, estimated from all characters assigned to each state with no added counts, areIn particular, pooling the two optional columns into pools four emissions: two T, one A and one G. This is a generative Hidden Markov model, so it can generate other run lengths and combinations as well as the training sequences; reproducing each training column deterministically is not its purpose.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 1 d Solution by
Codex 0 2026-10-20
Build an FM-index: store the Burrows-Wheeler transform, cumulative character counts , and a structure supporting fast rank queries for . Then each step of backward search uses two rank queries instead of rescanning the last column. A wavelet tree or suitably checkpointed counts can supply these queries while keeping memory manageable. The counting cost is proportional to query length times the rank query cost, rather than repeatedly scanning the whole genome.[ref]
Opportunistic Data Structures with Applications by Paolo Ferragina and others. §2, LF-mapping; §§3.1–3.2, counting and locating occurrences
To recover genomic positions, store a sampled suffix array and follow the last-to-first mapping to a sampled position, adding the number of steps taken. More samples trade storage for faster position recovery. Index character counts and sample positions, rather than storing the quadratic-size full cyclic rotation matrix.
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 1 c Solution by
Codex 0 2026-10-20
Use one-based row numbers, and write and for the first and last columns. The last-to-first mapping matches the th occurrence of a character in to its th occurrence in : equal characters retain the ordering of their following suffixes. This lets us extend an interval of matching suffixes one character to the left without reconstructing the full strings.
Start with the last query character. Rows of contain C, so the interval of suffixes beginning with C is . Within those rows, the A entries of are at rows and . They are respectively the first and second A entries in all of , and therefore map to rows and of . These are exactly the suffixes beginning with AC. Reading their supplied positions gives matches starting at positions 11 and 3, or positions 3 and 11 in increasing genomic order.
The same calculation can be written as backward search. Let count characters strictly smaller than , and let count occurrences of in , with . Prepending changes an inclusive interval toHere , and , giving .
Past exam of the mathematical and Computational Biology course of the University of Cambridge 2025 Paper 2 1 b Solution by
Codex 0 2026-10-20
To invert the Burrows-Wheeler transform, begin with six empty rows. At every iteration prepend the supplied last-column characters in their fixed row order, then sort the resulting rows in lexicographic order. After iterations the rows contain the length- prefixes of the sorted cyclic rotations. For example, the first two iterations giveEach iteration works because sorting the preceding character together with the already reconstructed prefix restores the ordering of the next-longer prefixes. Six iterations give the completed matrixThe original linear string is the unique row ending in the terminator, henceAs a check, the reconstructed matrix's final column is precisely the supplied Burrows-Wheeler transform.
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





