Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations
Question:
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and between B and C, respectively. Define the inverse relation S 1 and the product relation S T. Prove that (S T) 1 = T 1 S 1 . [4 marks] Let f be a relation between A and B, and R be a relation on A. Characterise the following conditions in terms of the algebra of relations: (a) f is a partial function (b) R is reflexive (c) R is symmetric (d) R is transitive [5 marks] If condition (a) holds, let Q = f f 1 . Which of conditions (b-d) must Q satisfy? In what circumstances is Q an equivalence relation? [8 marks
Discuss alternative ways of implementing 8-bit and 16-bit object access on processors with a 32-bit or 64-bit bus size. [7 marks] How might one deal with 9-bit objects? [3 marks] Both the DEC Alpha and the MIPS R2000 claim to be RISC machines. One has delayed branches and loads but the other does not. Sketch possible design or implementation differences. [7 marks] conditional move instructions be useful? [3 marks] 1 Technology Either A multimode graded index fibre has a core of radius a and refractive index n(r), where r is the radius measured from the fibre axis. Show that the equation of a light ray launched at radius r0 along the fibre core, parallel to the fibre axis, is given by d 2 r dz2 = 1 2 2 . dn2 dr where = n(r0). [8 marks] The fibre core has a parabolic variation of index with radius, described by n 2 (r) = n 2 co(1 r2 ) Show that a short length of the fibre can act as a lens, and derive an expression for its focal length in terms of , nco, and . [8 marks] Explain qualitatively how such a fibre minimises the spreading of an optical pulse propagating along it. [4 marks] or Describe any one optical system in a compact disc player. In your answer pay particular attention to the following: how information is recorded and read from the disc's surface the limitations on the disc's storage capacity the laser focusing system the optical tracking system [20 marks] 3 Distributed Systems A certain university proposed a design for a workstation with hardware-enforced protection of the system software. Trusted software could then be run on the workstation. Discuss the advisability of this approach to workstation design. [20 marks] 2 CST.94.9.3 4 Computer Systems Modelling A distributed database is organised as four servers with 100 terminals attached via 10 terminal concentrators. The concentrators and the servers are connected by a 100 Mbps network. Each server has a single disk. A typical query generates the following load on the system: terminal concentrator 70 ms server CPU 60 ms disk 25 ms network 1 Kbyte transfer Give estimates and bounds of average system response time when each terminal generates (a) a query every minute (b) a query every 10 seconds (c) a query every 5 seconds [Recall that in a balanced system the utilisation of each device is given by U = N N + K 1 where N is the number of customers and K is the number of devices.] [20 marks] 5 Information Theory and Coding Define the mutual information and channel capacity of a discrete memoryless channel. [10 marks] 0 1 1 0 p p 1-p 1-p X Y For the binary symmetric channel with transition probability p, derive the channel capacity. Sketch a graph of the channel capacity against the transition probability. [10 marks] Designing Interactive Applications Define in one sentence the role of requirements in system design. Explain the difference in purpose between performance requirements and functional requirements for interactive systems. [2 marks] The rules enforced in the City for dealings in equities require that deals (buying and selling stock) are to be recorded within 60 seconds of agreeing each deal. In one particular bank this is currently done by having the dealer write the details of the deal on a paper "ticket" and place it in a pot for collection by a deal-input clerk who enters the deal into an on-line system. Six items of information must be written on the ticket (average lengths shown in parentheses): 1. the customer's account number (four digits) 2. the name of the buyer/seller (six characters) 3. the name of the stock (six characters) 4. the number of shares bought or sold (four digits) 5. the price agreed (five characters; for example, 72 3/8 or 167.5) 6. whether this is a buy or a sell Each dealer handles only a limited range of stocks, at most thirty (i.e., thirty companies such as ICI, Wellcome, Hanson, etc.). During busy periods, dealers may make deals every 30 seconds. It is proposed that, in the future, dealers input their deals themselves. (a) Using the Keystroke-level model, calculate how long it would take dealers to record deals by typing the details on an alphanumeric keyboard. [4 marks] (b) Suppose all of the names of stocks were displayed on the dealer's interactive workstation, together with their current prices. Sketch out a design to allow the dealer to input some of the details of the deal graphically with a mouse and some with the keyboard. Again using the Keystroke-level model, calculate the speed of entry of deals. Using this result and the result from (a), write a performance requirement for a system to support dealers in entering deals. [8 marks] Use the following times in seconds for operators: K (key-press) = 0.30, P (point at target) = 1.10, H (home hands to another device) = 0.40, M (mentally prepare) = 1.35. (c) Discuss the benefits of these two alternatives to the current method, and the feasibility of meeting the performance requirements derived in (b) by using other styles of interaction. [6 marks] 4 CST.94.9.5 7 Algebraic Manipulation Explain how polynomials can be represented within an algebra system using (a) recursive, and (b) distributed data structures. For each, illustrate your answer by showing what structure will be generated for the polynomial a1a2 . . . a10(1 + x + + x 10) first when the 11 variables a1, . . . a10 and x are sorted in alphabetic order, and then when they are kept in inverse alphabetic order. [16 marks] Does the ordering used make any difference to the amount of space consumed? [4 marks] 8 Artificial Intelligence II Explain how genetic algorithms differ from conventional mathematical methods for optimisation. [10 marks] What are the advantages and disadvantages of genetic algorithms? [10 marks] 9 Database Topics The Relational Model of Data and its associated Data Manipulation Languages contained no provision for handling sets of tuples. Discuss the extent to which the SQL GROUP BY clause overcomes this weakness. [4 marks] The Nested Relational Model attacks the problem by extending the Data Definition Language that specifies a relational schema. Describe the extension, and explain with the aid of examples how it enables both sets and compound values to be represented. [7 marks] Explain how aggregates are handled in the Functional Data Model and the Data Language DAPLEX. [6 marks] In what way can the purging of duplicates cause problems when evaluating functions defined over sets? How does DAPLEX allow the programmer to retain duplicates when they are needed? [3 marks] 5 [TURN OVER CST.94.9.6 10 Numerical Analysis II Apply the Newton-Raphson formula xn+1 = xn f(xn) f 0 (xn) for solving the equation f(x) = 0 using f(x) = x 1 2 e 1x 2 . Simplify your formula so that the exponential function need be called only once per iteration. [4 marks] This function has a zero at approximately 0.76. Use x0 = 1 and perform one Newton-Raphson iteration to calculate x1 and verify that this is a good starting value. Now use x0 = 1/ 2 and re-calculate x1. (You may assume for this purpose: 2 ' 1.4, 1/ 2 ' 0.71, e ' 1.6, 1/ e ' 0.61.) [3 marks] By sketching the graph of f(x), or otherwise, explain these results. [4 marks] Perform two Newton-Raphson iterations (in exact arithmetic) for the function f(x) = x 1/(x + 1), with x0 = 1. Suppose that the second iteration is modified as follows: x2 = x1 f(x1) f 0 (x0) . Examine |x2 x2|/|x2| to estimate the relative loss of accuracy if the modified method is used. [5 marks] Although x2 is obviously less accurate than x2 in general, explain briefly why this modified Newton method is more useful for an n-dimensional problem. [4 marks] 11 Specification and Verification of Hardware Discuss the problems of providing tractable models of transistors suitable for hardware verification by formal proof. Compare and contrast at least two different models. Illustrate your discussion with concrete examples of transistor circuits. [20 marks] 6 CST.94.9.7 12 Semantics of Programming Languages State the Tarski-Knaster fixed-point theorem. Give a brief justification for the importance of the fixed-point theorem in denotational semantics. [8 marks] Prove that the least fixed-point operator fix is a continuous function. You may assume the following result: Let hD, vi be a complete partial order. Every doubly-increasing chain hdij ii,j in D (i.e. for any i, j, i0 , j0 in , if i 6 i 0 and j 6 j 0 then dij v di 0j 0 ) has a least upper bound l. Further, l = G i G j dij = G j G i dij = G k dkk [12 marks] 13 Types Describe the types and terms of the second-order lambda calculus (2) and define the type assignment relation for 2. [5 marks] Are the following expressions typeable in 2? Justify your answer in each case. L = ..x : ..f : .g : .fx R = ..y : ..f : .g : .gy S = .x : .x(x) [5 marks] Find a type that makes the following expression typeable in 2 and give, with justification, the type of C. C = ...f : .g : .z : .(zf)g [5 marks] Explain what is meant by -reduction and -normal form for 2 terms. Calculate the -normal form of the term Cfg(LM) where C and L are as above, , , are type variables, f, g are identifiers, and M is a term in -normal form with no free identifiers or free type variables. [5 marks] 14 Computational Number Theory Describe the elliptic curve method for factorising integers. [7 marks] Derive an estimate, using a heuristic argument, for the expected running time of this method.
An appropriate structure for large-scale distributed systems is as multiple, independently administered, firewall-protected, domains. Examples are a national health service, a national police service and a global company with worldwide branches. Communication must be supported within and between domains and external services may be accessed. For example, health service domains may all access a national Electronic Health Record service; police service domains may all access a national Vehicle Licensing service. (a) (i) Define publish/subscribe communication. [3 marks] (ii) What are the advantages and disadvantages of offering publish/subscribe as the only communication service? [7 marks] (b) (i) Define role-based access control. [3 marks] (ii) What are the advantages and disadvantages of using role names for access control and communication? [7 marks] Illustrate your discussions by means of examples.
Depict the activity of stand by() and notifyAll(). Guarantee that your response makes sense of when locks are obtained and delivered. (b) A future is a system to store the possible consequence of a calculation done in another string. The thought is that the calculation is run nonconcurrently and the calling string possibly impedes on the off chance that it attempts to utilize an outcome that hasn't been processed however. A model program utilizing a future is displayed beneath. @Abrogate public String execute() { // ...long running calculation... bring information back; }; // ... String result = f.get();//blocks if execute() incomplete Use stand by() and notifyAll() to give an execution of the Future class that would work with the model program above. [10 marks] (c) Give one possible benefit and one expected hindrance of utilizing advise() rather than notifyAll(). [2 marks] (d) Would it have been advantageous to utilize advise() rather than notifyAll() in your execution? Legitimize your response. [3 marks] 7 (TURN OVER) CST.2016.3.8 7 Prolog In this question you ought to guarantee that your predicates act suitably with backtracking and keep away from over-utilization of cut. You ought to give an execution of any library predicates utilized. it is alrightYou may not utilize extra-intelligent inherent predicates like findAll. Minor syntactic mistakes won't be punished. (a) Explain the activity of cut (!) in a Prolog program. [2 marks] (b) Rewrite pick without utilizing cut. [2 marks] choose(0,_,[]) :- !. choose(N,[H|T],[H|R]) :- M is N-1, choose(M,T,R). choose(N,[_|T],R) :- choose(N,T,R). (c) Explain the activity of not (likewise composed as \+) in a Prolog program. [1 mark] (d) Rewrite chooseAll without utilizing not and cut (!). [10 marks] chooseAll(N,L,Res) :- chooseAll(N,L,[],Res). chooseAll(N,L,Seen,Res) :- choose(N,L,R), not(member(R,Seen)), !, chooseAll(N,L,[R|Seen],Res). chooseAll(,,Res,Res). (e) What is Last Call Optimization and for what reason is it advantageous? [3 marks] (f ) Rewrite pos to empower Last Call Optimization. [2 marks] pos([],[]). pos([H|T],[H|R]) :- H >= 0, pos(T,R). pos([H|T],R) :- H < 0, pos(T,R). 8 CST.2016.3.9 8 Software Engineering Examine the commitment and the general worth of the accompanying parts of the advanced improvement climate. Show with models from your gathering project, or from experience you acquired working for a business programming engineer, or both. In each case, would you dispose of this component on the off chance that your boss let you, or demand holding it (indeed, even secretively) should your boss not esteem it? Make sense of your reasons. (a) Dividing a task into short improvement episodes or runs. (b) Project progress representation devices, for example, PERT and GANTT diagrams. (c) Automated relapse testing apparatuses. (d) Source code the board instruments.
Show how the implementation could be extended to derive a sub-type of T with an extra method, try, which works like wait but returns a BOOLEAN value instead of blocking. In the normal case, try should return TRUE but when the thread would have been suspended, the value in the semaphore is left unchanged and it should return FALSE. [5 marks] 4 Compiler Construction Construct the characteristic finite state machine for the following grammar. S A B eof A A B | B a B (A) | b [6 marks] Explain what is meant by the FOLLOW set for a non-terminal symbol in a grammar, and derive the FOLLOW sets for A and B in the above grammar. [4 marks] Construct, with explanation, the SLR(1) action and goto matrices for the above grammar. [5 marks] Illustrate how the SLR(1) parsing algorithm works for this grammar by showing the successive states of the parser stack and input stream while parsing b a b ( b a ) eof [5 marks] 3 [TURN OVER CST.95.10.4 5 Data Structures and Algorithms For each of the following situations identify one data structure or algorithm that it would be sensible to use, and another that would in principle achieve the desired result but which would have significant disadvantages. You may identify standard methods by name and need not describe in detail how they work, but should make it clear what properties the schemes that you identify have that make some of them more appropriate than others. (a) You need to represent some (directed) graphs where when a graph has N vertices it will have around N log N edges. The number of vertices, N, may become quite large. [4 marks] (b) In the process of rendering a graphical image you have already sorted all the objects that have to be drawn with an ordering based on their distance from the viewpoint. Now the image has been changed slightly so that you can start to display the next frame of the video sequence, so all the distances have changed, and you need to sort the objects again. [4 marks] (c) You need to build a table. It will be possible to insert objects into the table or retrieve previously stored ones. The only operation you are permitted to perform on objects is a pair-wise comparison that can tell if two objects are equal and if not indicates an ordering between them. There will be both plenty of insertion operations and plenty of lookups. [4 marks] (d) You need to find the shortest distance (through a directed graph that has lengths associated with each edge) from a nominated source point A to each of a collection of destinations {Bi}. [4 marks] (e) Blocks of material, each identified by a key, are to be stored on a large disc. From time to time new blocks (and associated keys) will need to be added, but mostly you need to service requests where a user submits a key and wants the corresponding information recovered. There is so much data that the disc is fairly full. [4 marks] 4 CST.95.10.5 6 Data Structures and Algorithms A reasonable approximation for the average number of probes to insert a new entry into an open hash table where a fraction of the table is already in use is 1/(1). Suppose that data is stored by initially creating a really tiny hash table (say a vector of size just 8). Entries are added to the table from time to time. Whenever the table becomes 3/4 full a new hash table, twice the size, is created: all existing data is taken out of the old table, and inserted instead into the new one. Thus in general the table that is in use will be between 3/8 and 3/4 full, and looking things up in it will be efficient. Although the above method has good predicted costs for retrieving information stored in the table, there remains some worry that the repeated cost of copying data from smaller to larger tables may be excessive. Suppose that at some stage N items have been inserted and that the very last insertion provoked the copying step. Estimate the ratio between the total number of hash probes performed while building the table and N. How does it compare with the number that would have been used if the table had been built full-sized to start with rather than having to grow stage by stage on the way? [20 marks] [If you really need their values, you may assume that ln(2) = 0.7, ln(3) = 1 and ln(5) = 1.6, but note that you are not expected to perform any arithmetic tedious enough to call for a calculator: a reasonable estimate (for example to within a factor of 1.5) and a justification of how that value was arrived at is what is required.]
grand debate is being planned by a society that has among its members a large number of computer professionals and working programmers. The motion to be put is "That the languages C and C++ should be consigned to outer darkness and their use banned in all serious computer projects". Prepare as your answer to this question a briefing document that could explain to people intending to attend the debate what the major points both for and against C and C++ will be, and the lines of arguments that are liable to be used to show how important they are. You are not required to come down either in favour of or against the languages (but may if you wish). [20 marks]
What varieties of information might an automatic journey agent want to represent? [5 marks] Using the automated travel agent for instance, outline 5 issues linked with knowledge representation. [10 marks] Would an expert system be a appropriate technique for imposing an automated journey agent? [5 marks] 7 Neural Computing Illustrate how stochasticity can be used in synthetic neural networks to clear up, at least in an asymptotic feel, problems that could in any other case be intractable. Name at least two such stochastic engines, describe the role of stochasticity in each, and perceive the styles of problems that such synthetic neural gadgets seem able to resolve. [10 marks] Illustrate the proof for stochasticity in natural fearful structures, and comment at the role that it'd play in neurobiological feature. What is the case helping John von Neumann's deathbed prediction that stochasticity might be a computational engine for the nervous device, instead of simply random noise? Describe at least one experiment regarding neural tissue in help of this theory. [10 marks] 8 Database Topics Describe the simple architecture of the ODMG-93 trendy for Object Database Management. [5 marks] In what manner do those proposals permit database management to be included with Object-Oriented Distributed Programming? [3 marks] Explain the houses of collection types, taking care to differentiate between literals and items. [6 marks] Describe how an SQL-compatible query language may be defined in the ODMG fashionable. What provision may be made for insertion, replace and deletion?
[2:29 PM, 4/11/2022] fridahkathambi71: Draw a FST which perceives the join - ly connected with normal verb modifiers in English. Exhibit that your FST accurately handles cases, for example, splendid splendidly, basic just, senseless sillily and fabulous breathtakingly. [9 marks] (d) regarding phonetic peculiarities, which parts of the morphology of modifiers does your FST neglect to accurately deal with? Would these issues be able to be fixed with a more elaborate FST, or would they say they are general issues with FST?
(b) Why is the JPEG2000 picture pressure convention such a great deal better compared to the unique JPEG in conveying great outcomes even at extreme pressure rates? What are the fundamental distinctions in the premise capacities or coding wavelets utilized, what remaking ... [11:07 PM, 4/11/2022] fridahkathambi71: A puzzle, or one-person recreation, can be represented in ML via two features: a subsequent-kingdom feature, which maps a state to a listing of feasible subsequent states, and
a wins characteristic, which returns genuine if the given state counts as a win. A easy instance is a puzzle that has states including advantageous integers, a nextstate feature that maps n to [n+ 2, n+ 5], and a "wins" feature that returns genuine if n = 10. We can win if we start from n = 2 but not from n = 7. (a) Code a polymorphic datatype 'a puzzle, to represent a puzzle by means of the pair of a next-kingdom feature and a wins function. [2 marks] (b) Briefly assessment intensity-first search, breadth-first search and iterative deepening as strategies for fixing such puzzles. [6 marks] (c) Write a characteristic intensity that accepts a puzzle, a kingdom and a depth limit. It have to use intensity-first seek to determine whether the puzzle can be solved from the given country in the given depth restrict. [6 marks] (d) Write a characteristic breadth that accepts a puzzle and a kingdom. It ought to use breadth-first search to determine whether the puzzle can be solved from the given nation. [6 marks] All code ought to be defined certainly. You may count on that any essential ML information structures or capabilities are to be had. 4 CST.2008.1.Five SECTION C 7 Operating Systems (a) What is record metadata? [2 marks] (b) Explain with the aid of a diagram how document metadata is controlled in: (i) the Unix document-gadget; [4 marks] (ii) the FAT32 file-gadget; [4 marks] (iii) the NTFS file-device. [4 marks] (c) A researcher suggests the usage of non-unstable flash reminiscence to shop the NTFS log report. He believes this can enhance performance, reduce electricity intake and make the gadget greater resilient to failure. Is he proper? Briefly justify your answer in each case. [2 marks each] eight Operating Systems (a) In fashionable we will keep in mind a process to transport among 5 method states at some stage in its lifestyles. Discuss, with the aid of a diagram, the instances in which a manner will input or go away each of these states. [6 marks] (b) Both Unix and Windows NT use dynamic precedence scheduling. Compare and assessment their scheduling algorithms, with a selected attention on how dynamic priorities are controlled. [8 marks] (c) Which statistics systems might you operate if implementing a dynamic priority scheduling algorithm? Justify your solution. [2 marks] (d) Some industry predictions suggest that during less than five years we shall have chips with hundreds or maybe lots of CPUs on them. What types of scheduling algorithms do you think could be appropriate for such systems? What problems do you foresee?
Write java program that takes each n (as enter) and n integer inputs and add the given values to a defined array
(a) Show how you'll create a Java array of a thousand integer values. [1 mark] (b) The values in an array could be used to symbolize digits in the decimal representation of quite a number. For example, the number 1 7 has decimal illustration 0.142857 . . . And that might be saved in an array whose elements commenced 1, 4, 2, . . .. For various saved that manner write code that multiplies the variety by a given integer, returning the entire wide variety a part of the end result and leaving the array up to date to maintain the fractional part of the product. [5 marks] (c) To convert a fraction to a illustration base 16 (i.E. Hexadecimal) you could multiply it by means of 16, and the resulting integer element is the primary digit of the bottom-sixteen representation. Multiplying the fraction left over by way of sixteen receives the second one digit and so on. Write a method that accepts an array of digits (base 10) and creates and returns a brand new array representing the identical fraction but now base sixteen. Your code need to paintings for any duration input array, now not simply one of period one thousand, and you could make the output array have the identical length as your enter array. [6 marks] (d) Suppose the enter in your method in component (c) become of length 1000 and began off with the decimal digits of 1 7 in it. Although the initial digits within the output array are the proper hexadecimal representation of 1 7 the last few become looking ordinary. Explain. [3 marks] (e) One manner to make sure that numerical results are correct is to apply c language arithmetic. A cost is represented as a couple of arrays, one representing a wide variety less than (or identical to) the genuine fee and one a value more than it. So if using 6 decimal locations the #1 7 might be held as a pair 142857, 142858. If the two final digits range through at most 1 then the smaller of them may be considered as absolutely accurate. Using this concept, write code that accepts a fraction in decimal form and returns a vector denoting the equal fee in any other base n (now now not always sixteen) such that all the digits within the end result vector are correct. Clarity to your code is to be desired to performance, but in case you are privy to precise methods wherein the code you gift is specially inefficient, you ought to notice and give an explanation for them. [5 marks] 6 CST.2008.1.7 10 Programming in Java The following is one of the examples from the Foundations of Computer Science route: exception Change; fun alternate (until, zero trade ([], amt) = improve trade (c::until, amt) = if amt<0 then raise change else (c :: change(c::till, amt-c)) handle> change(until, amt); (a) Define a Java elegance of your own (i.E. Do no longer use any library elegance that you may be aware of) to represent related lists of integers. Provide it with methods that may be used to reverse a list and to append two lists. Comment on whether your design has led you to make the techniques for append and reverse static. [7 marks] (b) Prepare a method known as alternate that works within the identical way because the ML code shown above. Provide the elegance which you outline it in with a primary method that makes use of it to attempt to make trade for 73p using 2p, 5p and 20p cash, printing the result well. [7 marks] (c) If you have got lists of non-zero integers such that all the values in them are much less than 256 and you have at maximum 8 gadgets in any listing you could p.C. Eight eight-bit fields into a unmarried 64-bit "long". That offers a representation that a few humans would possibly assume to be quicker than using lists represented through chained up instances of a class. Re-paintings your trade-giving code primarily based at the above idea, and modelling using exceptions with the aid of making the trade characteristic go back -1L in the extremely good case.
An inertial navigation set has a mean time to failure of 1000 hours. If an aircraft is fitted with two of them to increase reliability, is the mean time to failure of both systems which is experienced in practice likely to be several thousand hours or about a million hours? Give a brief justification for your answer. (r ) Outline the key principles of loop design, considering the simple case of a while loop.
In an edge triggered flip flop, explain what is meant by (a) hold time (b) setup time (c) delay from clock edge to output [3 marks] What relation should hold between two of these quantities to provide sensible behaviour and why? [5 marks] Comment on the possibility and desirability of negative hold times. [2 marks] Each of the following boolean functions is a function of the four variables w, x, y, z. The functions are not totally specified and may take on any value for certain inputs. fn indicates where the function must be true, while gn is true where the value of the function is not constrained. Draw maps and provide a minimum sum of products form for each of the functions. (a) f1 = wxyz + wxyz + wxyz + wxyz + wxyz + wxyz g1 = wxy z + wxyz (b) f2 = wxyz + wxyz + wxyz + wxyz + wxyz + wxyz + wxyz + wxyz + wxyz g2 = wxy z + wxyz [5 marks] Let f(x0, x1, . . . , xn1) be equal to 1 if and only if exactly k of the variables have the value 1. How many prime implicants does this function have? [5 marks] 4 CST.99.2.5 SECTION C 4 Probability A B Each of the five switches in the above circuit is closed with probability p, independently of all the other switches. What is the probability of there being a connection from A to B? Express the answer as a polynomial in p. [7 marks] The circuit is then modified to the version shown below, the five switches still being independent. What is the probability of there being a connection from A to B now? Again express the answer as a polynomial in p. [13 marks] A B 5 Probability A solitaire game is played with two coins. One coin is fair, so that P(heads) = 1 2 , and the other is biased so that P(heads) = p. At the first turn the player tosses the fair coin. At all subsequent turns the biased coin is used if the toss at the previous turn resulted in heads and the fair coin is used if the toss at the previous turn resulted in tails. Suppose un is the probability of obtaining heads at turn n. Show that, for n > 1: 2un + (1 2p)un1 = 1 [4 marks] Demonstrate that this difference equation also holds for the case n = 1 provided u0 is suitably defined. [2 marks] Solve the difference equation, expressing un in terms of n and p. [14 marks] 5 [TURN OVER CST.99.2.6 SECTION D 6 Professional Practice and Ethics What is the nature of privacy and how do EU guidelines and/or British legislation serve to protect privacy? [20 marks] 7 Regular Languages and Finite Automata Suppose that L is a language over the alphabet {0, 1}. Let L 0 consist of all strings u 0 over {0, 1} with the property that there is some string u L with the same length as u 0 and differing from u 0 in at most one position in the string. Show that if L is regular, then so is L 0 . [Hint: if Q is the set of states of some finite automaton accepting L, construct a non-deterministic automaton accepting L 0 with states Q {0, 1}, where the second component counts how many differences have been seen so far.] [10 marks] If a deterministic finite automaton M accepts any string at all, it accepts one whose length is less than the number of states in M. Explain why. [5 marks] State Kleene's theorem about regular expressions and deterministic finite automata. [2 marks] Describe how to decide for any given regular expression whether or not there is a string that matches it. [3 marks] 8 Software Engineering I State the advantages of the waterfall model. [10 marks] State the disadvantages of the waterfall model. [4 marks] What is the main criterion for deciding whether or not to use the waterfall model in a software development project? [3 marks] Explain whether there would be any difference for a hardware development project. [3 marks] 6 CST.99.2.7 9 Software Engineering II A Web browser is a complicated program. It must deal with many types of data (images, sound, etc.), support various network services and handle the many constructs of HTML (the language in which Web pages are written). Your manager asks you to lead a small group of programmers in implementing a Web browser. Describe top-down refinement; is it appropriate for your task? Your manager further states that it is essential that your browser should almost never crash. How would you go about meeting this requirement? [6 marks] Consider the following two ML functions: fun sumfiv [] = 0 | sumfiv (x::xs) = 5*x + sumfiv xs; fun summing z [] = z | summing z (x::xs) = summing (z + x) xs; Use structural induction to prove that sumfiv xs can be replaced by 5 * summing 0 xs. [8 marks] 10 Structured Hardware Design A design is required for an electronic system to collect votes from the audience in a television game show. Each of up to 1000 seats in the audience will have an audience station and there will be a master station for the floor manager. Output from the system will be video and this will feed monitor displays in the studio and be included in the broadcast programme. (a) Sketch a block diagram of the overall system, showing clearly the various units and the signals which make up the cables which run between them. [5 marks] (b) Specify the controls and indicators on the front panel of the two types of station. Give a pair of state diagrams of the system, one as seen by the audience and the other as seen by the floor manager. [5 marks] (c) Given that a profitable return on the sale of three complete systems is required, describe the components and technology that should be used in the units. [5 marks] (d) Discuss the advantages and disadvantages of including a PC inside the floor manager's station, in terms of cost, ease of use and whether a custom or standard operating system should be used.
The RSA cryptosystem can be tuned to make the workload asymmetric: with d = 3, encryption (cubing modulo n) becomes very cheap and almost all the computational expense shifts to decryption (extracting cubic roots modulo n). The following public-key protocol uses the above property to allow two principals A and B to establish a common secret key Nb (invented by B) without incurring a high computational load, thanks to the help of a server S who computes all the cubic roots in the protocol. Attackers are assumed to be able to overhear, but not alter, the messages between A, B and S. A S : B, N3 a mod n. S B : A. B S : A, N3 b mod n. S A : B, Na Nb. (a) What is the purpose of Na? [3 marks] (b) Describe in detail a protocol attack that will allow two colluding attackers C and D to recover Nb. Assume that S is stateless. [7 marks] (c) Stop the attack you described in (b) by making S stateful. [3 marks] (d) Describe in detail a more sophisticated protocol attack whereby the colluding attackers will recover Nb even if S adopts the precaution you described in (c). [4 marks] (e) Fix the protocol to defeat the attack you described in (d). [3 marks] 13 (TURN OVER) CST.2012.7.14 13 Temporal Logic and Model Checking In the following program, called INC, (*) is a Boolean expression that evaluates non-deterministically to either true or false each time it is evaluated (different evaluations may yield different results). N := 1; WHILE (*) DO N := N+1; N := 0; (a) Devise and carefully describe a state space and transition relation to model this program. [8 marks] (b) Devise temporal logic formulae that express properties (i), (ii) and (iii) below. In each case state which temporal logic you are using and explain whether the property is true in your model. (i) Every execution of INC terminates. [4 marks] (ii) Some execution of INC terminates. [4 marks] (iii) If INC terminates, then N = 0 holds in the terminating state. [4 marks] 14 CST.2012.7.15 14 Topical Issues (a) Describe the operating principles of RFID systems based on capacitive, inductive and backscatter coupling. Give typical operating ranges and at least one example application for each. [9 marks] (b) Electronic passports contain RFID chips to permit electronic transfer of biometric data to a reader. The systems in use today use remote-coupling with an operating frequency of 13.56 MHz. The full communication protocol varies, but every transmission from the passport is prefaced with a numeric identifier (UID). (i) The first implementations used a static UID unique to each passport, whilst later implementations generated a new pseudo-random UID for each round of communications. Outline the risks and practicalities of each approach. [3 marks] (ii) Biometric data are usually encrypted when sent between reader and tag using a protocol known as Basic Access Control (BAC). The shared session key is generated solely from the owner's passport number (9 digits), passport expiry date and date of birth. These data must be read optically by swiping the passport through a desktop device before proceeding. Comment on the security of this system and the choice of 13.56 MHz RFID in such a context. [4 marks] (iii) Most authorities now line the passport sleeve with metal foil. Explain how this increases security and discuss the extent to which it does so.
A permutation of a list is any list that can be derived from it by re-arranging the elements. Write an ML function that returns the list of all the permutations of its argument. Explain your code clearly and carefully. For example, applied to the list [1,2,3], your function should return the list whose elements are [1,2,3], [2,1,3], [2,3,1], [1,3,2], [3,1,2] and [3,2,1]. You may assume that the elements of the argument are distinct. The elements of the result may appear in any order. [10 marks] 2 Discrete Mathematics Let Mn = 2n 1 be the n th Mersenne number. Show that Mn can be prime only if n is. [5 marks] Let m = m(m + 1)/2 be the mth triangular number and recall that a perfect number is one equal to the sum of its factors (including 1 but excluding the number itself). Suppose that p = Mn is prime. Show that p is a perfect number.
In a large project it is possible that two programmers, working on different parts of the code, happen to select the same name for something that they define. If this accident leads to some third programmer accessing the wrong one of these two versions the results could be unsatisfactory. Explain the steps that the designers of the Java language have taken to reduce the probability of such clashes. [10 marks] 4 Operating Systems An operating system uses a single queue round-robin scheduling algorithm for all processes. You are told that a quantum of three time units is used. What can you infer about the scheduling algorithm? [1 mark] Why is this sort of algorithm suitable for a multi-user operating system? [1 mark] The following processes are to be scheduled by the operating system. Required Process Creation Time Computing Time P1 0 9 P2 1 4 P3 7 2 None of the processes ever blocks. New processes are added to the tail of the queue and do not disrupt the currently running process. Assuming context switches are instantaneous, determine the response time for each process. [6 marks] Give one advantage and one disadvantage of using a small quantum. [2 marks]
Write program that will read data from a file. The program will allow the user to specify the filename. Use a loop that will check if the file is opened correctly, otherwise display an error message and allow the user to re-enter a filename until successful.
In the Discrete Mathematics course you learned that RSA encryption involved having a public key (N, e) where N is the product of two secret primes P and Q and e is an exponent. To encrypt a message that is represented by a number m you just compute me mod N. The Java BigInteger class contains (among others) methods called add, subtract, multiply, divide and remainder. The class String has a method charAt that allows you to extract a character at a given position, and length to tell you how long the string is. Casting a character to an integer yields its character code. Supposing you are given a BigInteger that represents N and an integer for e, and not using any built-in Java methods for raising numbers to powers, write code that (a) takes a string and encodes it as an integer; if the string contains characters c0, c1 . . . the integer required will be c0 + Kc1 + K2 c2 + with the constant K set to 216 so that the full Unicode character set can be accommodated; [7 marks] (b) encodes this number (assuming it is less than N) using the RSA method;
Programming languages are usually compiled into the machine code of the target computer, but sometimes an interpretive system is used. Discuss the relative merits of these two approaches. [7 marks] Outline the key features of the design of an interpretive code that would be suitable for an implementation of the C programming language and describe the overall structure of an interpreter for it. [7 marks] What techniques could be used to improve (a) the space efficiency, and (b) the time efficiency of interpretive codes? [6 marks] 8 Prolog for Artificial Intelligence Describe how lists that are represented by difference lists may be concatenated (or "appended") in constant time. [6 marks] Define a procedure rotate(X,Y) where both X and Y are represented by difference lists, and Y is formed by rotating X to the left by one element. [14 marks] 3 [TURN OVER CST.96.13.4 9 Databases The international conference Extending Data Base Technology has arranged its next meeting in Avignon at the end of March, to coincide with the spring migration through the Camargue. Birders expect to add significant new sightings to the list of birds seen during a major database conference. Delegates have been arguing for over a decade about the best relational model for the data. It is agreed that the following information should be recorded: the names of the major avifaunal regions: nearctic, western palarctic, Australasia etc. for each birding delegate, a level of competence on a scale [1..5] within each avifaunal region good bird sites within each region (including all those visited during conferences), specifying the various habitat types occurring within each site observations made - by an observer, on a date, in a habitat type at some site, of a species belonging to a particular family of birds Advise the delegates on a suitable relational schema for this database. [16 marks] Explain what would be involved in processing the following queries in SQL. (a) What species of the kingfisher family have been observed both in a waterside habitat and in arid grassland? [2 marks] (b) Which delegate is recorded as having observed the greatest number of distinct species? [2 marks] 10 Natural Language Processing Describe three significant differences between programming languages and natural languages. [8 marks] What problems do these differences pose for attempts to construct programs that "understand" a natural language? [12 marks] 4 CST.96.13.5 11 Introduction to Functional Programming Give a short explanation (illustrated with examples) of each of the following features of ML: (a) higher order functions [4 marks] (b) polymorphism [4 marks] (c) datatypes [4 marks] (d) pattern matching [4 marks] (e) exceptions [4 marks] 12 Computer Vision Using appropriate mathematical expressions, define the following operations commonly used in computer vision and briefly explain their function and applications: (a) convolution [4 marks] (b) correlation [4 marks] (c) bandpass filtering [4 marks] (d) edge detection by second-derivative zero-crossings [4 marks] (e) invariant transform [4 marks] 13 Complexity Theory One version of the algorithm that uses discrete Fourier Transforms when multiplying integers uses modular arithmetic for much of its internal working. The modulus involved will be chosen to be one greater than a power of two. Explain why this is the case, what power of two is involved, how this relates to the number of digits in the numbers being multiplied and how the basic operations of modular arithmetic are performed. Does it matter that the modulus used is usually not a prime number?
kindly answer all the questions
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi