(a) Write a Java implementation of the server, using a single…

Question Answered step-by-step (a) Write a Java implementation of the server, using a single… (a) Write  a Java implementation of the server, using a single thread to serveeach client in turn. You may assume the existence of a static methodprocessBookings, which accepts a list of new bookings from a specified clientand returns a list of bookings to be sent back to the client. You may assumesuitable accessor methods for Message and Booking; you do not need to handleexceptions. [8 marks](b) The programmer decides to extend the booking system with vector clocks.(i) Write down a suitable data structure for a vector clock in Java. [2 marks](ii) Describe in words how the system can be modified to incorporate vectorclocks and allow clients to compute a partial order of Message objects.Discuss how vector clocks are initialised and updated. [6 marks](iii) The programmer wants to use vector clocks to determine which bookingoccurred first, allowing clients to mark any subsequent bookings as inconflict and therefore cancelled. Describe when the vector clock algorithmcannot determine which booking is first, how this is detected, and proposea solution which resolves the ambiguity. Why is it important for the theory of computation that the functions involvedin the coding and decoding given in part (a) are themselves register machinecomputable? (You are not required to prove that they are computable.)[2 marks](d) Define what it means for a set of numbers S ? N to be register machine decidable.[2 marks](e) Let ?e ? N*N denote the partial function of one argument computed by theregister machine with program prog(e). Prove that {e ? N | ?e = one} isregister machine undecidable (where one is the function mentioned in part (b)).State carefully any standard results that you use in your proof. [4 marks]4CST.2014.6.54 Computation Theory(a) Give the recursion equations for the function ?n(f, g) ? Nn+1 ? N defined byprimitive recursion from functions f ? Nn ? N and g ? Nn+2 ? N. [2 marks](b) Define the class PRIM of primitive recursive functions, giving exact definitionsfor all the functions and operations you use. [5 marks](c) Show that the addition function add(x, y) = x + y is in PRIM. [2 marks](d) Give an example of a function N2 ? N that is not in PRIM. [3 marks](e) The Fibonacci function fib ? N ? N satisfies fib(0) = 0, fib(1) = 1 andfib(x + 2) = fib(x) + fib(x + 1) for all x ? N.(i) Assuming the existence of primitive recursive functions pair ? N2 ? N,fst ? N ? N and snd ? N ? N satisfying for all x, y ? Nfst(pair (x, y)) = x ? snd(pair (x, y)) = yprove by mathematical induction that any function g ? N ? N satisfyingg(0) = pair (0, 1)g(x + 1) = pair (snd(g(x)), fst(g(x)) + snd(g(x)))for all x ? N, also satisfies?x ? N(fst(g(x)) = fib(x) ? snd(g(x)) = fib(x + 1)).[4 marks](ii) Deduce that the Fibonacci function fib is in PRIM. [4 marks]5 (TURN OVER)CST.2014.6.65 Logic and Proof(a) Proof methods for propositional logic include the sequent calculus, DPLL andBDDs. Describe briefly each of these methods. State, with reasons, whichmethod is to be preferred for a problem that makes heavy use of the ? and ?symbols. (Note that ? denotes exclusive or.) [7 marks](b) Describe briefly the procedure for constructing a BDD, illustrating your answerusing the formula ((P ? Q) ? R) ? (P ? (Q ? R)).[7 marks](c) Consider the following set of n + 1 propositional formulas, where n ? 0:Pi ? Pi+1 (for i = 1, . . . , n)P1 ? Pn+1Describe a possible execution of the DPLL procedure to determine whether thisset is satisfiable or not. [6 marks]6CST.2014.6.76 Logic and Proof(a) Describe briefly the concept of a decision procedure, listing at least threeseparate examples of decidable theories. [4 marks](b) Outline the basic ideas behind Fourier-Motzkin variable elimination, demonstrating them with reference to the following small set of constraints:x + 2y ? 10 x + z ? 5 y ? 3 z ? 2 ? 0[6 marks](c) Call a clause positive if it consists of positive literals only. Negative selectionis a refinement of resolution where two clauses can be resolved only if one ofthem is positive; if a clause contains any negative literals, then only one of thosemay be resolved with a literal in another (necessarily positive) clause. Negativeselection reduces the number of combinations of literals to be compared, therebyimproving performance. Consider the following set of clauses:{R(0), R(1)} {P(h(z)), ¬R(z)} {¬P(x), ¬R(y)}.With negative selection, the first resolution step must involve {R(0), R(1)}, asno other positive clauses are available at the start.(i) If a set of clauses includes no positive clauses, can it be unsatisfiable?Justify your answer. [3 marks](ii) Use resolution with negative selection to derive a contradiction from theclauses above. [7 marks]7 (TURN OVER)CST.2014.6.87 Mathematical Methods for Computer Science(a) Using complex exponentials, prove the following trigonometric identity, whichdescribes the multiplicative modulation of one cosine wave by another as beingsimply the sum of a different pair of cosine waves:cos(ax) cos(bx) = 12cos((a + b)x) + 12cos((a ? b)x)(a) In a Linux shell session, you can see the following information:$ ls -ladrwxr-xr-x 2 root root 4096 Jun 3 13:29 .drwxr-xr-x 25 root root 4096 Jun 3 13:29 ..-rwxr-xr-x 1 root root 4675 Jun 3 13:29 script.plConsider how you need to change the file access-control information shown abovein order to achieve the following additional goals:• Only members of the group staff who are not also members of the groupinterns can execute script.pl.• When script.pl is called, it should be able to switch between using theaccess privileges of the caller and those of the user primary.• All members of group staff should be able to read the contents ofscript.pl.What would “ls -la” output after you have applied these changes? [6 marks](b) Sending a password over a network connection is vulnerable to replay attacksby eavesdroppers. Briefly describe three other forms of unilateral (or one-pass)authentication suitable for human keyboard entry that reduce that risk with thehelp of a hardware token, and name one advantage of eacImage transcription text1. Implement one of the algorithms youstudied in class in a language of yourchoice. The problem shou… Show more… Show moreImage transcription text(c – 10pts) Identifying partial, strict, andtotal orders. For the relation, indicatewhether it is a partial orde… Show more… Show more  Computer Science Engineering & Technology Networking CPSC MISC Share QuestionEmailCopy link Comments (0)