CST.2011.2.1 COMPUTER SCIENCE TRIPOS Prt IA Tuesdy 7 June 2011 1.30 to 4.30 COMPUTER SCIENCE Pper 2 Answer one question from ech of Sections A, B nd C, nd two questions from Section D. Submit the nswers in five seprte bundles, ech with its own cover sheet. On ech cover sheet, write the numbers of ll ttempted questions, nd circle the number of the question ttched. You my not strt to red the questions printed on the subsequent pges of this question pper until instructed tht you my do so by the Invigiltor STATIONERY REQUIREMENTS Script pper Blue cover sheets Tgs SPECIAL REQUIREMENTS Approved clcultor permitted
CST.2011.2.2 SECTION A 1 Digitl Electronics () Simplify the following expressions using Boolen lgebr: (i) F = A. B. C + A. B. C + A. B. C + A. B. C (ii) F = (X + Y ). (X + Y + Z). (X + Y + Z) (iii) F = (A. D + A. C). [B. (C + B. D)] [6 mrks] Give the truth tble for n encoder tht ccepts sign bit, S, nd two mgnitude bits X 0, X 1 nd gives three-bit output Y 2, Y 1, Y 0 tht re the two s complement encoding of the input. Using Krnugh mp, simplify the following expression to yield solution in sum-of-products form: Y = A. B. C. D + A. B. C. D + A. D + A. B. D Wht problem my exist with prcticl relistion of this solution, nd how my it be cured? [5 mrks] (d) Simplify the following expression using Krnugh mp to yield solution in product-of-sums form nd implement it using only NOR gtes ssuming complemented input vribles re vilble: Y = (B + C + D). (A + B + C). (A + B + D). (A + B + C) Neglect ny potentil problems in the prcticl relistion of your solution. [5 mrks] 2
CST.2011.2.3 2 Digitl Electronics () Show how two 2-input NOR gtes cn be connected together to implement n RS ltch. Describe its opertion nd give its truth tble. [6 mrks] Drw the stte digrm for synchronous modulo-4 up/down counter. The counter hs two control inputs: M is set t logic 0 to cuse the counter to count up, nd t logic 1 to cuse the counter to count down; E is set t logic 1 to enble the counter to count nd t logic 0 to cuse the counter to hold its current stte. A synchronous binry up-counter hving the stte sequence 1, 2, 3, 4, 5, 6, 1, 2,... is to be implemented using three D-type flip-flops. The flip-flop outputs re designted Q 2, Q 1 nd Q 0, where Q 0 represents the lest significnt digit of the count. (i) Give simplified expressions for the required next-stte logic, mking use of ny unused sttes. Does this counter self-strt? [6 mrks] (ii) Give the new simplified expression required for D 0 (the D-input of flip-flop Q 0 ) if the counter is now required to return to count of 1 if n unused stte is entered. SECTION B 3 Operting Systems () In the context of the protection of computer systems: (i) Wht is ment by ccess control? [1 mrk] (ii) Wht is n ccess control list? (iii) Wht is cpbility? (iv) How is ccess control mnged in the UNIX file system? [5 mrks] (v) How is ccess control mnged in Windows NT? [5 mrks] Describe how you cn use pge protection bits to implement not-recently-used pge replcement scheme. [5 mrks] 3 (TURN OVER)
CST.2011.2.4 4 Operting Systems () In the context of memory mngement: (i) Wht is the ddress binding problem? [1 mrk] (ii) The ddress binding problem cn be solved t compile time, lod time or run time. For ech cse, explin wht form the solution tkes, nd give one dvntge nd one disdvntge. [3 mrks ech] (iii) Under which circumstnces do externl nd internl frgmenttion occur? How cn ech be hndled? (iv) Wht is the purpose of trnsltion lookside buffer (TLB)? Describe how UNIX hndles user uthentiction. 4
CST.2011.2.5 SECTION C 5 Discrete Mthemtics II Let A nd B be sets. Let F P(A) B. So typicl element of F is pir (X, b) where X A nd b B. Define the function f : P(A) P(B) to be such tht for x P(A). f(x) = {b X x. (X, b) F } () Show for ll x, y P(A). if x y then f(x) f(y) [3 mrks] Suppose x 0 x 1 x n is chin of subsets in P(A). Recll n N 0 x n = { n N 0. x n }. Show tht f(x n ) f( x n ) n N 0 n N 0 [Hint: Use prt ().] Assume now tht F P fin (A) B where P fin (A) consists of the finite subsets of A. So now typicl element of F is pir (X, b) where X is finite subset of A nd b B. Suppose x 0 x 1 x n is chin of subsets in P(A). Show tht f( x n ) f(x n ) n N 0 n N 0 Deduce f( n N 0 x n ) = n N 0 f(x n ) ( ) [6 mrks] (d) Show tht ( ) need not hold if the set X in elements (X, b) of F is infinite. [7 mrks] 5 (TURN OVER)
CST.2011.2.6 6 Discrete Mthemtics II Let E be set. Assume F P(E) stisfies the two conditions 1. X F. X F 2. X F. X F Recll X =def {e E x X. e x} nd X = def {e E x X. e x} () Explin why F nd E F. Define the binry reltion on E by e e iff x F. e x e x for e, e E. Stte clerly wht it would men for to be reflexive nd trnsitive. Show is reflexive nd trnsitive. [5 mrks] For e E, define [e] = {x F e x} Explin why [e] F. Show [e] = {e e e} [6 mrks] (d) Sy subset z of E is down-closed iff e e & e z e z for ll e, e E. Show F consists of precisely the down-closed subsets of E by showing: (i) ny x F is down-closed; [3 mrks] (ii) for ny down-closed subset z of E, z = {[e] e z} nd hence z F (why?). 6
CST.2011.2.7 SECTION D 7 Probbility () Stte the probbility mss function for Poisson rndom vrible with prmeter λ > 0. Define the probbility generting function, G X (z), of rndom vrible X tking vlues in {0, 1, 2,...} nd derive n expression for G X (z) in the cse where X Pois(λ) with λ > 0. Show the following result G (r) X (1) = E(X(X 1) (X r + 1)) where r is positive integer nd G (r) X (1) denotes the rth derivtive of G X(z) with respect to z evluted t z = 1. (d) Using the result in prt derive the men nd vrince of Poisson rndom vrible with prmeter λ > 0. (e) Show the result tht if X nd Y re two independent rndom vribles with probbility generting functions G X (z) nd G Y (z), respectively, then G X+Y (z) = G X (z)g Y (z) where G X+Y (z) is the probbility generting function of X + Y. (f ) Show tht if λ 1, λ 2 > 0 nd X Pois(λ 1 ) nd Y Pois(λ 2 ) re independent rndom vribles then X+Y Pois(λ 1 +λ 2 ). Wht re the men nd vrince of X + Y? 7 (TURN OVER)
CST.2011.2.8 8 Regulr Lnguges nd Finite Automt () Give regulr expression r over the lphbet Σ = {, b, c} such tht the lnguge determined by r consists of ll strings tht contin t lest one occurrence of ech symbol in Σ. Briefly explin your nswer. [5 mrks] Let L be the lnguge ccepted by the following non-deterministic finite utomton with ε-trnsitions: q 1 q 2 q 3 ε q 0 q 4 q 5 (i) Drw deterministic finite utomton tht ccepts L. (ii) Write down regulr expression tht determines L. Briefly explin your nswers. [5 mrks] Show tht if deterministic finite utomton M ccepts ny string t ll, then it ccepts one whose length is less thn the number of sttes in M. [5 mrks] (d) Is the lnguge { n b l k {, b} k n + l } regulr? Justify your nswer. [5 mrks] 8
CST.2011.2.9 9 Softwre Design Imgine tht you re responsible for the design of computer system tht will be used to utomte the definition, evlution nd exmining of the cdemic content for course in the Cmbridge Computer Science Tripos. This system should llow the syllbus, lectures, supervision exercises nd exmintion ppers to be defined in consulttion with vriety of stkeholders, including students nd future employers. () How would you go bout determining the detiled requirements for this system? Be sure to mention ny obstcles tht you would expect to rise. Construct one or more UML use cse digrms nd single UML clss digrm, showing the overll structure of system tht includes the elements described bove. [10 mrks] Using nother type of UML digrm, illustrte the runtime behviour of one of the use cses. [3 mrks] (d) Explin why you chose the specific UML digrm used in prt. [1 mrk] (e) Wht precutions could you tke to ensure tht the introduction of the system ws s smooth s possible? (f ) Wht technicl precutions could you tke to ensure tht the system could be modified in response to future chnges in regultions or user requirements? END OF PAPER 9