Describe how Overhauser interpolation can be used to introduce additional points Programming in C and C++ For
Question:
Describe how Overhauser interpolation can be used to introduce additional points
Programming in C and C++ For five of the following C or C++ features write a very short fragment of code that illustrates the syntax involved. In each case explain very briefly what your example achieves. (a) preprocessor macros and conditional compilation (b) casts that convert from one pointer type to another (c)
Compiler Construction Outline the key features of the design of the part of a compiler that will translate the abstract syntax tree representation of a program into a stack-based intermediate code. Concentrate on those features used in the translation of the following fragment: ... LET i = k LET j = k WHILE (i>0) AND (j<100) DO { i := i-1; j := j+2 } ... In particular, concentrate on the mechanism you would choose to deal with (a) the scopes of identifiers (b) the compilation of boolean expressions involving the operators NOT, AND and OR [6 marks] (c) the translation of the WHILE command [4 marks] (d) the translation of the two assignments
Given a closed PCF term F of type nat ? nat and a function f : N ? N, say that F represents f if F(succn (0)) ?nat succf(n) (0) holds for all n ? N. (a) What is the soundness property of the denotational semantics of PCF? Use it to show that if f is not a constant function (that is, f(m) 6= f(n) for some m 6= n), then the denotation JFK : N? ? N? of any F that represents f is the strict function that equals f when restricted to N. [4 marks] (b) If f is a constant function (f(n) = c for all n, say), give, with justification, two PCF terms that represent it and that are not contextually equivalent. [5 marks] (c) Consider the PCF term G def = fix(fn x : nat ? nat .fn y : nat . if zero(F y) then y else x(succ(y))) where F represents a function f : N ? N with the property that f(n) = 0 holds for infinitely many n ? N. Let ? : (N? ? N?) ? (N? ? N?) be the continuous function whose least fixed point is JGK. Show by induction on k that for all k, n ? N ? k (?)(n) = ( least m such that n ? m < n + k and f(m) = 0 ? if no such m exists. [4 marks] (d) State the adequacy property of the denotational semantics of PCF and Tarski's Fixed Point Theorem for continuous functions on a domain. Use them to deduce that the term G in part (c) represents the function to the least m ? n such that f(m) = 0
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}0?i?m 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 w?2(s), w?1(s), w0(s) and w1(s) so that the cubic curve segment joining Ai?1 and Ai can be expressed as Pi(s) = w?2(s)Ai?2 + w?1(s)Ai?1 + 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}0?i?m,0?j?n. [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. [4 marks]
A lease is a concurrency primitive similar to a lock (only one node may hold a lease at any time); the difference is that a lease times out if it is not renewed for some time. After timing out, another node can acquire the lease. (a) Briefly summarise how leader election works in the Raft consensus algorithm, and discuss the commonalities and differences between leader election and a lease. (Focus only on leader election, and ignore the rest of the Raft algorithm. Include the role of the term number in your explanation.) [5 marks] (b) In a partially-synchronous system with crash-recovery failures, is it possible to guarantee that a lease is always held by exactly one node? Justify your answer. [5 marks] (c) You are asked to design a lease algorithm for a system in which the set of nodes is not known in advance, and may change over time. Can the Raft leader election algorithm be used here? Why/why not? [2 marks] (d) A colleague proposes the following lease
algorithm: There are three servers, each storing a value that is initially null. Assume every client has a unique ID clientId 6= null. Every 10 seconds, each client that wants to acquire the lease, or currently holds the lease, sends a request (acquire, clientId) to all three servers. When a server with current stored value v receives (acquire, n): If v = null ? v = n, or if its value was last set more than 30 seconds ago, then it sets its value to n and replies true. This counts as "setting the value", even if the value does not change. If its value was last set to v 6= n less than 30 seconds ago, it leaves its value unchanged and replies false. If a client receives two or more true responses from the servers, it now holds the lease, otherwise it does not hold the lease. Discuss the strengths and weaknesses of this algorithm. What faults does it tolerate? What assumptions does it make for its correctness? How might the algorithm be improved to avoid some assumptions or weaknesses?
EDSAC (1949) was the first practical stored-program computer in operation. Although it had no subroutine jump instruction, a method for using subroutines was devised by David Wheeler. Quote and explain the instruction sequences for subroutine entry and return. [12 marks] Describe the corresponding instruction sequences that you would use in a modern processor. [8 marks] SECTION B 5 Designing Interactive Applications Distinguish the terms needs analysis and requirements analysis. Provide an example to illustrate the difference. [3 marks] What is a strong requirement? Provide counter-examples and explain why each example is not a strong requirement. [4 marks] What role does a functional specification play in a requirements specification? Give a one-sentence example. [3 marks] The receptionist at a small research laboratory is required to field incoming messages and make sure that they reach the recipient in a timely manner. Some messages arrive by word of mouth, others by phone, courier, e-mail or FAX. There are about 100 recipients, most of whom are researchers. They spend a large proportion of their time in meetings of one sort or another, some of which are held in offices, the remainder in conference rooms. The receptionist endeavours to avoid interrupting important meetings unnecessarily. It is proposed to build a system based upon Active Badge technology to improve message handling activities in the laboratory. Each member of staff wears an active badge. An existing Location Server provides client applications with up-to-date information about the location and movements of each active badge. Sketch out the methods you would employ to establish the users' needs for the proposed system. Describe the categories of information you would pass on to the designer and illustrate each with one or two examples.
Consider the transformations used in the construction and rendering of a threedimensional model on a screen. (a) List the three principal transformations in the processing pipeline and explain their r?oles. [6 marks] (b) Why is it convenient to represent the transformations as matrices? [2 marks] (c) What are homogeneous coordinates? Explain how they are used in modelling these transformations as matrices. (d) Derive the matrix to represent a perspective transformation for a viewer at the origin of a point in three dimensions to a point on a screen in the plane z = d.
(e) Perspective in classical art has vanishing points towards which parallel lines converge. 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]
Managerial Accounting
ISBN: 9780073526706
12th Edition
Authors: Ray H. Garrison, Eric W. Noreen, Peter C. Brewer