CUSTOMER_CODE SMUDE DIVISION_CODE SMUDE EVENT_CODE SMUAPR15 ASSESSMENT_CODE MC0080_SMUAPR15 QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 3528 QUESTION_TEXT Write a note on NIM game and marienbad game. SCHEME OF EVALUATION The game of nim is very simple to play and has an interesting mathematical structure……..The positions which are not losing ones are called winning. (4 marks) Marienbad is a variant of a nim game and it is played with matches. The rules of this game are similar to the nim and given below: 1.It is a two-player game. 2.It starts with n matches 3.The winner of the game………loses the game 4.On the very first turn, upto n-1 matches can be taken by the player having the very first move. 5.On the subsequent turns,……..in the last move. At any stage, the following two numbers are significant: i.The total number of match sticks available, after picking up by the players so far. ii.The number of match sticks that the player having the move can pick up We call the orders pair a state in the game, while i.The number of sticks available j.The number of sticks that can be picked, by the player having the move according to the rules. (6 marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 3529 QUESTION_TEXT Write the advantages of theoretical approach over empirical approach in executing an algorithm. SCHEME OF EVALUATION 1.The approach does not depend on the programming language in which the algorithm is coded and on how it is coded in the language. (2 Marks) 2.The approach does depend on the computer system used for executing the algorithm. (2 Marks) 3.In case of a comparatively inefficient algorithm, which ultimately is to be rejected, the computer resources and programming efforts which otherwise would have been required and wasted, will be saved. (2 Marks) 4.Instead of applying the algorithm to many different-sized instances, the approach can be applied for a general size say n of an arbitrary increase of the problem under consideration. In the case of theoretical approach, the size n may be arbitrary large. In empirical approach, because of practical considerations, only the instances of moderate sizes may be considered. (4 Marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 74065 QUESTION_TEXT Explain the concept of Breadth-First Search with algorithm. Algorithm of Breadth First Search SCHEME OF EVALUATION for each vertex u є V – {s} status[u] = unknown status[s] = discovered enqueue (Q, s) while (empty[Q]! = false) u = front[Q] for each vertex v є Adjacent to u if status[v] = unknown status[v] = discovered parent (v) = u end for enqueue (Q, v); dequeue (Q) status[u] = visited print “u is visited” end while The algorithm works as follows. Lines 1-2 initialize each vertex to ‘unknown’. Because we have to start searching from vertex s, line 3 gives the status ‘discovered’ to vertex s. Line 4 inserts the initial vertex s in the queue. The while loop contains statements from line 5 to end of the algorithm. The while loop runs as long as there remains ‘discovered’ vertices in the queue. And we can see that queue will only contain ‘discovered’ vertices. Line 6 takes an element u at the front of the queue and in lines 7 to 10 the adjacency list of vertex u is traversed and each unknown vertex u in the adjacency list of u, its status is marked as discovered, its parent is marked as u and then it is inserted in the queue. In the line 13, vertex u is removed from the queue. In line 14-15, when there are no more elements in adjacency list of u, vertex u is removed from the queue its status is changed to ‘visited’ and is also printed as visited. The algorithm given above can also be improved by storing the distance of each vertex u from the source vertex s using an array distance [ ] and also by permanently recording the predecessor or parent of each discovered vertex in the array parent[ ]. In fact, the distance of each reachable vertex from the source vertex as calculated by the BFS is the shortest distance in terms of the number of edges traversed. So next we present the modified algorithm for breadth first search. (10 marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 113262 Briefly explain the following with example. QUESTION_TEXT a. Radix sort b. Bucket sort a. Explanation + Example (3+2 Marks) SCHEME OF EVALUATION b. Explanation + Example (3+2 Marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 113265 QUESTION_TEXT Briefly describe a turing machine. Definition (3 Marks) SCHEME OF EVALUATION Example (3 Marks) Explanation (4 Marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 113268 QUESTION_TEXT Explain basic actions and instructions used in a computer system. i. Assignment of a value to a variable is denoted by Variable <– expression ………………………. (4 marks) SCHEME OF EVALUATION ii. The next basic action is read values of variables i, j, etc. from some secondary storage device, the identity of which is (implicitly) assumed here, by a statement of the form …………………….. (2 marks) iii. The last of the three basic actions, is to deliver/write values of some variables say i, j etc. to the monitor or to an external secondary storage by a statement of the form …………………………. (4 marks)