Solution
ID: past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2025/paper-2/2/c/solution
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.
New to topics? Read the docs here!