Exhibit maps and minimum “sum of product” expressions for the…

Question Answered step-by-step Exhibit maps and minimum “sum of product” expressions for the… Exhibit maps and minimum “sum of product” expressions for the following particular functions: (a) F1, being a function of two variables; (b) F2, having four minterms; (c) F3, having two prime implicants; (d) F4, having a prime implicant that can not appear in the minimum “sum of products” representation.In Modula-3 what are object types, and how do they differ from simple record data types? In this context give a brief explanation of method invocation, inheritance and of each of the keywords METHODS, NEW and OVERRIDES. Include short examples where appropriate. [10 marks] Describe briefly the facilities in Modula-3 for defining and using array and reference types. Explain the concept of an open array, showing how access to an array that is received as an argument by a procedure may differ from direct references to the same array. Give an example of a programming task that would be harder in Modula-3 if open arrays were not provided. [10 marks] 9 ser (with the BASH shell) sets up a file containing the following commands, and ensures it is executable: echo $1 $2 mv $1 $1.temp mv $2 $1 mv $1.temp $2 The user at the next terminal sets up a file that is very similar, but which uses cp rather than mv. Describe the behaviour each can expect when they use these files as command scripts. Assuming that the files concerned are both called sw, explain carefully the consequences of such uses as sw somefile somefile sw firstfile.temp secondfile.temp sw only/one.file [7 marks] In another file, called de (say) the following commands exist: echo $# files >> de.info for n in $* do echo $n >> de.info mv $n backup/$n done What do the various substitutions (involving ‘$’ signs) do in this case? Given that ‘>>’ is much like ‘>’ but appends new data to an existing file rather than creating a new one, what will build up in de.info over the course of time? Discuss the effect of issuing the command “de *”. [7 marks] Many Unix commands, for example xlsfonts and even just ls, can generate more output than will fit on the screen at once. Give a brief account of (a) how to use more to inspect the output and (b) how to collect a copy of the output in a file for inspection using a text editor. Write a shell script that will run ls with the -l flag (to get a full detailed listing of file sizes and dates) on one or more directories, will collect all the output in a single temporary file, enter an editor to allow you to inspect the information you have gathered and at the end get rid of the temporary file Assume a database with one relation parent consisting of pairs (a, b) where a is aparent of b.(a) Write a Datalog query which gives the set of pairs (x, y) such that x and yhave a common ancestor z and are the same number of generations from z.[4 marks](b) Write a query in Datalog with stratified negation which gives the set of pairs(x, y) such that x and y have a common ancestor but not one from which theyare the same number of generations distant. You may use the program youdefined for part (a). (c) Prove that the query defined in part (b) above cannot be expressed in Datalogwithout negation. [7 marks](d) For each of queries in parts (a) and (b), give a bound on the running time toevaluate the query on a database with n entries.(a) Describe the relation =β of beta-conversion between terms of the polymorphiclambda calculus (PLC). How can one decide whether two typeable PLC termsare in this relation? Why does the decision procedure fail for untypeableterms? [8 marks](b) Let ω be the polymorphic type ∀α1((∀α2(α2 → α1)) → α1). Show that thereis a closed PLC term I with the following two properties.(i) I has type ∀α(α → ω).(ii) If M1 and M2 are any closed PLC terms of the same type, τ say, and if(I τ M1) =β (I τ M2), then M1 =β M2.[Hint: for property (ii), consider the beta-normal forms of I τ M1 α x andI τ M2 α x, where α is a type variable and x is a variable.]11 Numerical Analysis II(a) Explain the term positive semi-definite matrix. [1 mark](b) Let A and B be n × n matrices and let x be a vector of n elements. StateSchwarz’s inequality for each of the products AB and Ax. What are thesingular values of A, and how are they related to the `2 norm of A?[4 marks](c) Describe briefly the singular value decomposition A = UWVT, and how itmay be used to solve the linear equations Ax = b. [4 marks](d) Let xˆ be an approximate solution of Ax = b and write r = b−Axˆ, e = x−xˆ.Find an expression for an upper bound on the relative error kek / kxk in termsof computable quantities. Show how this formula may be computed using thesingular values of A. [8 marks](e) Suppose A is a 5 × 5 matrix and its singular values are 103, 1, 10−14,10−18, 10−30. If machine epsilon ‘ 10−15 then choose a suitable rank foran approximate solution and form the generalised inverse W+.  (a) An n-bit decoder is a combinational circuit with n inputs and 2noutputs. Foreach possible assignment of values to inputs there is a corresponding outputwhich is set to “1” when and only when that assignment is made to the inputs.Give a design for a 3-bit decoder. [4 marks](b) Ignoring inverters, how many gates are required for your design? How manyare required for an n-bit decoder? [2 marks](c) An n-bit priority encoder has 2n − 1 inputs and n outputs. The inputsx1, x2 . . . x2n−1 are ordered in priority with xj having higher priority thanxiif j > i. The outputs an−1, an−2 . . . a0, interpreted as an unsigned integer,denote the highest priority input asserted high.Give a design for a 3-bit priority encoder. [6 marks](d) Give two designs for a combinational circuit which has K ordered inputs andK corresponding outputs where the only output asserted (if any) is the onecorresponding to the asserted input with the highest priority. [6 marks](e) Which design is better, and why? [2 marks]2 Computer DesignThe way in which an instruction’s operands are specified is dependent on the typeof internal storage in the processor. Processors which have no internal storage usememory.(a) Describe the advantages of including some form of internal storage, such as anaccumulator, in the processor. [5 marks](b) Describe three types of internal storage. In each case describe the format ofan addition instruction. Indicate the presence of any implicit operands wherenecessary. [7 marks](c) Describe how data-forwarding improves performance in a pipelined load/storearchitecture (RISC). What common characteristic of programs often causesthis performance improvement to be very significant?The following Java program has been written by a novice who is attempting toimplement a tree-sort algorithm. This test program is intended to set up threenodes. The value fields of these nodes are to be written out in ascending order.public class TreeSort{ public static void main(String[] args){ Node tree = null;tree.put(8); tree.put(16); tree.put(4);System.out.println(“Sorted values: ” + tree);}}class Node{ private int val;private Node left, right;public Node(int n){ this.val = n;this.left = null;this.right = null;}public void put(int k){ if (this == null)this = new Node(k); // Error noted hereif (k < this.val)this.left = new Node(k);elsethis.right = new Node(k);}}(a) The compiler reports a single error, complaining about the statementindicated. What is the problem? Explain why there is more to fixing theprogram than merely changing this statement. [5 marks](b) Making the minimum number of changes (which will include adding atoString() method to class Node), modify the program so that it worksin the way you think the author intended. [10 marks](c) Provide for class Node a method sum() which returns the sum of the elementsin the tree. [5 marks]3 [TURN OVERCST.2003.10.44 Data Structures and Algorithms(a) In the first phase of heapsort, an initially random vector is rearranged tosatisfy the heap structure constraints. Describe what these are, how therearrangement is done, and prove that it can be done in O(n) time, wheren is the number of elements in the vector. [7 marks](b) Complete the description of heapsort and show that its worst case performanceis O(n log n). [7 marks](c) How many element comparisons would your implementation use to sort theintegers 1 to 8 if they were (i) initially in sorted order, and (ii) initially inreverse sorted order? Explain how you obtained your answers. [6 marks]5 Comparative Programming LanguagesIt has been said that "you can only become a really effective user of a programminglanguage if you have a good understanding of how all its features are implemented".Discuss to what extent this is true. Your answer should include consideration ofthe representation of data, function calling mechanisms, space allocation and theimplementation of object oriented features for a variety of different languages. (a) (i) What is meant by the address space of a process?(ii) Give an example of how a 32-bit address space might be allocated betweenthe various components of user and operating system (OS) code and data.You may assume that the OS occupies half the address space of everyprocess.(iii) Why does the OS region containing memory-mapped I/O interfaces needto be distinguished? What is the alternative to memory-mapped I/O?(iv) How might the fact that much OS code must be permanently resident inmemory be used to advantage?(v) How is the OS protected from user level code at runtime?(vi) How is the OS executed synchronously via calls from user level?[13 marks](b) In what way did the provision of a protected address space per process affectthe development of operating systems? Describe the hardware and softwaresupport for the development you mention in some detail.(a) For IEEE Double Precision β = 2, p = 53, emin = −1022, emax = 1023.Explain the meaning of these parameters and deduce the number of bitsrequired to store the sign, exponent and significand. How many bytes arerequired in total? [5 marks](b) What is the hidden bit and what is its value for normalised numbers, and fordenormal numbers? The following is an informal specification of a device DD has a 1-bit input in, a 1-bit input select and a 4-bit output out. Thevalue at out is 0000 if select is 0 and is a word consisting of the valuesinput at in at the four preceding cycles if select is 1.(a) Formalise this informal specification and point out how you have resolved anyambiguities and incompletenesses. [8 marks](b) Using 1-bit unit-delay elements and multiplexers, design a device thatimplements your formal specification. Draw a diagram of your design.[8 marks](c) Outline how you would go about trying to formally verify your design.[4 marks]13 Natural Language Processing(a) Define the following terms, as they are used in grammar formalisms for naturallanguage:(i) feature structure(ii) feature structure subsumption(iii) feature structure unification[8 marks](b) Discuss the advantages and disadvantages for NLP applications of grammarformalisms that use feature structures compared with context free grammars. (a) State without details three ways to prove properties of the least fixed pointfix (f) of a continuous function f on a domain. [3 marks](b) Let f : D → D be a continuous function on a domain D. Explain whyfix (f ◦ f) = fix (f). [3 marks](c) Let both f : D → D and g : D → D be continuous functions on a domain D.Provefix (f ◦ g) = f(fix (g ◦ f))by showing(i) fix (f ◦ g) v f(fix (g ◦ f)), and [4 marks](ii) f(fix (g ◦ f)) v fix (f ◦ g). [10 marks][Hint: For the last part, start by expanding the left-hand side as a least upperbound of approximations.]In relation to the following headings, compare and contrast the approach taken byBISDN ATM and the Internet Protocol suite:(a) signalling and connection establishment;(b) forwarding/switching;(c) congestion detection and avoidance;(d) Quality of Service;(e) segmentation of large data blocks.[4 marks each]3 [TURN OVERCST.2003.9.44 Distributed Systems(a) Discuss alternative approaches to creating unique names for objects in largescale distributed systems or applications. [3 marks](b) Discuss the support for naming and name resolution in the following:(i) the Internet; [5 marks](ii) object-oriented middleware; [5 marks](iii) message-oriented middleware; [5 marks](iv) web-based systems.A computer system provides a compare-and-swap operation (CAS) which can beused in the following manner:seen = CAS (address, old, new)It loads the contents of address, compares that value against old and if it matchesstores the value new at the same address. All of this is performed atomically andthe value loaded from the address is returned as seen.(a) Write pseudo-code for a simple spin-lock using CAS. [4 marks](b) Why could this perform poorly on a large multi-processor system? [2 marks]Consider a singly-linked list of QNode objects, each with a boolean field value anda reference next to its successor (holding null at the tail of the queue). A sharedlocation l refers to the tail node (or is null if the queue is empty).(c) Define the folowing concurrent operations using CAS:// Append a new node q to the tail of the list, returning// the previous tailQNode pushTail (QNode q);// Remove q, which must have been at the head of the list,// returning the new headQNode popHead (QNode q);[Hint: note that popHead only needs to update memory when the queuebecomes empty.] [8 marks](d) Define a queue-based spin lock based on these operations.(a) (i) Derive the quadratic uniform B-spline basis function, N1,3(t), for the knotvector [1, 2, 3, 4, 5, 6, 7, 8]. [6 marks](ii) Explain how Ni,3(t) is related to N1,3(t), i ∈ {2, 3, 4, 5}. [2 marks](b) The following picture shows a set of five control points and the B-spline curvegenerated by the control points and the knot vector [0, 0, 0, 0, 1, 2, 2, 2, 2] withk = 4 (a cubic B-spline).(i) Draw a similar diagram, using the same five control points, for the knotvector from part (a), [1, 2, 3, 4, 5, 6, 7, 8], defining a quadratic B-spline(k = 3). [3 marks](ii) Draw another diagram, with the same control points, for the knot vector[1, 2, 3, 4, 4, 5, 6, 7], defining a quadratic B-spline (k = 3). [3 marks](iii) What is the continuity of the curve at t = 4 in each of the cases inparts (b)(i) and (b)(ii)? [2 marks](c) Show how the following object can be constructed using Constructive SolidGeometry (CSG). You may assume the following primitives: sphere, cylinder,cone, torus, box. [You are expected to describe which primitives are neededand how they are combined but you are not expected to specify accurately allof the parameters of the primitives.][4 marks]6CST.2003.9.77 Optimising Compilers(a) Summarise briefly the principles of strictness analysis, including descriptionsof:(i) the space of values used for analysis-time representation of a k-argument,1-result function in the source language;(ii) how a built-in function is given an abstract meaning;(iii) how a recursive user-defined function is given an abstract meaning (it isacceptable to do this part by example);(iv) the machine-level benefit of the associated optimisation.[8 marks](b) A problem amenable to similar treatment is that of escape analysis. Here wehave a call-by-value language with cons and the question to be answered is"whether a value containing a cons-node passed as argument to a function maybe returned ('escape') as part of the function's result".(i) Choose (and state clearly) an appropriate set of abstract values andabstractions of functions to formalise the problem of escape analysis fora simple first-order language with integers and simple integer lists (butnot lists of lists). Also give abstract interpretations of if-then-else, +,cons, hd and tl.[Hint: to manage this system without using static types, you might bestassume that nil is treated as 0, and that any type-error (dynamicallydetected) such as cons(1,nil)+3, tl(3) and even (because of the 'nolists-of-lists' rule) cons(cons(1,nil),nil) gives result 0.] [8 marks](ii) Give without proof abstract meanings (resulting from your system) of thefollowing functions:f(x,y,z) = cons(hd(tl(x)), if hd(x) then y else tl(z))g(x,y) = if x=0 then 0 else cons(hd x, g(tl x, y))h(x,y) = if x=0 then x else cons(hd x, h(tl x, y))k(x,y) = if x=0 then y else cons(hd x, k(tl x, y))  : Write  program that reads a set of integers and then finds and prints the sum of the even and odd integersjava program that asks the user to enter 2 integers, obtains them from the user, determines if they are even or odd numbers and prints their sum, product, difference, and quotientWrite  program that prompts the user to read two integers and displays their sum. Your program should prompt the user to read the number again if the input is incorrect (a) Write brief notes on the function defined below:fun foldl f (e, []) = e| foldl f (e, x::xs) = foldl f (f(e,x), xs);Illustrate your answer by describing the computations performed by thefollowing two functions:fun f x = foldl (foldl op* ) (1,x);fun g p zs = foldl (fn ((x,y), z) =>if p z then (z::x,y) else (x,z::y))(([],[]), zs);[4 marks](b) Selection sort is a sorting algorithm that works by repeatedly identifying andsetting aside the smallest (or largest) item to be sorted. Implement selectionsort in ML and describe the efficiency of your solution using O-notation.[4 marks](c) Code an ML function to generate a multiplication table in the form of alist of lists of integers. For example, given the argument 3 it should return[[1, 2, 3], [2, 4, 6], [3, 6, 9]]. [6 marks](d) Modify your solution to part (c) in order to generate a three-dimensionaltable containing values xijk computed by calling a supplied 3-argument curriedfunction f. For example, given the argument 2 it should return [[[x111,x112],[x121,x122]], [[x211,x212], [x221,x222]]]. [6 marks]All ML code must be explained clearly and should be free of needless complexity.SECTION B3 Discrete Mathematics IGive structured proofs or counterexamples for the following.(a) ((A ⇒ B) ∧ (C ⇒ ¬B)) ⇒ (A ⇒ ¬C ) [10 marks](b) (∃x .A(x ) ∧ ∀y.A(y) ⇒ y = x ) ⇒ (∃x .∀y.(A(y) ⇔ y = x )) [10 marks]3 (TURN OVER)CST.2010.1.44 Discrete Mathematics ILet x , y, z range over individuals I and a, b range over societies S. Let M , F andT be atomic predicates as follows:M (x , a) x is a member of society aF(a) society a involves fightingT(x , y, a) x talks to y about a(a) Formalise each of the following English statements and translate each of thefollowing formulae into idiomatic English (natural English sentences).(i) ∀x , y, a.T(x , y, a) ⇒ T(y, x , a)(ii) Nobody talks to themselves about anything.(iii) There’s at most one society involving fighting.(iv) All societies have at least two members.(v) ∀a.(∃x , y.(M (x , a) ∧ M (y, a) ∧ x 6= y)) ⇒∃x , y, b.M (x , a) ∧ M (y, a) ∧ x 6= y ∧ T(x , y, b) ∧ F(b)(vi) ∀x , y, a.T(x , y, a) ⇒ M (x , a)[12 marks](b) Is it possible to satisfy (i)-(vi) simultaneously? Either give a concretedefinition of two sets I and S and relations M , F, and T for which (i)-(vi)are all true or prove that you can derive a contradiction from (i)-(vi).ensure to answer all Computer Science Engineering & Technology C++ Programming COMPUTER S 466 Share QuestionEmailCopy link Comments (0)