Your predicate should be true if the Solution given is a valid one,…
Question Answered step-by-step Your predicate should be true if the Solution given is a valid one,… Your predicate should be true if the Solution given is a valid one, and should be capable of finding a valid Solution in response to a query such as tiling([[1,1],[1,2],…,[10,10]],X,[10,10]). Full marks will only be given for predicates that can explonit backtracking to find all possible solutions. [12 marks] 6 CST.2003.13.7 8 Databases (a) Define the ACID properties of a transaction. [6 marks] (b) Define what is meant by strict two-phase locking (strict 2PL). [4 marks] (c) Assume that in addition to traditional Read and Write actions a DBMS supports increment and decrement actions: Inc and Dec (both are assumed to perform blind writes). Consider the following two transactions. T1 : [Inc(A), Dec(B), Read(C)] T2 : [Inc(B), Dec(A), Read(C)] (i) By considering some possible elements. State Schwarz’s inequality for each of the products AB and Ax. What are the singular values of A, and how are they related to the `2 norm of A? [4 marks] (c) Describe briefly the singular value decomposition A = UWVT , and how it may be used to solve the linear equations Ax = b. [4 marks] (d) Let x be an approximate solution of Ax = b and write r = b?Ax, e = x?x. Find an expression for an upper bound on the relative error kek / kxk in terms of computable quantities. Show how this formula may be computed using the singular values of A. [8 marks] (e) Suppose A is a 5 × 5 matrix and its singular values are 103 , 1, 10?14 , 10?18, 10?30. If machine epsilon ‘ 10?15 then choose a suitable rank for an approximate solution and form the generalised inverse W+. [3 marks] 7 [TURN OVER CST.2003.13.8 10 Introduction to Functional Programming (a) Explain the difference between lazy and eager evaluation, illustrating with an example. [5 marks] (b) Given the following definitions fun I x = x; fun K x y = x; fun S x y z = x z (y z); give the most general type of each of the following five expressions: (i) K (ii) K I (iii) S (iv) S (K S) (v) S S (K I) [15 marks] 11 Natural Language Processing (a) Define the following terms, as they are used in grammar formalisms for natural language: (i) feature structure (ii) feature structure subsumption (iii) feature structure unification [8 marks] (b) Discuss the advantages and disadvantages for NLP applications of grammar formalisms that use feature structures compared with context free grammars. [12 marks] 8 CST.2003.13.9 12 Complexity Theory (a) For each k, the k-clique problem is defined as the following decision problem: Given a graph G, does it contain a clique with at least k vertices? Show that k-clique is in P for each k. [6 marks] (b) The problem Clique is defined as the following decision problem: Given a graph G and an integer k, does G contain a clique with at least k vertices? Show that Clique is NP-complete, using the assumption that 3-SAT is NP-complete. [10 marks]Design a 2-bit multiplier for unsigned integers which takes input x1 x0 representing the unsigned integer X, y1 y0 representing the unsigned integer Y , and produces the output z3 z2 z1 z0 representing the unsigned integer Z. [4 marks] (b) How can multipliers designed in part (a) be cascaded (with adders) to provide a four-bit multiplier? [4 marks] (c) Design a sequential 8-bit multiplier. You can assume that a 16-bit adder has been provided. The finite state control can be described by a state diagram. [8 marks] (d) Outline the design of a sequential divider which can divide 16-bit unsigned integers by 8-bit unsigned integers. [4 marks] 4 CST.2003.2.5 SECTION C 4 Probability In order to test the integrity of a network of ducting, engineers have developed an inspection device which can be introduced at a node and which then finds its way along a length of ducting to an adjacent node. In a particular case, eight nodes are sited at the vertices (corners) of a cube and 12 lengths of ducting are arranged along the edges of the cube. The inspection device is introduced at one node and equiprobably chooses one of the three lengths of ducting leading from that node for its first move. On arrival at the adjacent node the device equiprobably chooses one of the three lengths of ducting leading from that node (including the length it has just inspected). It continues in this fashion until the engineers stop its operation. Let An be the probability of the inspection device returning to the starting node after n moves, and deem A0 = 1. Let Dn be the probability of the inspection device visiting the node diagonally opposite the starting node after n moves. Clearly, D0 = 0. (a) Demonstrate that An = 0 for all odd n and that Dn = 0 for all even n. [4 marks] (b) Determine A2, A4 and A6 expressing all values as fractions. [8 marks] (c) To what value does An tend as (even) n increases indefinitely? [4 marks] (d) By noting a pattern in the values of A2, A4 and A6 or otherwise, give (without proof) an expression for the value of An for arbitrary n. [4 marks] 5 [TURN OVER CST.2003.2.6 5 Probability (a) If a continuous probability density function (p.d.f.) f(x) is transformed by some transformation function y(x) into a new p.d.f. g(y), then: g(y) = f x(y) dx dy What constraints are there on the function y(x) and its inverse x(y)? What is the significance of the vertical bars round dx dy ? [4 marks] (b) Suppose that X is a continuous random variable distributed Uniform(0,1). Its p.d.f. f(x) is given by: f(x) = ( 1, if 0 6 x < 1 0, otherwise What four transformation functions are required to transform f(x) into the following: (i) g(y) = ( ?.e??y , if y > 0 0, otherwise [4 marks] (ii) g(y) = ( sin y, if 0 6 y < ? 2 0, otherwise [4 marks] (iii) g(y) = ( 1 2 (2 ? y), if 0 6 y < 2 0, otherwise [4 marks] (iv) g(y) = ( 3 8 (2 ? y) 2 , if 0 6 y < 2 0, otherwise [4 marks](a) Suppose that X is a random variable whose value r is distributed Geometric(p).Write down the expression for the probability P(X = r). [3 marks](b) By using a suitable generating function or otherwise, show that the expectationE(X) = (1 ? p)/p. [5 marks]The University Computing Service define a serious power outage as a power cut thatlasts for longer than their Uninterruptable Power Supply equipment can maintainpower. During the course of an academical year the number of serious power outagesis a random variable whose value is distributed Geometric(2/5). Accordingly, theprobability of having no serious power outages during the course of a year is 2/5.(c) The University is investigating a compensation scheme which would make nopayment over the year if the number of serious power outages were zero orone but which would pay the Computing Service £1000 for every such outage(including the first) if the total number of serious power outages in a year weretwo or more. Determine the expected annual sum that the Computing Servicewould receive. [8 marks](d) To what value would the parameter of the Geometric Distribution have to bechanged (from 2/5) for the expected annual sum to be £750? [4 marks]6 Probability(a) Give a brief account of the Trinomial Distribution and include in yourexplanation an expression that is equivalent to n!r!(n?r)! prqn?rfor the BinomialDistribution. [5 marks](b) An indicator light can be in one of three states: OFF, FLASHING and ON, withprobabilities 1/2, 2/5 and 1/10 respectively. A test panel has five such lightswhose states are mutually independent.(i) What is the probability that all five lights are OFF? [3 marks](ii) What is the probability that three lights are OFF, one light is FLASHINGand one light is ON? [3 marks](iii) What is the probability that three or more lights are OFF and at most oneis ON? [9 marks]All results must be expressed as fractions.6(c) What shortcoming of the A? algorithm does the RBFS algorithm address, and how does it achieve this? [2 marks] 8 CST.2008.10.9 8 Introduction to Security (a) A source of secure, unpredictable random numbers is needed to choose cryptographic keys and nonces. (i) Name six sources of entropy that can be found in typical desktopcomputer hardware to seed secure random-number generators. [4 marks] (ii) What sources of entropy can a smartcard chip, like the one in your University Card, access for this purpose? [4 marks] (b) As Her Majesty's prime hacker "001", on a mission deep inside an enemy installation, you have gained brief temporary access to a secret chip, which contains a hardware implementation of the DES encryption algorithm, along with a single secret key. You connect the chip to your bullet-proof laptop and quickly manage to encrypt a few thousand 64-bit plaintext blocks of your choice, and record the resulting 64-bit ciphertext blocks. You are unable to directly read out the DES key K used in the chip to perform these encryptions and you will not be able to leave the site without knowing K. But you know that all S-boxes in the last DES round are supplied in this chip via a separate power-supply pin. When you create a short-circuit on that pin, the encryption progresses as normal, except that the output of all S-boxes in the last round changes to zero. (i) Explain briefly the role of an S-box and the structure of a single round in DES. [4 marks] (ii) How can you find K, considering that your available time and computing power will not permit you to search through more than 109 possible keys? [8 marks] 9 (TURN OVER) CST.2008.10.10 9 Data Structures and Algorithms (a) Take an initially empty hash table with five slots, with hash function h(x) = x mod 5, and with collisions resolved by chaining. Draw a sketch of what happens when inserting the following sequence of keys into it: 35, 2, 18, 6, 3, 10, 8, 5. [You are not requested to draw the intermediate stages as separate figures, nor to show all the fields of each entry in detail.] [3 marks] (b) Repeat part (a) but with the following three changes: the hash table now has ten slots, the hash function is h(x) = x mod 10, and collisions are resolved by linear probing. [3 marks] (c) Imagine a hash table implementation where collisions are resolved by chaining but all the data stays within the slots of the original table. All entries not containing key-value pairs are marked with a Boolean flag and linked together into a free list. (i) Give clear explanations on how to implement the set(key, value) method in expected constant time, highlighting notable points and using high-level pseudocode where appropriate. Make use of doubly-linked lists if necessary. [8 marks] (ii) Assume the hash table has 5 slots, is initially empty and uses the hash function h(x) = x mod 5. Draw five diagrams of the hash table representing the initially empty state and then the table after the insertion of each of the following key-value pairs: (2, A), (2, C), (12, T), (5, Z). In the final diagram, draw all the fields and pointers of all the entries. [6 marks] 10 CST.2008.10.11 10 Operating System Foundations (a) Assume a 32-bit architecture with hardware support for paging, in the form of a translation lookaside buffer (TLB), but no hardware support for segmentation. Assume that the TLB is shared rather than flushed on process switching and that the operating system designers are supporting "soft" segments. (i) In addition to page number and page base, what fields would you expect to find in each TLB register? How would each of these be used? [4 marks] (ii) What fields would you expect to find in a process page table? How would each of these fields be used? [6 marks] (b) (i) Outline the function of a timing device. [2 marks] (ii) Why are timers essential in multiprogramming operating systems? [2 marks] (iii) Explain the operation of a multi-level feedback queue in process scheduling. [6 marks] Math Logic KLFAD knlkad Share QuestionEmailCopy link Comments (0)


