question archive The T1000 encryption module was designed to make TeleGroove

The T1000 encryption module was designed to make TeleGroove

Subject:Computer SciencePrice:9.82 Bought3

The T1000 encryption module was designed to make TeleGroove...

 

The T1000 encryption module was designed to make TeleGroove messages
difficult to read for eavesdroppers. Such messages are character sequences
of arbitrary length, encoded using a 5-bit alphabet A = {a0, . . . , a31}. The
T1000 module reads blocks of up to 1000 characters at a time into its
memory (m0, m1, . . . , m999) and then outputs them again in a different order
(mK(0), mK(1), . . . , mK(999)), according to a secret key table K : {0, . . . , 999} →
{0, . . . , 999} that is shared with the respective recipient of each message. It
repeats that process until the block ending with the last character has been
processed.
(i) What constraint on K ensures that no information is lost?
(ii) Identify an ambiguity in the above description and propose a flaw
hypothesis regarding a related residual-information vulnerability in this
device.

 

 

address all

(a) Describe how transform coding can be used to compress image data. [4 marks]
(b) Explain the Walsh-Hadamard transform on a one-dimensional array of 4
greyscale values. [4 marks]
(c) Extend this to the Walsh transform for a two-dimensional array of 2×2 greyscale
values. [4 marks]
(d) Develop an analogous transform for a three-dimensional array of 2 × 2 × 2
greyscale values. [8 marks]
Include sufficient algebra in your answers to allow a competent programmer to
implement the algorithm.
 

 


This question explores Heath's Rule, which states that if R(X, Y, Z) satisfies the
functional dependency X → Y , where X, Y , and Z are disjoint non-empty sets of
attributes, then
R = πX,Y (R) ./X πX,Z(R),
where ./X is the natural join on the attributes of X.
(a) What is meant by the functional dependency X → Y ? [2 marks]
(b) Define the natural join operation ./X. [2 marks]
(c) Suppose that the functional dependency X → Y holds and we use Heath's rule
to justify replacing the schema R(X, Y, Z) with R1(X, Y ) and R2(X, Z).
(i) Give two possible advantages for this schema change. [2 marks]
(ii) Give two possible disadvantages for this schema change. [2 marks]
(iii) Is X a key for R1? Explain. [2 marks]
(iv) Is X a key for R2? Explain. [2 marks]
(d) Prove that Heath's Rule always holds. [8 marks]
6
CST.2012.4.7
6 Databases
(a) Codd's 1970 paper introduced the Relational Model of data to address the
difficulties of building database applications using the technology that was
available at the time.
(i) What problems were encountered by database developers before Codd
introduced the Relational Model? [1 mark]
(ii) Describe the basic elements of the Model, and explain what is meant by a
relational schema. [4 marks]
(iii) Explain how a formal schema can assist both the application database
designer and a database application programmer. What if any are
the disadvantages of adopting a mathematical description of database
structure? [5 marks]
(b) In 1976 Peter Chen introduced the Entity Relationship (E-R) Model to support
a more natural description of real world data.
(i) Describe the basic elements of the Model, and explain some of the choices
available to the database designer.

 

 

give answers to alll questions

(a) Consider the radix sort algorithm.
(i) Explain how radix sort works, to what inputs it can be applied and what
its asymptotic complexity is. [5 marks]
(ii) Explain why running radix sort does not proceed from most to least
significant digit, as would at first seem more intuitive. [4 marks]
(iii) Give a proof by induction of the correctness of radix sort. [4 marks]
(b) Clearly describe an algorithm, strictly better than O(n
2
), that takes a positive
integer s and a set A of n positive integers and returns a Boolean answer to the
question whether there exist two distinct elements of A whose sum is exactly s.
Evaluate its complexity.

 

The context for this question is the search for a minimum spanning tree (MST) for
a weighted connected graph.
(a) Give a clear definition of the following MST technical expressions, describing
also the type of X and Y : "X respects Y ", "z is a safe edge". [3 marks]
(b) For each of the following statements, say whether it is true or false and then
support your argument with a correctness proof or a small counterexample
as appropriate. [You should give a specific graph, preferably small, if you are
offering a counterexample.]
(i) In a graph where all edge weights are positive, if a subset of edges connects
all vertices and has minimum total weight, then it is a tree. [2 marks]
(ii) In a graph where edge weights may be positive or negative, if a subset of
edges connects all vertices and has minimum total weight, then it is a tree.
[5 marks]
(iii) Let T be a minimum spanning tree, C be a cut and e be the lightest edge
crossing the cut. Assume e /∈ T. Call f one of the edges of T that crosses
the cut (one must exist because T spans all vertices). Then the set of edges
T ∪ {e} {f} is also a tree.

 


(a) Draw a clear sequence of commented snapshots showing what happens when
applying the following sequence of operations to the two-tree Fibonacci heap
pictured below, where asterisks denote marked nodes.
 

 


(a) You have acquired a C program which declares an array v, populates it, and
later writes it to a file in binary:
#define NITEMS 100
struct Elem { signed long val; char flags; } v[NITEMS];
...
fwrite(file, 1, sizeof(v), v);
When run on a legacy processor (which no longer exists) this produces a file
containing 500 bytes, but when re-compiled and executed on three modern
desktops using various compilers it produces files containing respectively 800,
1200 and 1600 bytes. On all implementations char is an 8-bit value.
(i) Explain what might be happening in the four versions in terms of compiler
assumptions of alignment and size, in bits, of type long. Also give the
values of sizeof(struct Elem). [3 marks]
(ii) You now wish to read a file produced by the legacy processor into a version
of the program running on your new desktop machine (one of the three
above). Outline the changes, if any, you would need to make to the call
to fread, mirroring the call to fwrite above, so that the resulting v may
be successfully processed by the rest of the program. You may make any
sensible assumptions about the legacy machine and your desktop machine
provided you state them explicitly. Indicate how your program might be
able to read both legacy- and new-format binary files. [10 marks]
(b) (i) Write a C++ class T which contains a const integer field n. T should
also have constructor(s) which initialise n to an integer argument passed
as a parameter or to zero if no argument is given; T should also have a
destructor. The constructor(s) and destructor should print the value of the
n field of the object being constructed or destructed. Indicate why, or why
not, any of your fields or methods are qualified with virtual. [3 marks]
(ii) Explain how objects of class T are allocated and deallocated, for each of the
three areas: heap, stack and static store, noting one case where appropriate
use of virtual is essential. What, if any, overlap in programmer
convenience is there between stack-allocated objects with destructors and
try-finally in Java?

 


(a) Describe the costs and benefits of performing inline expansion of functions during
compilation. [4 marks]
(b) Describe what is meant by eliminating tail recursion, when such an optimization
can be applied and why it is a benefit. [4 marks]
(c) Consider the following ML-like program where the function f returns a function:
let val a = 99 in
let fun f b = let g c = a + b + c in g end
let val f1 = f 17 in
let val f2 = f 33 in
let val v = (f1 a) + (f2 a) in
...
...
Describe carefully how this program fragment could be compiled. Explain how
the expression
(f1 a) + (f2 a)
would be evaluated by your compiled code. [12 marks]
 

 


(a) Give one difference and one similarity between the programming languages:
(i) Algol and Pascal [2 marks]
(ii) SIMULA and Smalltalk [2 marks]
(b) Define the parameter-passing mechanisms: by value, by reference, by
value/result, and by name. [4 marks]
(c) What is the type of the expression
fn f => fn g => fn x => f( g( f x ) )
given by the SML interpreter? Explain how this is inferred. [6 marks]
(d) Give an example in the SML Modules language of a signature with an opaque
type specification together with a structure that matches it. Explain your
answer. [4 marks]
(e) List two language innovations of the programming language Scala. Justify your
answer. [2 marks]
7 (TURN OVER)
CST.2013.3.8
7 Further Java
A Java developer implements a class loader as follows:
public class NetworkClassLoader extends ClassLoader {
private String server;
private int port;
NetworkClassLoader(String server, int port) { ... }
@Override
public Class<?> findClass(String name)
throws ClassNotFoundException {
//TODO: download class file and place contents in byte array b.
return defineClass(name, b, 0, b.length);
}
}
(a) Describe what a Java class loader is, when it is used, and why a developer might
need to implement their own class loader. [3 marks]
(b) Write a Java program which accepts two arguments on the command line: a
network port number and the full path to a Java class file in the file system.
When executed, your program should wait indefinitely on the specified port for
connections from clients. Whenever a client connects, your program should send
the contents of the Java class file to the client. [8 marks]
(c) Complete the method findClass by downloading the class file from the
program you wrote in part (b). Any error states should generate a
ClassNotFoundException. [8 marks]
(d) Outline a security vulnerability which might arise when using your implementation of NetworkClassLoader from part (c) together with the server you wrote
for part (b). [1 mark]
8
CST.2013.3.9
8 Prolog
(a) The propositional logic formula A ∧ B can be represented by the Prolog term
and(lit(A),lit(B)).
Describe a scheme based on this example for representing an arbitrary
propositional logic formula in Prolog. Demonstrate your scheme by encoding
the formula ¬(¬P ∧ (Q ∨ ¬(R ∧ S))). [4 marks]
(b) A formula is in Conjunctive Normal Form (CNF) if it is expressed as a
conjunction (∧-ing) of clauses, where each clause is a disjunction (∨-ing) of
literals.
Write a Prolog program for converting a propositional logic formula into CNF
by implementing the following procedure:
(i) Push negations inwards until each applies only to a literal using De
Morgan's laws: ¬(A ∨ B) ' ¬A ∧ ¬B and ¬(A ∧ B) ' ¬A ∨ ¬B [5 marks]
(ii) Remove double negations of literals: ¬¬A ' A [1 mark]
(iii) Distribute one disjunction from the formula over a conjunction or fail if no
such disjunction exists: A ∨ (B ∧ C) ' (A ∨ B) ∧ (A ∨ C) [6 marks]
(iv) Repeatedly apply the distribution step until no more distribution can be
done [4 marks]
Ensure that your predicates behave appropriately with backtracking, avoid
over-use of cut, and are commented appropriately. Minor syntactic errors will
not be penalised.
9 (TURN OVER)
CST.2013.3.10
9 Software Engineering
Google have spent several years developing self-driving cars which rely on a range of
sensors and stored data and are now claimed to have covered hundreds of thousands
of miles with a good safety record.
A Google executive has now asked to meet the Transport Secretary, who has in turn
asked your company for advice. What sort of safety case should the government
demand from vendors and service providers if autonomous vehicles are to be allowed
on Britain's roads?


(a) Explain an efficient method to find the k-th smallest number in a set of n
numbers (output: one number), without first sorting the n numbers, and discuss
its complexity in terms of n and k. [4 marks]
(b) Explain an efficient method to find the k smallest numbers in a set of n numbers
(output: k numbers), without first sorting the n numbers, and discuss its
complexity in terms of n and k. How much extra work is needed compared
to (a)? [4 marks]
(c) Draw four distinct binary search trees (BSTs) for the following set of keys:
{1, 2, 3, 4}. [2 marks]
(d) Let a height-balanced BST (hBST) be a BST with the additional defining
invariant that each node is the parent of subtrees whose heights differ by at
most 1. Give an efficient procedure to insert into an hBST and prove that the
defining invariant is preserved.


(a) Explain the terms amortized analysis, aggregate analysis and potential method.
[6 marks]
(b) Consider an arbitrary sequence of n stack operations PUSH(), POP() and
MULTIPOP(x) in which POP() or MULTIPOP(x) never attempt to remove more
elements than there are on the stack. Assuming that the stack begins with
s0 items and finishes with sn items, determine the worst-case total cost for
executing the n operations as a function of n, s0 and sn. You may assume
PUSH() and POP() cost 1 each and MULTIPOP(x) costs x. [5 marks]
(c) Suppose we want to store a number of items in an array, but we do not know in
advance how many items need to be stored. The INSERT(x) operation appends
an item x to the array. More precisely, if the size of the array is large enough, x
is inserted directly at the end of the array. Otherwise, a new array of larger size
is created that contains all previous items with x being appended at the end.
The total cost of INSERT(x) is 1 in the first case, and the size of the new array
in the second case.
(i) Devise a strategy which, for any integer n, performs any sequence of n
INSERT(.) operations at a total cost of O(n). [5 marks]
(ii) For the strategy described in (c)(i), give a proof of the cost of the algorithm
using the potential method.

 

) Write  function that prompts the user for the name of a file to output as a text file that will hold a two dimensional array of the long double data type.
java program that takes in user input of various numbers as a type string, prints the sum of all numbers entered, and prints the smallest and largest numbers.

. Write  program that reads a user inputted number of hours that one person works in a week and his/her hourly pay. Calculate the total pay and print it.
Write  program that insert number from the keyboard, and find out the number is prime or not?


(a) Given any directed graph G = (V, E) with non-negative edge weights, consider
the problem of all-pairs shortest path (APSP). Give the asymptotic runtimes of
the following four algorithms when applied (directly or iterated) to the APSP
problem as a function of |V | and |E|, and provide a brief justification for your
answer: Bellman-Ford, Dijkstra, matrix multiplication and Johnson. [8 marks]
(b) Consider the problem of converting currencies modelled by a directed graph
G = (V, E) with |V | vertices representing currencies and |E| directed edges
(u, v) each of which has a strictly positive weight w(u, v) > 0 representing
the exchange rate. For instance, for any real number x, we have x USD =
w(dollars, pounds) · x GBP. Our goal is, given a pair of currencies s, t ∈ V , to
find the least expensive way of exchanging from s to t, possibly by using more
than one exchange.
(i) How could you transform the graph by reweighting the edges so that the
problem could be solved with a shortest path algorithm? Indicate which
shortest path algorithm is used. [8 marks]
(ii) How would you deal with negative-weight cycles if they occurred in the
transformed graph? Give the perspective of the currency trader as well as
that of a computer scientist.

 

What is a priority queue? Explain the data structure known as a heap and describe
how a heap can be implemented using a simple linear block of memory. Assuming
that a heap implemented in this way stores N items, describe how it can be viewed
as an almost-balanced binary tree. What difference can there be between the
greatest and least lengths of paths from the root of the tree to a leaf? [5 marks]
Describe, and estimate the costs of, procedures to
(a) find the parent and offspring of a given node; [2 marks]
(b) insert a new item into an existing heap; [2 marks]
(c) delete the topmost item from a non-empty heap; [2 marks]
(d) starting from an array holding N items in arbitrary order, rearrange those
items so that they form a heap, taking time less than that which would be
needed if the items were just inserted into the heap one after the other.
[4 marks]
A stable sorting method is one where items whose keys compare as equal will appear
in the output in the same order that they appeared in the input list. Would a heap
sort based on the algorithms you have documented be stable? Justify your answer.
[5 marks]
4
CST.98.3.5
7 Computer Design
How can a pipeline be used to improve processor performance? [5 marks]
Explain, with reference to the 5-stage pipeline diagram below, how feed-forwarding
(also called bypassing) can be used to reduce the effects of load delays but cannot
eliminate them.
instruction register execute memory register
fetch fetch access write back
[10 marks]
Most instructions in old accumulator machines read an operand from memory which
is then combined with the accumulator. The only exception is usually the store
instruction which writes the accumulator (without modification) to the memory.
If you were to pipeline an accumulator machine, where would the memory access
stage go? [5 marks]
8 Operating System Functions
Multimedia applications may be characterised by their requirement for timely
completion of their computation or data processing in order to function usefully.
Why are traditional operating systems unable to deliver such guarantees? Comment
on the features which an operating system should implement in order to support
such applications successfully, considering issues of memory management, device
access, and scheduling techniques.

Option 1

Low Cost Option
Download this past answer in few clicks

9.82 USD

PURCHASE SOLUTION

Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

rated 5 stars

Purchased 3 times

Completion Status 100%