COMPLETE ALL THE QUESTIONS 1) Make a version of X.32[7] where the…

Question Answered step-by-step COMPLETE ALL THE QUESTIONS 1) Make a version of X.32[7] where the… COMPLETE ALL THE QUESTIONS 1) Make a version of §X.32[7] where the element type is a template argument.[10] ( ?2.5) Given an Itor class like the one in §X.32[8], consider how to provide iterators for for-wards iteration, backwards iteration, iteration over a container that might change during aniteration, and iteration over an immutable container. Organize this set of iterators so that auser can interchangeably use iterators that provide sufficient functionality for an algorithm.Minimize replication of effort in the implementation of the containers. What other kinds ofiterators might a user need? List the strengths and weaknesses of your approach.[11] ( ?1) Make a version of §X.32[8] where the element type is a template argument.[12] ( ?3) Design a ”truly object-oriented” container holding Object?s as elements A Container(along the lines of §X.32[7]) is itself derived (directly or indirectly) from Object. Implementa List, Slist, and Vector as outlined in §X.32[7] and test them as in §X.32[7].[13] ( ?2.5) Generate 10,000 uniformly distributed random numbers in the range 0 to 1,023 andstore them (a) an standa(i) Explain how a segment of an Overhauser curve in general can be represented as an Hermite cubic and so as a B´ezier cubic. [4 marks] (ii) Derive the formula for the resulting B´ezier curve, P(t). [3 marks] (iii) Calculate the coordinates of P( 1 2 ). How large is the error? [Hint: ? 2 ? 1.414.] [3 marks] (b) Calculate revised control points for the B´ezier curve so that it models the circular arc more accurately. [4 marks] (c) Describe in outline an alternative way of efficiently drawing the arc by calculating the pixels that lie on it directly. [6 marks] 4 Computer Graphics and Image Processing (a) Describe in detail the Cohen-Sutherland algorithm to clip a straight line segment against a rectangle. [8 marks] (b) Extend the algorithm from part (a) to clip a line against a three-dimensional viewing frustrum. [6 marks] (c) Describe how to clip a B´ezier curve against a screen rectangle. [6 marks] 4 CST.2016.4.5 5 Databases (a) Define the concept of a functional dependency. [3 marks] (b) Suppose that relation R has m attributes. Give an upper bound on the number of functional dependencies that R could satisfy (including trivial dependencies). [3 marks] (c) Let R(A, B, C, D, E) be a relational scheme with the following dependencies. A ? C B, C ? D A ? E B, D ? C C ? E E ? D E ? B Which, if any, of these dependencies are redundant? [4 marks] (d) Suppose R(A, B, C) is a relational schema with functional dependency A ? B. What can you deduce about the results of ?A,B(R) ?A ?A,C(R)? Justify your answer. [3 marks] (e) Suppose R(A, B, C) is a relational schema. In addition, you know that the following is always true in any correct database instance. R = ?A,B(R) ?A ?A,C(R). What can you deduce about the dependencies between attributes A, B, and C? Prove any of your claims. [7 marks] 5 (TURN OVER) CST.2016.4.6 6 Databases This question deals with the variety of approaches to database design. (a) What is meant by the term on-line transaction processing (OLTP)? [3 marks] (b) What is meant by the term on-line analytic processing (OLAP)? [3 marks] (c) Compare and contrast the approach to schema design for OLTP and OLAP databases. [3 marks] (d) Compare OLAP with the so-called NoSQL approach to database design. [3 marks] (e) Give an example of a set of requirements whose solution would need to combine OLAP, OLTP and NoSQL. Describe an architecture integrating these elements in the system design. [8 marks] 7 Economics, Law and Ethics (a) Describe three ways in which information goods and services markets differ from the market for coal or for potatoes. [6 marks] (b) What are the usual effects of these differences on the structure of such markets? [4 marks] (c) You are the CEO of a car company considering adoption of Android as the platform for the entertainment, navigation and related systems in your next generation of vehicles. Should the app store be run by your company or by Google, and how should the safety case for apps be established?Describe what occurs when Alice performs her next block-server read on Oi . [2 marks] (iii) Explain why it might be desirable, from a security perspective, to add a timeout field t, protected by the keyed hash, to the capability. [2 marks] (iv) Developers extend NASD to support Quorum-replicated block servers. What new failure mode may arise during a Quorum block write, relative to unmodified NASD capabilities, in adding capability timeouts? [2 marks] (c) The Andrew File System (AFS) is authenticated and encrypted using Kerberos; ACLs expressing positive and negative rights for users and groups. Multiuser AFS clients (e.g., UNIX servers) build a secure RPC connection for each local user, authenticated with their Kerberos ticket, and issue RPCs (e.g., file read) on their behalf only via their own connection. If no suitable Kerberos ticket is available (e.g., the ticket has expired, the user has destroyed their ticket, or a job is running unattended), then an insecure connection is used instead. (i) The group system:anyuser holds the union of unauthenticated (anonymous) users and all authenticated users. Explain why an ACL granting read access to system:anyuser via a positive entry, but denying read access to user rnw via an overriding negative entry, might prove problematic. [2 marks] (ii) Describe the consequences to AFS authentication and authorisation of a malicious local user gaining root access on a multiuser client. [2 marks] (iii) An AFS client uses the unauthenticated Network Time Protocol (NTP) to synchronise its clock with the AFS server. Attacker Mallory is able to inspect, drop, and insert packets between the AFS client and server (e.g., by controlling a network switch). Describe an attack that allows Mallory to inject malicious content into the client’s AFS cache, but that does not allow Mallory to write content directly to the AFS server. [4 marks] 10 CST.2015.5.11 9 Concurrent and Distributed Systems These questions relate to reliable multicast and distributed transactions. Answers may include timelines of message transmissions/deliveries or transaction submissions/commits. For each event in the timeline, show a physical timestamp (T1, T2, . . . ), process numbers (P1, P2, . . . ), operation (‘transmits’, ‘delivers’, ‘submits’, ‘commits’), and a numbered message (m1, m2, . . . ) or numbered transaction (x1, x2, . . . ). For example, “T7: P1 transmits m4″. In this context define: (a) (i) FIFO ordering [1 mark] (ii) causal ordering [1 mark] (iii) total ordering [1 mark] (iv) strong consistency [1 mark] (v) weak consistency [1 mark] (b) (i) Does causal ordering imply total ordering? If so, explain why; if not, show a counterexample, labelling and explaining the violating event. [2 marks] (ii) Does total ordering imply causal ordering? If so, explain why; if not, show a counterexample, labelling and explaining the violating event. [2 marks] (c) A replicated database is implemented using totally ordered reliable multicast. Clients may submit transactions to any process in the group. When process Px receives a new transaction xi from a client, it will multicast the transaction to all processes, including itself. As xi is delivered by multicast, each process submits the transaction to a local ACID database. Px returns the result (abort or commit) to the client; other processes discard the transaction result. (i) This model works well if queries do not contain the SQL time keyword, which is substituted with the current time when a transaction is evaluated. Explain why using time might be a problem and describe a solution. [4 marks] (ii) In the first release of the database, processes submit received multicast transactions synchronously, one at a time, to the local database. In a later version, to improve performance, processes are allowed to submit multiple transactions at a time asynchronously to the local database. Why does this fail to provide strong consistency for distributed transactions? Describe a solution that might allow limited (but useful) local concurrency to be supported. You are asked to design a retrieval system so that company staff can locate minuteson a particular topic. Because of the legal implications that past discussions anddecisions may have, the company is particularly concerned that the new retrievalsystem will be reliable and effective.Outline the design of your system, indicating the particular features it will have thatare intended to meet the company’s requirements (you can assume that minutesare always clearly dated and have explicit lists of participants). [10 marks]The company is willing to allow the installation of a pilot system so your approachcan be evaluated under realistic conditions.Describe, in detail, your design for the evaluation: what data, operationalconditions and aspects of your system would you consider, and why? Whatperformance measures would you apply, and why? [10 marks]5 Security”Robert Morris Senior was responsible for Unix security, Robert Morris Junior forthe Internet worm. The father did much more damage to Internet security thanthe son” (Whitfield Diffie). Discuss.  Compare circuit switching and packet switching, paying attention to channelcharacteristics and resource efficiency. [7 marks]What is wave division multiplexing (WDM)? Is it more like circuit switching orpacket switching and why? [7 marks]Wave length conversion is the process, either optical or optical-electronic-optical,of receiving a signal on one wavelength and transmitting on another.How does wave length conversion ease the problem of routing optical carriers in anetwork? [3 marks]”The huge capacity of WDM systems will mean that IP becomes redundant.”Discuss. Describe the characteristic features of a VLIW (Very Long Instruction Word)processor architecture. [3 marks]VLIW processors aim to achieve high execution throughput using a differentstrategy from that of out-of-order dynamic execution RISC implementations.Compare and contrast these different approaches, pointing out the advantages anddisadvantages of each strategy in achieving this goal.You may wish to consider the following issues:• instruction issue logic• cache sizes• compiler code generation• execution unit utilisation[9 marks]Why have VLIW architectures traditionally been used only for special-purposeapplications such as Digital Signal Processors? [3 marks]What techniques have been develop  Explain the key ideas of a Hopfield artificial neural network for content-addressable,associative memory. In explaining how memories are stored and retrieved, be sureto define the notions of:• configuration space• connectivity matrix• stable attractor• basin of attraction• network capacity, and its dependence on the number of “neurones”[10 marks]Marshall as many lines of evidence as you can to support the view that in humanvision “what you see is your own ‘graphics’, rather than the retinal image asfaithfully recorded by photoreceptors in the eye”. Explain the significance of thisobservation for vision theory and for machine vision. [8 marks]Suppose you were trying to design a machine vision system based as closely aspossible upon human vision. Would you aim to design in the visual illusions thatnearly all people “see” as well? (These include the distortions of geometrical form,angle and relative length illusions, etc.) If such properties emerged as unintendedconsequences of your vision design, would you consider them to be features, orbugs? : Write  program that will continuously accept a character and store in a stack until letter Z is enteredWrite  program that reads 10 integers and find the maximum and minimum of the numbers.Write  void method that takes as input parameters an integer array and a number then use the method to find and print if the number is found in the array or not. For each of the given pairs of terms, give a most general unifier or indicate whynone exists. (Here x, y, z are variables while a, b are constant symbols.)h(x, y, x) and h(y, z, u)h(x, y, z) and h(f(y), z, x)h(x, y, b) and h(a, x, y)h(x, y, z) and h(g(y, y), g(z, z), g(u, u))[4 marks]A standard unification algorithm takes a pair of terms t1 and t2 and returns asubstitution ? such that t1? = t2?. Show how this algorithm can be used to findthe unifier of several (n > 2) terms t1, t2, . . . , tn: a substitution ? such thatt1? = t2? = · · · = tn?. Indicate how the unifier is constructed from the unifiersof n ? 1 pairs of terms. (Assume that all required unifiers exist and ignore thequestion of whether the unifiers are most general.) [6 marks]Prove using resolution the formula?x [P(x) ? (Q(x) ? ¬Q(f(x)))]? ?y ¬P(y)or indicate why this formula is not a theorem State the hierarchy theorems for time and space. [4 marks]A linear time reduction from a language L1 to L2 is a reduction that can becomputed by a deterministic Turing machine in time O(n).A class of languages C is closed under linear time reductions if whenever L2 ? Cand L1 is linear-time reducible to L2, then L1 ? C.For each of the following complexity classes (a) to (d), say• whether it is closed under linear time reductions• whether it contains problems that are complete under linear time reductionsGive full justification for your answers.(a) DSPACE(n2) [4 marks](b) L  Explain why the Assignment Axiom of Floyd-Hoare logic is valid only forassignments whose right-hand sides have no side effects. [4 marks]Illustrate your explanation with an example. [4 marks]Suppose expressions of the form (C;E) are allowed, where C is a command and Eis an ordinary expression (E has no embedded commands). (C;E) is evaluated byfirst executing the command C (with possible side-effects) and then returning thevalue of the expression E.Discuss how Floyd-Hoare logic might be extended to handle such expressions.[6 marks]Illustrate your discussion by giving a proof in the extended logic of{Y 6 X}R := X; Q := 0;WHILE (BEGIN R := R ? Y ; Q := Q + 1 END; Y 6 R) D0 SKIP{X = R + (Y ×Q) ? R < Y } What is meant by the term memoryless as used in describing a Markov chain?[3 marks]What limitation does this place on using Markov chains to model real systems?[3 marks]"As systems become saturated their response time becomes unpredictable."Why is this? Illustrate your answer using an M/M/1 queueing system. [10 marks]Show, by drawing the state transition diagram of a Markov chain, how arrivalprocesses with inter-arrival times that are not exponentially distributed can bemodelled. [4 marks]9 Specification and Verification IIDefine a predicate Rise such that Rise clk t is true if and only if there is a risingedge on clk at time t. [2 marks]Consider the following definition of the behaviour of a register in higher order logic:DFF(q, d, clk, ce, ar, spare) =(q 0 = F) ??t.(if Rise clk t ? Rise ar tthen (if ar(t+1)then q(t+1) = Felse (if ce(t+1) then q(t+1) = d t else q(t+1) = q t))else q(t+1) = q t)Describe in detail the behaviour of DFF(q, d, clk, ce, ar, spare). [6 marks]Describe how circuit structures can be represented in logic. Explain how internallines are modelled. [6 marks]Consider a device D(q, d, clk) with inputs clk and d and output q that isimplemented using a DFF by connecting the ce line to power and the ar line toground. Draw a diagram of this circuit and write down the corresponding logicalformula. Derive a simplified formula for D(q, d, clk). Give  lgorithm for drawing the part of a circle which lies in the first octant.Assume that the circle has integer radius and is centered at the origin. Assumethat you have a function setpixel(x, y) which turns on pixel (x, y). [10 marks]Derive a matrix, or a product of matrices, to perform a clockwise 2D rotation ofarbitrary angle, ?, about an arbitrary point, (xc, yc). [4 marks]Provide an algorithm to ascertain whether the Bezier curve defined by P1P2P3P4lies within some tolerance, , of the straight line segment, P1P4, which joins theBezier curve's end points. Your algorithm must return false if the Bezier curve isoutside the tolerance; it must return true if the curve is well inside the tolerance;it may return either true or false if the curve is inside, but not well inside, thetolerance. [6 marks]SECTION B5 Comparative Programming LanguagesGive a brief summary of the main syntactic constructs found in the programminglanguage Smalltalk. Other languages often have the conditional constructsif-then-else and while. Show how these two constructs can be defined in Smalltalk.[8 marks]Illustrate the use of Smalltalk by showing how you would define a method tocompute the factorial of an integer. [8 marks]Although Smalltalk was originally designed to be an interpretive language, modernimplementations are dramatically more efficient. Briefly outline what techniquesmight have been used to make this improvement.  Describe the basic architecture of the ODMG standard for Object DataManagement. [10 marks]What support is provided for transactions? What locking modes are available, andhow are they used by the database runtime systems? [4 marks]The query language OQL is recognised as a standard by the Object ManagementGroup (OMG). To what extent is it similar to SQL, and in what ways does itdiffer? [6 marks]SECTION C9 Semantics of Programming LanguagesWhat does it mean to say that two configurations of a labelled transition systemare bisimilar? [3 marks]Describe a labelled transition system for a language of communicating processeswith input prefixing (c(x). P), output prefixing (¯chEi. P), an inactive process (0),choice (P + P COMPLETE ALL THE QUESTIONS  Computer Science Engineering & Technology C++ Programming CS 7646 Share QuestionEmailCopy link Comments (0)