Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Distributed Systems Einstein has established that there is no universal time. For earth-based computer systems discuss how events might be assiganed a time stamp which

Distributed Systems Einstein has established that there is no universal time. For earth-based computer systems discuss how events might be assiganed a time stamp which is reasonably close to conventional earth-time. Describe the constraints on system-wide event ordering and discuss alternative approaches to meeting them. For a system in which data replicas are maintained: Either Define total order and causal order applied to the delivery of update messages to the replicas. Outline an approach to maintaining causal order. or Describe algorithms and protocols which may be used to achieve consistency of replicas at all times. 


What is meant by SWOT analysis? A small computer company with strong and innovative hardware expertise is considering manufacturing a network interface computer (NIC). The device, which would sell for about half the current price of a PC, is based on games console technology, with a built-in modem. It would allow a user to convert his or her television to a web-browser. Apart from a small amount of parameter storage, the proposed device contains no disc or other long-term memory. How would you determine the market for such a device? Perform an analysis of this opportunity. What advice would you give the company? on changes to the business model that may be expected to be caused by the rapid development of the Internet.

Fortran gives semantic meaning to parentheses, i.e. a+b+c permits compiler re-arrangement whereas (a+b)+c does not. This matters for floating point. However, since Fortran '+' is left associative the above two expressions yield the same parse tree, and we have a contradiction. (d) Two alternatives to conservative garbage collection are liberal garbage collection or new labour style de-allocation. (e) Any type 3 (regular) grammar is also a type 2 (context-free) grammar. Hence any lexer generated by lex (or JLex) could instead be generated by yacc (or Cup). (f ) When a compiler for a language like Java compiles e1+e2, it computes the types of e1 and e2 so that it can treat it as e1+(float)e2 if e1 is of type float and e2 is of type int. (g) A syntax-tree interpreter can fail (give an error) when evaluating a variable name which does not appear in the current environment. Any program which fails using static scoping will fail using dynamic scoping. (h) A syntax-tree interpreter can fail (give an error) when evaluating a variable name which does not appear in the current environment. Any program which fails using dynamic scoping will fail using static scoping. (i) A dynamically-typed language is one in which the type of a value is carried around at run-time; a type error is given at run-time if values are used inappropriately. Such languages must be dynamically linked otherwise type errors will occur. (j) Java .class files and ELF-style .o (or .obj) object files represent similar information, i.e. compiled code, a list of symbols made available to other functions, and a list of undefined symbols which the file expects to be defined elsewhere. [2 marks each] 6 CST.2003.6.7 7 Artificial Intelligence I A simple game works as follows. We have a board divided into n by m square cells. We also have an unlimited number of L-shaped tiles, each made to cover exactly three squares. The tiles can appear in any of the four possible orientations. Our aim is to cover the board completely with non-overlapping tiles. (a) A single tile on the board can be described using a list such as [[1,1],[1,2],[2,1]] containing three tuples, specifying the position of each part of the tile on the board. Consider the following Prolog predicate, which is true if the six variables describe a correct, L-shaped tile. tile([[A,B],[C,D],[E,F]]) :- C is A+1, D is B, E is A, F is B-1; C is A+1, D is B, E is A, F is B+1; C is A-1, D is B, E is A, F is B+1; C is A-1, D is B, E is A, F is B-1. Explain what happens in response to a query of the form tile([[4,5],[B,C],[D,E]]). Keep in mind the effects of backtracking. [2 marks] (b) Write a Prolog predicate goodplace([[A,B],[C,D],[E,F]],[N,M]) that is true if [[A,B],[C,D],[E,F]] is a validly shaped tile and all of its parts lie within an N by M board. Your predicate should behave under backtracking in such a way that the response to a query of the form goodplace([[10,4],[B,C],[D,E]],[10,10]). is to find the unspecified values for all tiles which have a valid shape and fall within the board. In this example there would be two such tiles. [6 marks] (c) Write a Prolog predicate tiling(Available,Solution,Size). Here, Size is the size of the board represented as above, Solution is a list of tiles that solves the problem, and Available is a list of available positions on a board of the given size. For example, if Size is [2,2] then Available is [[1,1],[1,2],[2,1],[2,2]]. 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 exploit backtracking to find all possible solutions.

Write program that receives a positive integer n from the user and then calculates the sum below by using a loop. Your program needs to ask the user to re-enter a different number if the user enters a non-positive one. a program that asks the user for a positive integer number. If the user enters anything else, the program would ask the user to re-enter a number or enter -1 to quit. If it is a positive number, the program then prints out a multiplication table that goes up to that number.

The quantum teleportation protocol is a means by which one party, Alice, can send a quantum state to another party, Bob, by transmitting just two classical bits, provided that the two already share an entangled 2-qubit state. Explain how the quantum teleportation protocol works, sketching any circuit that may be used. [6 marks] (c) The Deutsch-Jozsa problem assumes that we are given a function f : {0, 1} {0, 1} in the form of a quantum black box performing a unitary operation Uf : |abi 7 |a(b f(a))i. Sketch a circuit with only one use of Uf that determines whether f is constant or balanced. Explain carefully what measurement is performed and why it gives the desired result. [8 marks] 4 CST.2008.9.5 5 Artificial Intelligence II A friend of mine likes to climb on the roofs of Cambridge. To make a good start to the coming week, he climbs on a Sunday with probability 0.98. Being concerned for his own safety, he is less likely to climb today if he climbed yesterday, so Pr(climb today|climb yesterday) = 0.4 If he did not climb yesterday then he is very unlikely to climb today, so Pr(climb today|climb yesterday) = 0.1 Unfortunately, he is not a very good climber, and is quite likely to injure himself if he goes climbing, so Pr(injury|climb today) = 0.8 whereas Pr(injury|climb today) = 0.1 (a) Explain how my friend's behaviour can be formulated as a Hidden Markov Model. What assumptions are required? [4 marks] (b) You learn that on Monday and Tuesday evening he obtains an injury, but on Wednesday evening he does not. Use the filtering algorithm to compute the probability that he climbed on Wednesday. [8 marks] (c) Over the course of the week, you also learn that he does not obtain an injury on Thursday or Friday. Use the smoothing algorithm to compute the probability that he climbed on Thursday. (a) Explain how to simulate a physical system consisting of point masses and springs using the Euler method. [5 marks] (b) Explain the problems exhibited by the Euler method and describe an alternative that gives a better solution. [5 marks] (c) State and explain the radiosity equation. [4 marks] (d) Compare and contrast the following ways of solving the radiosity equation: matrix inversion, gathering, shooting. [6 marks] 8 Specification and Verification II (a) Explain how the structure of circuits can be represented in logic. Discuss the role of quantifiers and of higher-order functions and relations. [8 marks] (b) Show how a predicate characterising the set of reachable states of a transition relation can be defined in higher-order logic. [4 marks] (c) Write down formulae in both Computation Tree Logic (CTL) and Linear Temporal Logic (LTL) that are true whenever a property P holds of all reachable states. Define the semantics of any temporal operators that you use. [8 marks] 7 (TURN OVER) CST.2008.9.8 9 Natural Language Processing The following shows a simple context-free grammar (CFG): S -> NP VP NP -> Kim NP -> Sandy NP -> Det N N -> pudding N -> N S Det -> the VP -> V V -> likes V -> stinks V -> believes VP -> V NP VP -> V S (a) Give a parse tree (or trees) to show the analysis this grammar assigns to the following: the pudding Kim believes Sandy likes stinks [3 marks] (b) What is meant by the term overgeneration? Why might overgeneration be a problem when using a grammar for parsing grammatical text? [3 marks] (c) The grammar shown above does not allow for different subcategorization properties of verbs. Assume that the following sentences should all be ungrammatical: Kim likes Kim stinks the pudding the pudding Kim stinks stinks the pudding Kim likes Sandy stinks Assuming the simple CFG formalism, show how the grammar above could be modified to exclude such sentences while still admitting strings such as the one in part (a).

(a) The relational schema R(A, B, C, D, E) has the following functional dependencies. A E B D A, B C Decompose this into a set of relations in BCNF. Show your working. [5 marks] (b) By inspecting your answer to (a), describe a possible interpretation in the language of Entity-Relationship modelling. [5 marks] (c) Heath's Rule tells us that if R(A, B, C) is a relational schema with functional dependency A B, then R = A,B(R) A A,C(R).

become a gambling cheat. He has a biased coin with Pr(head) = p and two dice. The first die is biased with Pr(n) = pn for the nth outcome with n {1, 2, 3, 4, 5, 6}. The second die is also biased, and has different numbers: its distribution is Pr(n) = qn with n {4, 5, 6, 7, 8, 9}. Evil Robot flips the coin. If he gets a head then he rolls the first die, otherwise he rolls the second. He then tells you the outcome. You see only the number obtained and nothing else. He does this m times, so you observe a sequence of m numbers in the range 1 to 9. Your aim is to estimate p and the distributions of each die, given the m numbers. In the following, n is the vector of m observed numbers (n1 nm) T , is the set of parameters {p, p1, . . . , p6, q4, . . . , q9} and we define q = 1 p. (a) Write down an expression for the distribution Pr(n|) where n {1, . . . , 9}.

(a) (i) Calculate gcd(144, 77), the greatest common divisor of 144 and 77, as an integer linear combination of 144 and 77. [4 marks] (ii) What is the multiplicative inverse of 77 in Z144 and the multiplicative inverse of 67 in Z77? [2 marks] (iii) Describe all integers x that solve the following two congruences

77 x 1 (mod 144) 67 x 3 (mod 77) Indicate how one may calculate the least natural number solution to the above. [4 marks] Justify your answers. (b) For a string w {1, 2} , let P(w) N denote the sum of all the numbers in it. For instance, P() = 0 for the null string, and P(1212) = 6. For every n N, define Sn =

w {1, 2} | P(w) = n

. In particular, S0 and 1212 S6. (i) List the elements of Sn for each n {0, 1, 2, 3, 4, 5}. [2 marks] (ii) What is the cardinality of Sn for each n N? Prove your claim. [5 marks] (iii) For all m, n N, define a bijective function

(Sm+1 Sn+1) ] (Sm Sn)

Sm+n+2

Explain (a) a technique that you could use to implement a pure functional programming language using applicative order (eager) evaluation; [6 marks] (b) a technique suitable if your implementation must use some form of lazy or normal-order evaluation. [6 marks] Comment on whether the behaviour of your implementation (b) is strictly and exactly the same as normal order evaluation in lambda-calculus. [3 marks] Comment about similarities and differences between your two techniques and any predictions you can make about their relative simplicity, performance or convenience. [5 marks] 11 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] (c) Explain why, if P=NP then there is a polynomial time algorithm for factorising numbers.

Explain mathematically why this is the case and show how to calculate the location on the screen of the vanishing point for lines in a particular direction. [5 marks] [Hint: It may be helpful to represent lines parametrically in vector form as P(s) = A + sV where V is a direction and A is any point on the line.] 4 Computer Graphics and Image Processing Consider a curve defined by polynomial parametric segments Pi(s) for i = 1, 2, . . . m that interpolates a set of points {Ai}0im in three dimensions. (a) What is meant by Ck continuity at the junction of two segments? [3 marks] (b) What is the least order of the polynomials that must be used to achieve Ck continuity at the junctions? [2 marks] (c) Derive the Overhauser formulation for a set of weighting functions w2(s), w1(s), w0(s) and w1(s) so that the cubic curve segment joining Ai1 and Ai can be expressed as Pi(s) = w2(s)Ai2 + w1(s)Ai1 + w0(s)Ai + w1(s)Ai+1 for 1 < i < m. [10 marks] (d) Extend this formulation to give a set of parametric patches Pi,j (s, t) for 1 < i < m and 1 < j < n interpolating a surface through an array of points {Ai,j}0im,0jn. [5 marks]

A full adder for a single bit has three inputs, a, b and cin, and two outputs, s and cout for the sum and carry-out. State the formulae for s and cout in disjunctive normal form. [2 marks] (b) Explain the operation of the following three approaches for handling carry in n-bit word adders, deriving formulae for the signals involved and explaining the limiting factors on their speed: (i) ripple carry, [2 marks] (ii) carry-skip with fixed-size blocks, and [6 marks] (iii) carry-skip with variable-size blocks. [4 marks] (c) Assuming a delay of for a round of combinational logic consisting of negation, conjunction and disjunction, estimate the delays for the three designs applied to a 48-bit adder. [3 2 marks] 3 Digital Communication II (a) In the context of Quality of Service (QoS) in networking, what do we mean by elastic and inelastic applications? [2 marks] (b) Give two examples of each type of application and discuss the application attributes and QoS requirements. [8 marks] (c) Discuss the problems faced by traditional Internet routers in dealing with inelastic traffic. [6 marks] (d) How do the IntServ and DiffServ architectures differ in offering QoS, and how might they be employed together to provide an end-to-end QoS? [4 marks] 3 (TURN OVER) CST.2008.9.4 4 Quantum Computing (a) The no-cloning theorem is a statement that is often said to show that a quantum state |i cannot be exactly duplicated. (i) Give a mathematically precise statement of the no-cloning theorem. [2 marks] (ii) Give a proof of the no-cloning theorem.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Industrial Relations in Canada

Authors: Fiona McQuarrie

4th Edition

978-1-118-8783, 1118878396, 9781119050599 , 978-1118878392

More Books

Students also viewed these Computer Network questions

Question

differentiate between challenge and hindrance demands;

Answered: 1 week ago

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago