Bioinformatics (a) Describe, with one example, the complexity of…
Question Answered step-by-step Bioinformatics (a) Describe, with one example, the complexity of… Bioinformatics (a) Describe, with one example, the complexity of using dynamic programming in multiple alignment. [3 marks] (b) Describe the differences between genome assembly (i.e. using a reference genome) and genome de novo sequencing from a bioinformatics perspective. [5 marks] (c) The de Bruijn Graph is widely used in Bioinformatics. (i) Describe with one example how to construct the paired de Bruijn Graph. [5 marks] (ii) Describe scuss how you would go about identifying and choosing the exit route to pursue. [6 marks] (c) Identify your preferred exit route and discuss how you would go about managing the process. [11 marks] (SoC) designs become more complex, so does the on-chip interconnect. (i) Why does the design of an on-chip network differ greatly from that of larger scale networks? [3 marks] (ii) Draw a diagram showing the datapath of an on-chip router with virtual channels. [3 marks] (iii) How do virtual channels help to reduce packet latency? [3 marks] (iv) For what reason, other than performance, may virtual-channel flow control be useful? [2 marks] (b) You have been asked to outline the design of a high-performance 16-core processor suitable for use in a server-class machine. (a) In SystemVerilog, what is the difference between: (i) The ternary operator ? and if…then…else statements? [2 marks] (ii) always_ff and always_comb? [2 marks] (iii) Blocking, non-blocking and continuous assignment? [3 marks] (iv) Logic values 0, 1, x and z and how these values propagate through Boolean logic gates? [3 marks] (v) The way that synchronous and asynchronous reset are declared in an always_ff statement? [2 marks] (b) The following module attempts to implement a reset control circuit that should have the following behaviour: when the user-controlled reset button (which needs to be debounced) is pressed the asyncButton signal is high and should result in the rst going high and remaining high for a minimum of 106 clock cycles. rst should be generated immediately after the rising clock edge to allow time for it to propagate. module timeResetBad(input logic clk, input logic asyncButton, output logic rst); logic ctr [18:0]; logic ctrAtMax; always_comb begin ctrAtMax = &ctr; rst = !ctrAtMax; end always_ff @(posedge clk) ctr <= asyncButton ? 0 : !ctrAtMax ? ctr+1 : ctr; endmodule (i) What is wrong with the timeResetBad module? [4 marks] (ii) Write a corrected version timeResetBad that makes minimal changes and adds no new modules. [4 marks] What is the difference between memory latency and bandwidth? [2 marks] (b) What is the difference between an interrupt and an exception? [3 marks] (c) Why is a computer's memory implemented as a hierarchy of memories and yet the programming model represents physical memory as a flat linear address space? [5 marks] (d) What is the difference between a direct-mapped and a set-associate cache, and how do their cache-line replacement policies differ? [5 marks] (e) Contemporary commercial processors use a register file to store intermediate results. Historically accumulators or operand stacks were used instead of a register file. What are the advantages of a register file over an accumulator and an operand stack? [5 marks] 3 (TURN OVER) CST1.2019.5.4 3 Computer Design (a) Describe each of the four models defined by OpenCL's specification. [4 marks] (b) Describe the different types of memory available to OpenCL kernels. [4 marks] (c) Contrast how calls to a kernel, e.g. DAXPY, are invoked and grouped for execution in OpenCL compared with CUDA. [4 marks] (d) Describe, with the aid of a diagram, how a GPU executes data-parallel kernels efficiently, including the two main pieces of hardware support. [4 marks] (e) Describe the trade-offs between using a GPU or a specialised accelerator for tasks containing data-level parallelism. [4 marks] 4 CST1.2019.5.5 4 Computer Networking The TCP transport protocol is an example of an ARQ. (a) Provide a definition of an ARQ. [1 mark] (b) Describe the design and operation of a simple ARQ for a lossy communication channel. [3 marks] (c) When and why does a simple ARQ at the transport layer have a significant negative impact upon application performance? [3 marks] (d) Describe what additions are required to a simple ARQ to support windowing. When and why will an ARQ which supports windowing provide better application performance than a simple ARQ? [5 marks] (e) Describe two situations when the performance of a windowed ARQ is no better than a simple ARQ. [4 marks] (f ) Would the QUIC protocol, when based upon UDP rather than TCP, overcome the two situations you outlined when answering Part (e)? [4 marks] 5 (TURN OVER) CST1.2019.5.6 5 Computer Networking (a) You need to urgently deliver 500 TByte of data from Zurich to London. (i) NoWayNet is offering a 10 Gbit/s reliable delivery service between Zurich and London (about 776km). Should you use either NoWayNet, or an overnight package delivery? Why? [2 marks] (ii) A new company, UnlikelyComms, is offering a 400 Gbit/s reliable delivery service between Zurich and London, but it takes a very indirect 2600 km path. Should you use UnlikelyComms? [2 marks] (iii) Following your successful urgent delivery of 500 TBytes of data, this has become an hourly task. Alongside the need to regularly deliver 500 TByte data between Zurich and London, you have an interactive virtual reality system; it requires six displays each needing 50 Gbit/s and an end-to-end latency of less than 5ms. Fortunately, a startup, FlyByNight, boasts an offering with an effective bandwidth of over 16 Tbit/s, using a special transport with no end-to-end latency at all. The downside is it can only transfer data in 500 TByte units, once every 4 minutes. Explain whether FlyByNight is, or is not, suited to your two workloads. [4 marks] (b) Ethernet standards enable 1Gbit/s over 4 pairs of twisted cabling, yet the physical media has a bandwidth much less than 1GHz, e.g., 250MHz is common. (i) Explain how such high data rates are achieved, and [4 marks] (ii) explain how physical media errors are reduced or eliminated. [2 marks] (c) Explain, with the aid of diagrams, how Code-Division Multiple Access permits two or more pairs of nodes to communicate over a common medium (e.g., wireless) simultaneously.Comparative Architectures (a) Describe the organisation of a two-level branch predictor that makes use of a global branch history. [3 marks] (b) What are false (or name) dependencies and what hardware technique is often used to remove them within a processor? [3 marks] (c) You are asked to design a new Instruction Set Architecture (ISA). You are told that this new ISA will be the basis for both simple low-power and high-performance processor implementations. Would you include the features or design choices listed below? In each case, carefully justify your answer. (i) A branch delay slot. (ii) The ability to predicate the execution of most instructions. (iii) A conditional move instruction. (iv) The use of condition codes (or flags) to specify the branch condition. (v) A large number of general-purpose registers. (vi) A TSO memory consistency model. (vii) Support for custom ISA extensions, e.g. to allow the addition of special functional units. [14 marks] 4 CST2.2019.8.5 4 Computer Vision (a) Explain why such a tiny number of 2D Gabor wavelets as shown in this sequence are so efficient at representing faces, and why such wavelet-based encodings deliver good performance in "appearance-based" algorithms for face recognition. What role do such encodings have in representing different facial expressions? What sort of neural evidence is there for such encodings in human vision? Number of Wavelets 16 52 116 216 original [6 marks] (b) Explain the "receptive field" concept as used both in CNNs (convolutional neural networks) and in visual neuroscience, and explain the role of trainable connections. Why is the concept of convolution relevant? Roughly how many layers are in the 'FaceNet' CNN, and how many connection parameters must be trained? By comparison, in the visual cortex of the brain, typically how many synapses are there per neurone, and what is the total length of "wiring" (neurite connections) per cubic-millimeter? Can connection updates be a basis for computer vision? [6 marks] (c) In relation to the image formation diagram shown below, explain: (i) the concept of a reflectance map; (ii) what is a specular surface; (iii) what is a Lambertian surface; and (iv) what is surface albedo. Give the defining relationships for the amount of light from a point source that is scattered in different directions by such illuminated surfaces, and describe the inferences that a vision system must make with them. [8 marks] .->q’l :r )– ?rxi The definitions of the angles i, €, and g 5 (TURN OVER) CST2.2019.8.6 5 Cryptography (a) The Tripos Encryption Standard (TES) is a block cipher optimized for use on UGPs (“undergraduate processors”). It operates on 4-bit blocks, written as hexadecimal digits (e.g., a ⊕ 9 = 3). For one particular key K, it implements the following permutation: m 0 1 2 3 4 5 6 7 8 9 a b c d e f EK(m) 1 b 5 c 7 e 2 a 4 9 f d 0 3 6 8 Using this key K, decrypt the following three ciphertexts according to the indicated modes of operation. [Note: the XOR table at the bottom of this page may be of use.] (i) ECB: 188b06 [2 marks] (ii) CBC: 301b2 [3 marks] (iii) CFB: 10f6d [3 marks] (b) State four advantages that counter mode has over either CBC or CFB mode. [4 marks] (c) Using the same K as in Part (a): (i) Show that the CBC-MAC tag for message 1234 is d. [3 marks] (ii) Demonstrate that CBC-MAC with a given K is not collision resistant, by showing how to find another message, of the form 1×04, that results in the same CBC-MAC message tag (without iterating over different candidates for 4-bit block x). [5 marks] UGP XOR accelerator: ⊕ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 0 1 2 3 4 5 6 7 8 9 a b c d e f 1 1 0 3 2 5 4 7 6 9 8 b a d c f e 2 2 3 0 1 6 7 4 5 a b 8 9 e f c d 3 3 2 1 0 7 6 5 4 b a 9 8 f e d c 4 4 5 6 7 0 1 2 3 c d e f 8 9 a b 5 5 4 7 6 1 0 3 2 d c f e 9 8 b a 6 6 7 4 5 2 3 0 1 e f c d a b 8 9 7 7 6 5 4 3 2 1 0 f e d c b a 9 8 8 8 9 a b c d e f 0 1 2 3 4 5 6 7 9 9 8 b a d c f e 1 0 3 2 5 4 7 6 a a b 8 9 e f c d 2 3 0 1 6 7 4 5 b b a 9 8 f e d c 3 2 1 0 7 6 5 4 c c d e f 8 9 a b 4 5 6 7 0 1 2 3 d d c f e 9 8 b a 5 4 7 6 1 0 3 2 e e f c d a b 8 9 6 7 4 5 2 3 0 1 f f e d c b a 9 8 7 6 5 4 3 2 1 0 6 CST2.2019.8.7 6 E-Commerce (a) Describe five ecommerce business models. [5 marks] (b) Describe five things to consider when internationalising an ecommerce business. [5 marks] (c) Does the nature of the Internet naturally lead to dominant firms in ecommerce markets? [10 marks] 7 (TURN OVER) CST2.2019.8.8 7 Hoare Logic and Model Checking Consider a programming language that consists of commands C composed from assignments X := E (where X is a program variable, and E is an arithmetic expression), heap allocation X := alloc(E1, . . . , En), heap assignment [E1] := E2, heap dereference X := [E], disposal of heap locations dispose(E), the no-op skip, sequencing C1; C2, conditionals if B then C1 else C2 (where B is a boolean expression), and loops while B do C. null is 0 (a) Explain informally what it means for a separation logic partial correctness triple {P} C {Q} to be valid. [3 marks] (b) Explain informally what it means in terms of the executions of C for the separation logic partial correctness triple {>} C {⊥} to be valid. [2 marks] (c) Recall the list representation predicate list: list(t, []) = (t = null) list(t, h :: α) = ∃y.((t 7→ h) ∗ ((t + 1) 7→ y) ∗ list(y, α)) We write [] for the empty mathematical list; h :: α for the mathematical list the head of which is h, and the tail of which is α; α ++ β for the concatenation of mathematical lists α and β; α[i] for the i-th element of the list α, starting at 0; and [k, . . . , n] for the ascending list of integers from k to n, including k and n. Give a proof outline, including a loop invariant, for the following triple: {N = n ∧ N ≥ 0} X := null; while N > 0 do (X := alloc(N, X); N := N − 1) {list(X, [1, . . . , n])} [4 marks] (d) Also recall the partial list representation predicate plist: plist(t, [], u) = (t = u) plist(t, h :: α, u) = ∃y.((t 7→ h) ∗ ((t + 1) 7→ y) ∗ plist(y, α, u)) Give a loop invariant for the following list sum triple: {list(X, α)} Y := X; N := 0; while Y 6= null do (M := [Y ]; N := N + M; Y := [Y + 1]) n list(X, α) ∧ N = Plength(α)−1 i=0 α[i] o [4 marks] (e) Give a loop invariant for the following list concatenation triple: {list(X, α) ∗ list(Y, β)} if X = null then Z := Y else Z := X; U := Z; V := [Z + 1]; while V 6= null do (U := V ; V := [V + 1]); [U + 1] := Y {list(Z, α ++ β)} [5 marks] (f ) Describe precisely a stack and a heap that satisfy list(X, [1, . . . , 3]). [2 marks] 8 CST2.2019.8.9 8 Information Theory (a) Consider the four-state Markov process in the graph below. It emits the eight letters {A, B, C, D, e, f, g, h} with probabilities and changes of state as shown, but note the sequence constraints. (For example, an A can only be followed by a B or an e.) Letter emissions with clockwise state transitions occur with probability α, and the others with probability 1 − α, where 0 < α < 1. p = α p = α p = α p = 1 − α p = α p = 1 − α p = 1 − α p = 1 − α "B" "C" "A" "D" "h" "g" "f" "e" (i) First imagine a one-state Markov process that emits any of eight letters with equal probabilities. What is its entropy? [2 marks] (ii) For the four-state Markov process shown with parameter α, what is the long-term probability distribution across the eight letters? [4 marks] (iii) In terms of parameter α, what is the overall entropy H(α) of this four-state Markov process? [2 marks] (iv) Sketch a plot of H(α) as a function of α. Compare its maximum value with your earlier answer in Part (a)(i) for a one-state Markov process that also emits eight letters, and explain the difference, if any. [4 marks] (b) Is it possible to construct an instantaneous code (a code possessing the prefix property) for a five-letter symbol set using codewords whose lengths in bits are: 1, 2, 3, 3, and 4 bits? Justify your answer by stating the relevant condition. [4 marks] (c) Provide an operation in linear algebra that involves simply the multiplication of a matrix by a vector, which describes the Discrete Fourier Transform of a discrete sequence of data f[n] = (f[1], ..., f[N]) to obtain Fourier coefficients F[k] = (F[1], ..., F[N]). Define the elements of the (N ×N) matrix and give the computational cost of the operation in this vector-matrix form. [4 marks] Bioinformatics (a) Describe, with one example, the complexity of using dynamic programming in multiple alignment. [3 marks] (b) Describe the differences between genome assembly (i.e. using a reference genome) and genome de novo sequencing from a bioinformatics perspective. [5 marks] (c) The de Bruijn Graph is widely used in Bioinformatics. (i) Describe with one example how to construct the paired de Bruijn Graph. [5 marks] (ii) Describe the advantages of the paired de Bruijn Graph versus the non paired version of the de Bruijn Graph. [3 marks] (d) Discuss the advantages of using soft k-means versus hard clustering. [4 marks] 3 (TURN OVER) CST2.2019.9.4 3 Business Studies After graduation you created a venture with £10m in sales with a 20% profit margin. After investing 10 years of your life on this endeavour you have decided that it is time to sell. (a) Describe three exit routes available to you assuming you are not going to liquidate the company. [3 marks] (b) Discuss how you would go about identifying and choosing the exit route to pursue. [6 marks] (c) Identify your preferred exit route and discuss how you would go about managing the process. [11 marks] 4 CST2.2019.9.5 4 Comparative Architectures (a) As modern processors and system-on-chip (SoC) designs become more complex, so does the on-chip interconnect. (i) Why does the design of an on-chip network differ greatly from that of larger scale networks? [3 marks] (ii) Draw a diagram showing the datapath of an on-chip router with virtual channels. [3 marks] (iii) How do virtual channels help to reduce packet latency? [3 marks] (iv) For what reason, other than performance, may virtual-channel flow control be useful? [2 marks] (b) You have been asked to outline the design of a high-performance 16-core processor suitable for use in a server-class machine. Draw a clear block diagram illustrating your architecture. Include all the major building blocks, e.g. processor cores, caches, on-chip interconnects, memory controllers and the main off-chip interfaces. Provide a brief description of how cache coherence is maintained, what type(s) of on-chip interconnect are provided, a brief overview of the features of your individual cores and the characteristics of your caches. For each major component briefly justify your design decisions. [9 marks] 5 (TURN OVER) CST2.2019.9.6 5 Computer Vision (a) In early stages of machine vision systems, the isotropic operator shown on the right is often applied to an image I(x, y) in the following way: [∇2Gσ(x, y)] ∗ I(x, y). What is the purpose of this operation? Which class of neurones in the retina does it mimic? How would the results differ if instead this operation: Gσ(x, y) ∗ ∇2 I(x, y) were performed; or alternatively if this operation: ∇2 [Gσ(x, y) ∗ I(x, y)] were performed? [6 marks] (b) Computer vision colour space is usually three-dimensional, just because human vision is tri-chromatic and therefore cameras are designed with three colour planes. But suppose we added a fourth colour plane, say yellow (Y), to the standard red, green, and blue (RGB) bands. Considering that these are linearly independent but not orthogonal vectors, what would be the added capability of RGBY space? What tests would reveal it? Present a version of the Retinex algorithm for RGBY space, explaining the purpose of each step in the algorithm. [8 marks] (c) Visual inference of surface shape depends on assumptions and prior knowledge, such as "faces are mostly convex". Explain the "rotating hollow mask illusion". Why does a face mask (as pictured below) appear to reverse its direction of rotation, once it is seen from the inside instead of the outside? What is the role of Bayesian inference when interpreting a face-like surface that is actually concave in presentation instead of convex? Should visual illusions like this be considered "features" or "bugs", and should one try to design them in to a computer vision system? [6 marks] 6 CST2.2019.9.7 6 Cryptography (a) (i) Choose and briefly describe one major application of elliptic-curve group operations in cryptography. [4 marks] (ii) What other group operation was previously (and still is) widely used for the same purpose? [2 marks] (iii) What is a major advantage of elliptic curve group operations over the group operation you named in Part (a)(ii)? [4 marks] (b) In the Galois field GF(28 ) modulo x 8 + x 4 + x 3 + x 2 + 1, calculate (i) the sum 0011 1001 plus 0110 1100; [2 marks] (ii) the product 0100 1011 times 0000 1001. [4 marks] (c) In Lamport's one-time password scheme, the user is given a list of passwords Rn, . . . , R0 generated using the following algorithm: R0 ← random for i := 1 to n Ri := h(Ri−1) (i) State two properties required of function h. [2 marks] (ii) Complete the password verification algorithm implemented in the server by filling in the ellipses (...) below: Q := . . . while true P := read password if . . . . . . grant access else deny access [2 marks] 7 (TURN OVER) CST2.2019.9.8 7 Denotational Semantics (a) Suppose that (D, v) is a poset which is chain-complete but does not have a least element, and that f : D → D is a continuous function. (i) Give an example of such (D, v) and f for which f has no fixed point. [1 mark] (ii) If d ∈ D satisfies d v f(d), prove that there is a least element e ∈ D satisfying d v e = f(e). [Hint: consider the method used to prove Tarski's fixed point theorem.] [7 marks] (b) (i) Define the notion of contextual equivalence for the language PCF. (You need not describe the syntax and semantics of PCF.) [2 marks] (ii) State the compositionality, soundness and adequacy properties of the denotational semantics of PCF. Explain why they imply that any two closed PCF terms of the same type with equal denotations are contextually equivalent. [8 marks] (iii) Give, without proof, an example of two contextually equivalent PCF terms that have unequal denotation. [2 marks] 8 CST2.2019.9.9 8 Hoare Logic and Model Checking This question is about modelling a program, defined below, consisting of two threads and a single (mathematical) integer variable X, initially set to 0. Each thread t has its own program counter given by pct , initially set to 0, which describes the current line for that thread. Thread 1 Thread 2 0: X := X+1 0: IF IS ODD(X) THEN STOP ALL 1: GOTO 0 1: GOTO 0 The program is executed by repeatedly carrying out execution steps, where one thread is non-deterministically selected, its entire current line is run, and its program counter is then updated appropriately. This continues until STOP ALL is executed, which immediately terminates the whole program. (a) The program state can be described by (pc1, pc2, X, stopped), where pc1, pc2, and X are mathematical integers, and stopped is a boolean which is true iff STOP ALL has been executed. Let S be the set of all such states. (i) Define S0, the set of initial states of the program, such that S0 ⊆ S. [1 mark] (ii) Define a transition relation R ⊆ S × S describing the program's execution. [2 marks] (iii) Define a labelling function L that labels all states where the program has terminated with the atomic property term. [2 marks] (b) Explain why, taking the definitions from (a), the model Ma = (S, S0, R, L) is not a (finite) Kripke structure. [2 marks] (c) Draw the finite state automaton for a model Mb which is a Kripke structure, such that Ma and Mb are bisimilar. Justify your answer briefly. [Note: A full formal proof of bisimilarity is not required.] [5 marks] (d) (i) Give an LTL formula φ such that the judgement Mb φ corresponds to the statement "every execution of the program will eventually terminate". [2 marks] (ii) Either prove that Mb φ holds, or describe a counter-example trace. [2 marks] (e) Consider the CTL formula ψ = AG(EF term). Determine whether this is equivalent to your definition of φ from Part (d). φ and ψ are equivalent iff, for all Kripke structures M, (M φ) iff (M ψ). Justify your answer. [4 marks] 9 (TURN OVER) CST2.2019.9.10 9 Information Theory (a) If I pick a number n that can be any integer from 1 to ∞ whose probability distribution of being selected is ( 1 2 ) n , and you ask a series of 'yes/no' questions which I will answer truthfully, how many such 'yes/no' questions should you expect to ask before discovering which number I have picked? Justify your answer by invoking a known series limit. What sequence of questions would be the most efficient to ask, and why? [4 marks] (b) An inner product space containing complex functions f(x) and g(x) is spanned by a set of orthonormal basis functions {ei}. Complex coefficients {αi} and {βi} therefore exist such that f(x) = X i αiei(x) and g(x) = X i βiei(x). Show that the inner product hf, gi = X i αiβi . [4 marks] (c) Consider a data sequence f[n] (n = 0, 1, . . . , 15) having Fourier coefficients F[k] (k = 0, 1, . . . , 15). Using the 16th roots of unity labelled around the unit circle as powers of w1 , the primitive 16th root of unity, construct a sequence of the wi that could be used to compute F[3] when an inner product is computed between your sequence of wi and the data sequence f[n]. Im Re w 0 =1 w 1 w 2 w w 3 4 w 5 w 6 w 7 w 8 w 9 w 10 w 11 w 12 w 13 w 14 w 15 [4 marks] (d) Explain how vector quantisation exploits sparseness to construct very efficient codes. Use the example of encoding a natural language lexicon with a 15 bit coding budget. Contrast the strategy of using codewords for single letters versus using codewords as pointers to a sparse index of combinations of letters. [4 marks] (e) A continuous signal f(t) has Fourier transform F(ω). Explain why computing derivatives of f(t) such as f 0 (t) or f 00(t) amounts simply to high-pass filtering. For the n th derivative f (n) (t), what exactly is this filtering operation when expressed in terms of F(ω)? Show how this operation could be used to define derivatives of non-integer order (for example the 1.5 th derivative). [4 marks] 10 CST2.2019.9.11 10 Mobile and Sensor Systems A mobile phone software developer is programming her own behaviour tracking app and she wants to make it suitable for use in areas with intermittent and low bandwidth cellular connectivity. (a) Explain the precautions the developer can take to make the app work well in this environment. Describe examples of mechanisms which can help with this. [5 marks] (b) The app uses various sensors to monitor user activity and its surrounding environment. In particular, it uses the microphone to monitor location ambience (surrounding sounds). Describe a suitable machine learning approach and discuss system considerations. [6 marks] (c) Describe how the developer can use location data to provide mobility prediction and how mutual information can improve the mobility prediction algorithm. [4 marks] (d) A very able user wants to test the app for privacy leaks before using it on their own phone. What techniques can be used? Illustrate each technique's specific purpose and the assumptions it is predicated on.Data Science (djw1005)(a) Let xt be the number of new COVID infections on date t. We anticipateapproximately exponential growth or decay, xt+1 ≈ (1 + λ)xt, and we would(iii) For the latter model, explain how to compute a 95% confidence interval forλ. Explain the resampling step carefully. [4 marks](b) We don't actually know the number of new infections xt on date t: we only knowthe number of new positive test results, yt. We anticipate yt ≈ βdow(t)xt, wheredow(t) gives the day of the week for date t. We would like to estimate not onlyλ but also βMon, ..., βSun from the dataset (y1, . . . , yT ).(i) Propose a probability model for Yt+1 in terms of yt. [5 marks](ii) Explain briefly how to estimate the parameters of your model. In youranswer, you should consider whether or not the parameters are identifiable.[6 markHoare Logic and Model Checking This question is about modelling a program, defined below, consisting of two threads and a single (mathematical) integer variable X, initially set to 0. Each thread t has its own program counter given by pct , initially set to 0, which describes the current line for that thread. Thread 1 Thread 2 0: X := X+1 0: IF IS ODD(X) THEN STOP ALL 1: GOTO 0 1: GOTO 0 The program is executed by repeatedly carrying out execution steps, where one thread is non-deterministically selected, its entire current line is run, and its program counter is then updated appropriately. This continues until STOP ALL is executed, which immediately terminates the whole program. (a) The program state can be described by (pc1, pc2, X, stopped), where pc1, pc2, and X are mathematical integers, and stopped is a boolean which is true iff STOP ALL has been executed. Let S be the set of all such states. (i) Define S0, the set of initial states of the program, such that S0 ⊆ S. [1 mark] (ii) Define a transition relation R ⊆ S × S describing the program's execution. [2 marks] (iii) Define a labelling function L that labels all states where the program has terminated with the atomic property term. [2 marks] (b) Explain why, taking the definitions from (a), the model Ma = (S, S0, R, L) is not a (finite) Kripke structure. [2 marks] (c) Draw the finite state automaton for a model Mb which is a Kripke structure, such that Ma and Mb are bisimilar. Justify your answer briefly. [Note: A full formal proof of bisimilarity is not required.] [5 marks] (d) (i) Give an LTL formula φ such that the judgement Mb φ corresponds to the statement "every execution of the program will eventually terminate". [2 marks] (ii) Either prove that Mb φ holds, or describe a counter-example trace. [2 marks] (e) Consider the CTL formula ψ = AG(EF term). Determine whether this is equivalent to your definition of φ from Part (d). φ and ψ are equivalent iff, for all Kripke structures M, (M φ) iff (M ψ). Justify your answer. [4 marks] 9 (TURN OVER) CST2.2019.9.10 9 Information Theory (a) If I pick a number n that can be any integer from 1 to ∞ whose probability distribution of being selected is ( 1 2 ) n , and you ask a series of 'yes/no' questions which I will answer truthfully, how many such 'yes/no' questions should you expect to ask before discovering which number I have picked? Justify your answer by invoking a known series limit. What sequence of questions would be the most efficient to ask, and why? [4 marks] (b) An inner product space containing complex functions f(x) and g(x) is spanned by a set of orthonormal basis functions {ei}. Complex coefficients {αi} and {βi} therefore exist such that f(x) = X i αiei(x) and g(x) = X i βiei(x). Show that the inner product hf, gi = X i αiβi . [4 marks] (c) Consider a data sequence f[n] (n = 0, 1, . . . , 15) having Fourier coefficients F[k] (k = 0, 1, . . . , 15). Using the 16th roots of unity labelled around the unit circle as powers of w1 , the primitive 16th root of unity, construct a sequence of the wi that could be used to compute F[3] when an inner product is computed between your sequence of wi and the data sequence f[n]. Im Re w 0 =1 w 1 w 2 w w 3 4 w 5 w 6 w 7 w 8 w 9 w 10 w 11 w 12 w 13 w 14 w 15 [4 marks] (d) Explain how vector quantisation exploits sparseness to construct very efficient codes. Use the example of encoding a natural language lexicon with a 15 bit coding budget. Contrast the strategy of using codewords for single letters versus using codewords as pointers to a sparse index of combinations of letters. [4 marks] (e) A continuous signal f(t) has Fourier transform F(ω). Explain why computing derivatives of f(t) such as f 0 (t) or f 00(t) amounts simply to high-pass filtering. For the n th derivative f (n) (t), what exactly is this filtering operation when expressed in terms of F(ω)? Show how this operation could be used to define derivatives of non-integer order (for example the 1.5 th derivative). [4 marks] 10 CST2.2019.9.11 10 Mobile and Sensor Systems A mobile phone software developer is programming her own behaviour tracking app and she wants to make it suitable for use in areas with intermittent and low bandwidth cellular connectivity. (a) Explain the precautions the developer can take to make the app work well in this environment. Describe examples of mechanisms which can help with this. [5 marks] (b) The app uses various sensors to monitor user activity and its surrounding environment. In particular, it uses the microphone to monitor location ambience (surrounding sounds). Describe a suitable machine learning approach and discuss system considerations. [6 marks] (c) Describe how the developer can use location data to provide mobility prediction and how mutual information can improve the mobility prediction algorithm. [4 marks] (d) A very able user wants to test the app for privacy leaks before using it on their own phone. What techniques can be used? Illustrate each technique's specific purpose and the assumptions it is predicated on. [5 marks] Skip QuestionShow 2 CommentsReport Issue Subject: Computer Science - Other$9.00 Do you want to answer this question? Computer Science Engineering & Technology C++ Programming COMPUTER S 2210 Share QuestionEmailCopy link Comments (0)


