A simple game works as follows. We have a board divided into n by m…
Question Answered step-by-step A simple game works as follows. We have a board divided into n by m… A simple game works as follows. We have a board divided into n by m square cells.We also have an unlimited number of L-shaped tiles, each made to cover exactlythree squares. The tiles can appear in any of the four possible orientations. Ouraim is to cover the board completely with non-overlapping tiles.(a) A single tile on the board can be described using a list such as[[1,1],[1,2],[2,1]] containing three tuples, specifying the position of eachpart of the tile on the board. Consider the following Prolog predicate, whichis true if the six variables describe a correct, L-shaped tile.tile([[A,B],[C,D],[E,F]]) :- C is A+1, D is B, E is A, F is B-1;C is A+1, D is B, E is A, F is B+1;C is A-1, D is B, E is A, F is B+1;C is A-1, D is B, E is A, F is B-1.Explain what happens in response to a query of the formtile([[4,5],[B,C],[D,E]]).Keep in mind the effects of backtracking. [2 marks](b) Write Prolog predicate goodplace([[A,B],[C,D],[E,F]],[N,M]) that istrue if [[A,B],[C,D],[E,F]] is a validly shaped tile and all of its parts liewithin an N by M board. Your predicate should behave under backtracking insuch a way that the response to a query of the formgoodplace([[10,4],[B,C],[D,E]],[10,10]).is to find the unspecified values for all tiles which have a valid shape and fallwithin the board. In this example there would be two such tiles. [6 marks](c) Write Prolog predicate tiling(Available,Solution,Size). Here, Sizeis the size of the board represented as above, Solution is a list of tilesthat solves the problem, and Available is a list of available positions on aboard of the given size. For example, if Size is [2,2] then Available is[[1,1],[1,2],[2,1],[2,2]].Your predicate should be true if the Solution given is a valid one, and shouldbe capable of finding a valid Solution in response to a query such astiling([[1,1],[1,2],…,[10,10]],X,[10,10]).Full marks will only be given for predicates that can exploit backtracking tofind all possible solutions. [12 marks]7 [TURN OVERCST.2003.6.88 Databases(a) Define the ACID properties of a transaction. [6 marks](b) Define what is meant by strict two-phase locking (strict 2PL). [4 marks](c) Assume that in addition to traditional Read and Write actions a DBMSsupports increment and decrement actions: Inc and Dec (both are assumedto perform blind writes).Consider the following two transactions.T1 : [Inc(A), Dec(B), Read(C)]T2 : [Inc(B), Dec(A), Read(C)](i) By considering some possible schedules of the above transactions, describecarefully the concurrency permitted by strict 2PL using just shared/readand exclusive/write locks. [3 marks](ii) Detail a way to gain more interleaving whilst still maintaining strict 2PL.Image transcription textProblem(9) (8 points) Let X1, X2, …, Xes be i.i.d. randomvariables from Normal(/ = -3, 02 = 25). (a) (1 points)Compute E[-2X2 – 3X3]. (b) (1 point) Comp… Show more… Show more Engineering & Technology Computer Science ELE 486 Share QuestionEmailCopy link Comments (0)


