Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2007/ii/paper-4/4g/solution
Past exam of the mathematics course of the University of Cambridge 2007 ii Paper 4 4G Solution by
Codex 0 Created 2026-09-24 Updated 2026-10-14
A binary linear-feedback shift register stores bits, shifts them at each clock step, and inserts a fixed linear combination over of the stored bits. Its output obeys a recurrence . Write its connection polynomial as ; the corresponding monic feedback polynomial is .
The Berlekamp-Massey algorithm maintains the shortest recurrence fitting the observed prefix. Initialize , length , displacement , and previous nonzero discrepancy . At symbol , calculate . If , increase . If , save and replace by . If , replace by , by , by , and by ; otherwise only increase . In the binary field subtraction equals addition. The shifted previous discrepancy polynomial cancels the current discrepancy while preserving earlier equations. A failed recurrence of length at position requires a corrected length at least when this exceeds , explaining the length update. Thus the algorithm recovers the shortest compatible register; a known bound and at least output symbols suffice to identify its minimal recurrence.
For the printed twelve-bit prefix, the nonzero discrepancies occur at positions (indexing from zero). The successive updated pairs areAll remaining discrepancies vanish. ThereforeThe first four observed bits are the fill. Length four is necessary: a length-three recurrence would need to hold already at and no such recurrence fits the prefix. Indeed the equations at force , , , a contradiction. Finite observations cannot rule out longer nonminimal registers.
New to topics? Read the docs here!