Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

io (a) Give the general formula for estimating transition probabilities from training data. Provide the full transition matrix A for this HMM based on the

io

(a) Give the general formula for estimating transition probabilities from training data. Provide the full transition matrix A for this HMM based on the training data shown. [6 marks] (b) Give the general formula for calculating emission probabilities from training data, and calculate the emission probabilities P(may|o), P(may|i), P(bakes|o), P(bakes|i). [3 marks] ( Which probabilities does the HMM assign to the following two interpretations? (i) may is a name, and bakes is not [2 marks] (ii) bakes is a name, and may is not [2 marks] (d) The first training observation is now replaced with: today peter bakes a nice cake How does this change your answers to part (c)?

Consider rendering a triangular mesh using OpenGL. A uniform material is used for the entire mesh and the reflection model of the material consists of ambient, diffuse and specular components. There are two point light sources in the scene. Given these assumptions, answer the following questions: (a) Gourand and Phong shading are two different methods of interpolating colours between vertices. Explain how each method interpolates colours. [5 marks] (b) Discuss the trade-offs in terms of quality and computational costs for Phong and Gourand shading. Assume that the number of rendered pixels is much larger than the number of vertices. What kind of artefacts can one of the methods produce and what is the reason for those artefacts?

answer all

Your company has been asked to design and implement an interface called GestureDriver which is envisioned to be a remote driving interface based on visual gesturing and speech. Hand motions will be tracked based on colour vision, and the system will classify the gestures using a simple geometric model. The gestures will be mapped into six motion commands: start, right, left, forward, reverse, and stop. These commands can also be provided via speech and transmitted to the remote vehicle. The major requirements are that the system displays the current location of the vehicle to the user, monitors location change, captures the motion and vocal command of the user in real time, and moves the vehicle based on the received command. (a) One of the Principles of Good Design is to 'balance automated and human control'. Give four examples and explain how this can be achieved for the context provided above. [4 marks] (b) Describe, with an example, each of the five different interaction spaces beyond the desktop as classified by Winograd. Briefly discuss which one(s) would be more appropriate to use for creating this application, and why. [6 marks] (c) Assuming that the initial system status is OFF, draw a task model for the user using the GestureDriver interface with the goal of reversing the vehicle they are operating remotely. The task model should capture activities at multiple levels starting with at least three activities. Explain any sequential dependencies you identify. [8 marks] (d) Describe one generic problem that task analysis can help identify, and give an example of how this can be done.

(a) Describe three problems that affect the data and requirements gathering process, and provide one solution for each problem. [3 marks] (b) State and briefly describe each of the six principles of Gestalt psychology that have implications for user interface design. Explain how each of the six principles of Gestalt psychology have been employed in the design of the interface given in the figure below. [12 marks] (c) A company has just completed the heuristic evaluation of a digital music player, and identified the problem areas provided in the list below. Indicate which usability principle or principles each problem violates for five of the following problems. [Note: it is possible that each problem violates more than one usability principle, and that the same principle is violated multiple times for different problems.] P1. Inconsistencies between menus and buttons. P2. Some language does not correspond with user terminology. P3. There are buttons that the user may not realize are buttons. P4. Not all buttons have tooltips. P5. There are inconsistencies with Windows operating system standards. P6. Undo commands basically unsupported. P7. Help content uses different terminology from application. P8. System does not always provide user with enough information about the task being performed.

Suppose that a very large collection of documents describing the University of Cambridge has been collected. Your task is to build a classifier which assigns sentiment to each document, using the classes: positive, negative and neutral. (a) There is no ground truth sentiment associated with the documents, but 200 have been manually classified by three human annotators. Fleiss' Kappa is 0.65 for this set. Explain what Kappa is and outline how it is calculated. You do not need to state the full formula for Kappa. [4 marks] (b) Given the limited amount of annotated data, you decide to classify the documents using a standard sentiment lexicon. Explain how you would perform an experiment to do this. [5 marks] 8 CST0.2017.3.9 (c) (i) How would you evaluate the results of the system you have described in your answer to part (b) using the annotated data? Give details of the evaluation metrics you would use. [4 marks] (ii) If the primary objective were to identify the documents with negative sentiment, how might your proposed evaluation change? [2 marks] (d) It is suggested to you that the classes automatically assigned by the sentiment lexicon approach could be used to provide training data for a Naive Bayes classifier. Could such a classifier perform better than the sentiment lexicon classifier which provided the decisions it was trained on?

(a) Briefly describe ASCII and Unicode and draw attention to any relationship between them. [3 marks] (b) Briefly explain what a Reader is in the context of reading characters from data. [3 marks] A novice programmer has written the following copying program which is intended simply to read characters from data one at a time and to write them out. public class Copying { public static void main(String[] args) { int ch; while ((ch = System.in.read()) != -1) { System.out.printf("%c", (char) ch); } } } (c) Unfortunately this program causes a compile-time error. Explain what the problem is and modify the code so that the program compiles. [3 marks] (d) The amended program correctly copies data in simple cases but is found to fail when exotic characters are encountered. Why is this? [3 marks] (e) By exploiting a Reader, rewrite the program so that exotic characters no longer cause any problems.

) 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.

(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?

(a) Outline the use of enum in Java programs and explain any similarities to and any differences from a Java class. [6 marks] The following fragment of code shows an early attempt to write and test a Java program to simulate the paper-scissors-stone game. In the method main() each of the identifiers a and b is assigned one of the items, paper, scissors or stone and the printf() method then says whether the first beats, draws with or loses against the second. [The rule is that paper beats stone, scissors beat paper and stone beats scissors.] public class Game { public static void main(String[] args) { Item a = allocateItem(); Item b = allocateItem(); int res = a.versus(b); System.out.printf("%s %s %s%n", a, res>0 ? "beats" : res==0 ? "draws with" : "loses against", b); } private static Item allocateItem() { ... } } enum Item { PAPER... The three possibilities PAPER, SCISSORS and STONE are declared in enum Item along with a constructor, the method versus() and any necessary additional data fields. (b) Using the method Math.random() or otherwise, provide a body for the method allocateItem() such that the method returns an Item PAPER, SCISSORS or STONE equiprobably. [6 marks] (c) Complete the enum Item so that the statements in the method main() operate as intended. [8 marks] 3 (TURN OVER) CST.2008.10.4 3 Floating-Point Computation (a) Write function in a programming language of your choice that takes a float and returns a float with the property that: given zero, infinity or a positive normalised floating-point number then its result is the smallest normalised floating-point number (or infinity if this is not possible) greater than its argument. You may assume functions f2irep and irep2f which map between a float and the same bit pattern held in a 32-bit integer. [6 marks] (b) Briefly explain how this routine can be extended also to deal with negative floating-point values, remembering that the result should always be greater than the argument. [2 marks] (c) Define the notions of rounding error and truncation error of a floating-point computation involving a parameter h that mathematically should tend to zero. [2 marks] (d) Given a function f implementing a differentiable function that takes a floatingpoint argument and gives a floating-point result, a programmer implements a function f 0 (x) f(x + h) f(x h) 2h to compute its derivative. Using a Taylor expansion or otherwise, estimate how rounding and truncation errors depend on h. You may assume that all mathematical derivatives of f are within an order of magnitude of 1.0. [8 marks] (e) Suggest a good value for h given a double-precision floating-point format that represents approximately 15 significant decimal figures. [2 marks] 4 CST.2008.10.5 4 Programming in C and C++ A hardware engineer stores a FIFO queue of bits in an int on a platform with 32-bit ints and 8-bit chars using the following C++ class: class BitQueue { int valid_bits; //the number of valid bits held in queue int queue; //least significant bit is most recent bit added public: BitQueue(): valid_bits(0),queue(0) {} void push(int val, int bsize); int pop(int bsize); int size(); }; (a) Write implementation of BitQueue::size, which should return the number of bits currently held in queue. [1 mark] (b) Write implementation of BitQueue::push, which places the bsize least significant bits from val onto queue and updates valid bits. An exception should be thrown in cases where data would otherwise be lost. [5 marks] (c) Write implementation of BitQueue::pop, which takes bsize bits from queue, provides them as the bsize least significant bits in the return value, and updates valid bits. An exception should be thrown when any requested data is unavailable. [4 marks] (d) The hardware engineer has built a communication device together with a C++ library function send to transmit data with the following declaration: void send(char); Use the BitQueue class to write a C++ definition for: void sendmsg(const char* msg); Each of the characters in msg should be encoded, in index order, using the following binary codes: 'a'=0, 'b'=10, 'c'=1100, and 'd'=1101. All other characters should be ignored. Successive binary codes should be bit-packed together and the code 111 should be used to denote the end of the message. Chunks of 8-bits should be sent using the send function and any remaining bits at the end of a message should be padded with zeros. For example, executing sendmsg("abcd") should call the send function twice, with the binary values 01011001 followed by 10111100.

(a) Most liquid crystal displays divide a pixel into three sub-pixels coloured red, green, and blue. Explain why this is so. [4 marks] (b) Some liquid crystal displays divide a pixel into four sub-pixels coloured red, green, blue, and white. Explain why this might be useful, what advantages it has, and what limitations it has. [6 marks] (c) Compare and contrast half-toning and error diffusion. Include in your answer an explanation of the situations in which each is superior to the other. [6 marks] (d) One method of anti-aliasing is to sample at high resolution, n n higher than the final image, and then to average each block of n n pixels to give a single pixel value. Discuss the advantages and disadvantages of using (i) Gaussian blurring, and (ii) median filtering in place of simple averaging. [4 marks] 6 CST.2008.10.7 6 Introduction to Functional Programming (a) Write an SML function propercuts: ( list) ( list * list) list that given a list ` outputs the list of all pairs of non-empty lists (`1, `2) such that `1@`2 = `. [5 marks] (b) Consider the following datatypes datatype tree = leaf of | node of tree * tree ; datatype symbol = Lbracket | Rbracket | token of ; and the SML function rep: tree ( symbol) list that represents a binary tree as a list of symbols, according to the following definition: fun rep ( leaf x ) = [ token x ] | rep ( node(l,r) ) = [ Lbracket ] @ (rep l) @ (rep r) @ [ Rbracket ] ; Write an SML function istree: ( symbol) list bool that given a list of symbols ` outputs true if there exists a (necessarily unique) tree t such that rep(t) = `, and outputs false otherwise. [10 marks] (c) Define the SML functions infix @ ; @: list * list list ; map: ( ) list list ; and rigorously argue for the correctness of the following identity: map f (`1 @ `2) = (map f `1) @ (map f `2) : list for all f : and `1, `2 : list.

Write program that first gets a list of integers from the input and adds them to an array. The input begins with an integer indicating the number of integers that follow Java program to read a file content line by line and then print the content as console

Hidden Markov Models (HMM) can be used to find names in text. In the following HMM created for this purpose, the two emitting states are q1 = i (for "inside a name") and q2 = o (for "outside a name"). Each word in the training data is labelled with either i or o. There are two sequences in the training data, as follows: today may bakes a nice cake o i o o o o peter bakes and mary bakes may like sue i i o i i o o i (a) Give the general formula for estimating transition probabilities from training data. Provide the full transition matrix A for this HMM based on the training data shown. [6 marks] (b) Give the general formula for calculating emission probabilities from training data, and calculate the emission probabilities P(may|o), P(may|i), P(bakes|o), P(bakes|i). [3 marks] (c) An HMM trained with the above training observations is exposed to the following test observation: may bakes Which probabilities does the HMM assign to the following two interpretations? (i) may is a name, and bakes is not [2 marks] (ii) bakes is a name, and may is not [2 marks] (d) The first training observation is now replaced with: today peter bakes a nice cake How does this change your answers to part (c)?

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

Data Communications and Networking

Authors: Behrouz A. Forouzan

5th edition

73376221, 978-0073376226

Students also viewed these Computer Network questions