Question 1
A bag contains 10 blue marbles, 20 green marbles and 30 red marbles. A marble is drawn from the bag, its colour recorded and it is put back in the bag. This process is repeated 3 times. The probability that no two of the marbles drawn have the same colour is
 A 1/36 B 1/6 C 1/4 D 1/3
Probability    Gate IT 2005
Discuss it

Question 1 Explanation:
As number of colors is 3,Possible combinations -> 3! = 6 Probability of Blue  marble: 10/60 Probability of Green  marble: 20/60 Probability of Red marble: 30/60 Probability that no two of the marbles drawn have the same colour is = 6 * (10/60 * 20/60 * 30/60) = 1/6 Therefore B is the Answer
 Question 2
If the trapezoidal method is used to evaluate the integral obtained 01x2dx ,then the value obtained
 A is always > (1/3) B is always < (1/3) C is always = (1/3) D may be greater or lesser than (1/3)
Numerical Methods and Calculus    Gate IT 2005
Discuss it

 Question 3
The determinant of the matrix given below is
 A -1 B 0 C 1 D 2
Numerical Methods and Calculus    Gate IT 2005
Discuss it

Question 3 Explanation:
Matrices don’t have value associated with them, but determinant have value associated with them. Determinant of a matrix can be find out by taking any one row or one column, in this row or column, multiplying each element with its cofactor and summing the value up. This solution is contributed by Sandeep Pandey.
 Question 4
Let L be a regular language and M be a context-free language, both over the alphabet Σ. Let Lc and Mc denote the complements of L and M respectively. Which of the following statements about the language Lc∪ Mc is TRUE
 A It is necessarily regular but not necessarily context-free B It is necessarily context-free. C It is necessarily non-regular. D None of the above
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 4 Explanation:
Proposition: L is a regular language M is a context free language Derivation: L_c  union M_c = complement{L intersection M} Now, L intersection M is a CFL according to closure laws of CFLs, i.e. intersection of a CFL with RL is always a CFL. But, complement{L intersection M} might not be a CFL because complement over CFL doesn't guarantee a CFL. It can even be a RL or it might even lie outside the CFL circle. It will be a context-sensitive language certainly, but nothing else can be said about it. Conclusion: Considering the above derivation, none of the statements are true. Hence correct answer would be (D) None of the above. Related article : http://quiz.geeksforgeeks.org/theory-of-computation-closure-properties-of-context-free-languages/ This solution is contributed by Vineet Purswani.
 Question 5
Which of the following statements is TRUE about the regular expression 01*0?
 A It represents a finite set of finite strings. B It represents an infinite set of finite strings. C It represents a finite set of infinite strings. D It represents an infinite set of infinite strings
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 5 Explanation:
First of all, A string can never be infinite because String is a finite sequence of symbols over Σ So option (c) and (d) are eliminated. And because of star(*) it can generate infinite set. So Option (B) is CORRECT.   This solution is contributed by Abhishek Agrawal.
 Question 6
The language {0n 1n 2n | 1 ≤ n ≤ 106} is
 A regular B context-free but not regular. C context-free but its complement is not context-free. D not context-free
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 6 Explanation:

The value of ‘n’ is finite. So, only finite number of strings can be part of given language. Therefore, we can construct a finite state automata for this language.

Thus, option (A) is correct.

Please comment below if you find anything wrong in the above post.
 Question 7
Which of the following expressions is equivalent to (A⊕B)⊕C
 A (A+B+C)(A¯+B¯+C¯) B (A+B+C)(A¯+B¯+C) C ABC+A¯(B⊕C)+B¯(A⊕C) D None
Digital Logic & Number representation    Gate IT 2005
Discuss it

Question 7 Explanation:
(A ⊕ B) ⊕ C

By Solving, We get
= (A ⊕ B)′ C + (A ⊕ B) C′

The above expression can be written as:
= (A ⊙ B) C + (A ⊕ B) C′

Now,

= (AB + A′B′) C + (A ⊕ B) C′

= ABC + A′B′C + AB′C′ + A′BC′	     [As: X + X = X]
[So, A′B′C + A′B′C = A′B′C]
= ABC + (A′B′C + A′B′C) + AB′C′ + A′BC′

This can be written as:

= ABC + A′ (B ⊕ C) + B′ (A ⊕ C)

This explanation has been provided by Saksham Seth.
 Question 8
Using Booth's Algorithm for multiplication, the multiplier -57 will be recoded as
 A 0 -1 0 0 1 0 0 -1 B 1 1 0 0 0 1 1 1 C 0 -1 0 0 1 0 0 0 (A+B+C)(A¯+B¯+C) ABC+A¯(B⊕C)+B¯(A⊕C) D 0 1 0 0 -1 0 0 1
Digital Logic & Number representation    Gate IT 2005
Discuss it

 Question 9
A dynamic RAM has a memory cycle time of 64 nsec. It has to be refreshed 100 times per msec and each refresh takes 100 nsec. What percentage of the memory cycle time is used for refreshing?
 A 10 B 6.4 C 1 D 0.64
Computer Organization and Architecture    Gate IT 2005
Discuss it

Question 9 Explanation:

Memory cycle time = 64 ns Memory is refreshed 100 times per msec.
Number of refreshes in 1 memory cycle (i.e in 64 ns) = (100 * 64 * 10-9) / 10-3 = 64 * 10-4.
Time taken for each refresh = 100 ns Time taken for 64 * 10-4 refreshes = 64 * 10-4 * 100 * 10-9 sec = 64 * 10-11 sec.
Percentage of the memory cycle time used for refreshing : = (Time taken to refresh in 1 memory cycle / Total time) * 100 = (64 * 10-11 / 64 * 10-9) * 100 = 1 %

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.
 Question 10
A two-way switch has three terminals a, b and c. In ON position (logic value 1), a is connected to b, and in OFF position, a is connected to c. Two of these two-way switches S1 and S2 are connected to a bulb as shown below. Which of the following expressions, if true, will always result in the lighting of the bulb ?
 A S1.S2' B S1+S2 C (S1⊕S2)' D S1⊕S2
Memory Management    Gate IT 2005
Discuss it

Question 10 Explanation:
If we draw truth table of the above circuit,it'll be S1     S2    Bulb 0         0       On 0         1        Off 1         0        Off 1          1         On = (S1⊕ S2)'   Therefore answer is C
 Question 11
How many pulses are needed to change the contents of a 8-bit up counter from 10101100 to 00100111 (rightmost bit is the LSB)?
 A 134 B 133 C 124 D 123
Digital Logic & Number representation    Gate IT 2005
Discuss it

Question 11 Explanation:
8 bit Counter range 0-255 To go from 10101100 (172) to 00100111 (39)
• first counter will move from 172 to 255(255-172=83)
• 255 to 0=1 pulse
• and then  0 to 39(39-0=39).
 Question 12
The numbers 1, 2, .... n are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains p nodes. The first number to be inserted in the tree must be
 A p B p + 1 C n - p D n - p + 1
Tree Traversals    Gate IT 2005
Discuss it

Question 12 Explanation:
Binary Search Tree, is a node-based binary tree data structure which has the following properties:
• The left subtree of a node contains only nodes with keys less than the node’s key.
• The right subtree of a node contains only nodes with keys greater than the node’s key.
• The left and right subtree each must also be a binary search tree. There must be no duplicate nodes.
So let us say n=10, p=4. According to BST property the root must be 10-4=6 (considering all unique elements in BST)
And according to BST insertion, root is the first element to be inserted in a BST.

 Question 13
A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i.
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?
 A 6 B 4 C 3 D 2
Stack    Gate IT 2005
Discuss it

Question 13 Explanation:

f(S) = 0, max(f(S), 0) = 0, i = 2 f(S)new = max(f(S), 0) + i = 0 + 2 = 2
f(S) = 2, max(f(S), 0) = 2, i = -3 f(S)new = max(f(S), 0) + i = 2 - 3 = -1
f(S) = -1, max(f(S), 0) = 0, i = 2 f(S)new = max(f(S), 0) + i = 0 + 2 = 2
f(S) = 2, max(f(S), 0) = 2, i = -1 f(S)new = max(f(S), 0) + i = 2 - 1 = 1
f(S) = 1, max(f(S), 0) = 1, i = 2 f(S)new = max(f(S), 0) + i = 1 + 2 = 3

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.
 Question 14
In a depth-first traversal of a graph G with n vertices, k edges are marked as tree edges. The number of connected components in G is
 A k B k + 1 C n - k - 1 D n - k
Graph Traversals    Gate IT 2005
Discuss it

Question 14 Explanation:
Tree edges are the edges that are part of DFS tree.  If there are x tree edges in a tree, then  x+1 vertices in the tree. The output of DFS is a forest if the graph is disconnected.  Let us see below simple example where graph is disconnected.   The above example matches with D option More Examples: 1) All vertices  of Graph are connected.  k must be n-1.  We get number of connected components  = n- k =  n - (n-1) = 1 2) No vertex is connected. k must be 0.  We get number of connected components  = n- k =  n - 0 = n
 Question 15
In the following table, the left column contains the names of standard graph algorithms and the right column contains the time complexities of the algorithms. Match each algorithm with its time complexity.
 1. Bellman-Ford algorithm 2. Kruskal’s algorithm 3. Floyd-Warshall algorithm 4. Topological sorting A : O ( m log n) B : O (n3) C : O (nm) D : O (n + m)

 A 1→ C, 2 → A, 3 → B, 4 → D B 1→ B, 2 → D, 3 → C, 4 → A C 1→ C, 2 → D, 3 → A, 4 → B D 1→ B, 2 → A, 3 → C, 4 → D
Analysis of Algorithms    Gate IT 2005
Discuss it

Question 15 Explanation:
• Bellman-Ford algorithm: Time complexity: O(VE)
• Kruskal’s algorithm:Time Complexity: O(ElogE) or O(ElogV). Sorting of edges takes O(ELogE) time. After sorting, we iterate through all edges and apply find-union algorithm. The find and union operations can take atmost O(LogV) time. So overall complexity is O(ELogE + ELogV) time. The value of E can be atmost V^2, so O(LogV) are O(LogE) same. Therefore, overall time complexity is O(ElogE) or O(ElogV)
•  Floyd-Warshall algorithmTime Complexity: O(V^3)
•  Topological sorting: Time Complexity: The above algorithm is simply DFS with an extra stack. So time complexity is same as DFS which is O(V+E).
 Question 16
A hash table contains 10 buckets and uses linear probing to resolve collisions. The key values are integers and the hash function used is key % 10. If the values 43, 165, 62, 123, 142 are inserted in the table, in what location would the key value 142 be inserted?
 A 2 B 3 C 4 D 6
Gate IT 2005
Discuss it

Question 16 Explanation:
43->3 165->5   62->2 123-> 3(occupied)  So acc to linear probing 3+1=4 142 ->2(occupied),3(occupied),4 (occupied) ,5 (occupied) ->6 Therefore correct Answer D
 Question 17
A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file 3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file 1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about her courses. The student executes the following sequence of commands from her current working directory
ln -s file 1 file 2
ln -s file 2 file 3
Which of the following types of information would be lost from her file system? (I) Hobbies (II) Friends (III) Courses
 A (I) and (II) only B (II) and (III) only C (II) only D (I) and (III) only
UNIX    Gate IT 2005
Discuss it

 Question 18
The shell command
find -name passwd -print
is executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?
 A ls passwd B cat passwd C grep name passwd D grep print passwd
UNIX    Gate IT 2005
Discuss it

Question 18 Explanation:

Find is a Unix (or Linux) command used for searching the files in a directory hierarchy. The syntax of find command is :
find –name “filename” –print

Grep is a unix command which can be used to find file names with a watching string. The syntax of grep command is :
grep name “filename”

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.
 Question 19
A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal handling routine executes?
 A kernel mode B superuser mode C privileged mode D user mode
UNIX    Gate IT 2005
Discuss it

 Question 20
The Function Point (FP) calculated for a software project are often used to obtain an estimate of Lines of Code (LOC) required for that project. Which of the following statements is FALSE in this context.
 A The relationship between FP and LOC depends on the programming language used to implement the software. B LOC requirement for an assembly language implementation will be more for a given FP value, than LOC for implementation in COBOL C On an average, one LOC of C++ provides approximately 1.6 times the functionality of a single LOC of FORTRAN D FP and LOC are not related to each other
Software Engineering    Gate IT 2005
Discuss it

Question 20 Explanation:
As language levels go up, fewer statements to code one Function Point are required. For example, COBOL may requires about 105 statements per Function Point and php only 67.
 Question 21
Consider the entities 'hotel room', and 'person' with a many to many relationship 'lodging' as shown below: If we wish to store information about the rent payment to be made by person (s) occupying different hotel rooms, then this information should appear as an attribute of
 A Person B Hotel Room C Lodging D None of these
Database Design(Normal Forms)    Gate IT 2005
Discuss it

Question 21 Explanation:
Lodging is the only attribute relating person and hotel room.
 Question 22
A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies   F1 → F3   F2→ F4   (F1 . F2) → F5 In terms of Normalization, this table is in
 A 1 NF B 2 NF C 3 NF D none
Database Design(Normal Forms)    Gate IT 2005
Discuss it

Question 22 Explanation:
First Normal Form A relation is in first normal form if every attribute in that relation is singled valued attribute. Second Normal Form A relation is in 2NF iff it has No Partial Dependency, i.e., no non-prime attribute (attributes which are not part of any candidate key) is dependent on any proper subset of any candidate key of the table. This table has Partial Dependency f1->f3, f2-> f4 given (F1,F2) is Key So answer is A
 Question 23
A B-Tree used as an index for a large database table has four levels including the root node. If a new key is inserted in this index, then the maximum number of nodes that could be newly created in the process are:
 A 5 B 4 C 3 D 2
B and B+ Trees    Gate IT 2005
Discuss it

Question 23 Explanation:
Number of children of a node is equal to the number of keys in it plus 1. Given tree has 4 levels, the tree will be increased with one more level if a new key is inserted.
 Question 24
Amongst the ACID properties of a transaction, the 'Durability' property requires that the changes made to the database by a successful transaction persist
 A Except in case of an Operating System crash B Except in case of a Disk crash C Except in case of a power failure D Always, even if there is a failure of any kind
Gate IT 2005
Discuss it

Question 24 Explanation:
ACID properties: Atomicity: By this, we mean that either the entire transaction takes place at once or doesn’t happen at all. Consistency: This means that integrity constraints must be maintained so that the database is consistent before and after the transaction. Isolation: This property ensures that multiple transactions can occur concurrently without leading to inconsistency of database state. Durability: This property ensures that once the transaction has completed execution, the updates and modifications to the database are stored in and written to disk and they persist even if system failure occurs no matter which type of failure. Therefore option D
 Question 25
Consider the three commands : PROMPT, HEAD and RCPT. Which of the following options indicate a correct association of these commands with protocols where these are used?
 A HTTP, SMTP, FTP B FTP, HTTP, SMTP C HTTP, FTP, SMTP D SMTP, HTTP, FTP
HTML and XML    Gate IT 2005
Discuss it

Question 25 Explanation:
PROMPT-  Toggles prompting. Ftp prompts during multiple file transfers to allow you to selectively retrieve or store files  //Used for FTP transfers HEAD- The <head> element can include a title for the document, scripts, styles, meta information, and more //Used in HTML to transfer data across HTTP protocol RCPT- You tell the mail server who the recipient of your message is by using the RCPT command //Related to mail so,SMTP
 Question 26
Traceroute reports a possible route that is taken by packets moving from some host A to some other host B. Which of the following options represents the technique used by traceroute to identify these hosts
 A By progressively querying routers about the next router on the path to B using ICMP packets, starting with the first router B By requiring each router to append the address to the ICMP packet as it is forwarded to B. The list of all routers en-route to B is returned by B in an ICMP reply packet C By ensuring that an ICMP reply packet is returned to A by each router en-route to B, in the ascending order of their hop distance from A D By locally computing the shortest path from A to B
Network Layer    Gate IT 2005
Discuss it

Question 26 Explanation:
traceroute tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.
 Question 27
Which of the following statements is TRUE about CSMA/CD
 A IEEE 802.11 wireless LAN runs CSMA/CD protocol B Ethernet is not based on CSMA/CD protocol C CSMA/CD is not suitable for a high propagation delay network like satellite network D There is no contention in a CSMA/CD network
Data Link Layer    Gate IT 2005
Discuss it

Question 27 Explanation:
CSMA/CD requires that sender should be transmitting at least till the first bit reaches the receiver, so it can detect collision if any. For Networks with high prorogation delay this time becomes too long hence the minimum packet size required becomes too big to be feasible.
 Question 28
Count to infinity is a problem associated with
 A link state routing protocol. B distance vector routing protocol C DNS while resolving host name. D TCP for congestion control.
Network Layer    Gate IT 2005
Discuss it

Question 28 Explanation:
Networks using distance-vector routing are susceptible to loops and issues with count to infinity. Problems can happen with your routing protocol when a link or a router fails.
 Question 29
A HTML form is to be designed to enable purchase of office stationery. Required items are to be selected (checked). Credit card details are to be entered and then the submit button is to be pressed. Which one of the following options would be appropriate for sending the data to the server. Assume that security is handled in a way that is transparent to the form design.
 A Only GET B Only POST C Either of GET or POST D Neither GET nor POST
HTML and XML    Gate IT 2005
Discuss it

Question 29 Explanation:
Reasons: GET is NOT SECURE, whatever data you transfer is goes as part of URI and that's why it's visible to whole world, you can not send any confidential data using this method. POST sends data as part of HTTP request body, which can be encrypted using SSL and TLS. This is the reason all confidential data from client to server transffered using POST method e.g. username and password when you login to internet banking, or any online portal. Read more at: http://java67.blogspot.com/2014/08/difference-between-post-and-get-request.html#ixzz3v2Sjr66R
 Question 30
Let f be a function from a set A to a set B, g a function from B to C, and h a function from A to C, such that h(a) = g(f(a)) for all a ∈ A. Which of the following statements is always true for all such functions f and g?
 A g is onto => h is onto B h is onto => f is onto C h is onto => g is onto D h is onto => f and g are onto
Set Theory & Algebra    Gate IT 2005
Discuss it

 Question 31
Which of the following statements is FALSE regarding a bridge?
 A Bridge is a layer 2 device B Bridge reduces collision domain C Bridge is used to connect two or more LAN segments D Bridge reduces broadcast domain
Data Link Layer    Gate IT 2005
Discuss it

Question 31 Explanation:
• Bridge is a layer 2 device -TRUE //A device used to connect two separate Ethernet networks into one extended Ethernet and Ethernet works on DATA LINK Layer
• Bridge reduces collision domain-TRUE//A bridge is a two interfaces device that creates 2 collision domains, since it forwards the traffic it receives from one interface only to the interface where the destination layer 2 device (based on his mac address) is connected to.
• Bridge is used to connect two or more LAN segments -TRUE // It is its sole purpose
• Bridge reduces broadcast domain- FALSE //Bridge can reduce collision domain but can NOT reduce broadcast domain
 Question 32
An unbiased coin is tossed repeatedly until the outcome of two successive tosses is the same. Assuming that the trials are independent, the expected number of tosses is
 A 3 B 4 C 5 D 6
Probability    Gate IT 2005
Discuss it

Question 32 Explanation:
This solution is contributed by Anil Saikrishna Devarasetty.
 Question 33
Let A be a set with n elements. Let C be a collection of distinct subsets of A such that for any two subsets S1 and S2 in C, either S1 ⊂ S2 or S2⊂ S1. What is the maximum cardinality of C?
 A n B n + 1 C 2n-1 + 1 D n!
Set Theory & Algebra    Gate IT 2005
Discuss it

Question 33 Explanation:
As i already mentioned, even if there is small scope of getting solution by substitution method, Just go for it...!! Here let n=2 A = {1, 2} All subsets formed by A are: - {}, {1}, {2}, {1,2}. C is a collection of distinct subsets such that for any S1, S2 either S1⊂S2 or S2⊂S1. So for C, {} null set can be included always since it null. set is a subset of every set. We can choose one from either {1} or {2}, {1,2} can be included to maximise the cardinality. So, here 1) If {1} is chosen then C = {}, {1}, {1,2} here every set is subset of other. 2) If {2} is chosen then C = {}, {2}, {1,2} here also every set is subset of other. So, answer should be 2 but it incluedes empty set also therefore the maximum cardinality of C is 3.   This solution is contributed by Anil Saikrishna Devarasetty .
 Question 34
Let n = p2q, where p and q are distinct prime numbers. How many numbers m satisfy 1 ≤ m ≤ n and gcd (m, n) = 1? Note that gcd (m, n) is the greatest common divisor of m and n.
 A p(q - 1) B pq C (p2- 1) (q - 1) D p(p - 1) (q - 1)
Gate IT 2005
Discuss it

 Question 35
What is the value of
 A -1 B 1 C 0 D π
Misc    Gate IT 2005
Discuss it

 Question 36
Let P(x) and Q(x) be arbitrary predicates. Which of the following statements is always TRUE?
 A ((∀x(P(x)∨Q(x))))⟹((∀xP(x))∨(∀xQ(x))) B (∀x(P(x)⟹Q(x)))⟹((∀xP(x))⟹(∀xQ(x))) C (∀x(P(x))⟹∀x(Q(x)))⟹(∀x(P(x)⟹Q(x))) D (∀x(P(x))⇔(∀x(Q(x))))⟹(∀x(P(x)⇔Q(x)))
Propositional and First Order Logic.    Gate IT 2005
Discuss it

Question 36 Explanation:
Generally, these type of questions can be solved by using two statements and checking the validity of each and every option. Here, let the statements be P and Q where, P : Student is a girl Q : Student is smart Option B says that, IF for all student x : If x is a girl then the student is smart THEN IF the whole class comprises of girls then the whole class comprises of smart students. This solution is contributed by Anil Saikrishna Devarasetty.
 Question 37
Consider the non-deterministic finite automaton (NFA) shown in the figure.
State X is the starting state of the automaton. Let the language accepted by the NFA with Y as the only accepting state be L1. Similarly, let the language accepted by the NFA with Z as the only accepting state be L2. Which of the following statements about L1 and L2 is TRUE? Correction in Question: There is an edge from Z->Y labeled 0 and another edge from Y->Z labeled 1 - in place of double arrowed and no arrowed edges.
 A L1 = L2 B L1 ⊂ L2 C L2 ⊂ L1 D None of the above
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 37 Explanation:
A generic approach to solve such questions would be to come up with the corresponding regular languages and compare the two. Ardens theorem could be used to achieve the objective. Moreover, some conclusions could be drawn without even deriving the languages completely, solely from the intermediary equations. Constructing equations for every state -: X = Z0 +X1, Y = X0 +Y0 +Z0 && Z = X0 + Y1 + Z1. Clearly, regular languages L1 and L2 couldn’t be same. Now, to check which of the other three options are correct, we need to find : 1) a string which is accepted by L1 but not by L2. 2) a string which is accepted by L2 but not by L1. If there exists string 1) but not 2) then L2 ⊂ L1 and likewise. Trying our hands at the given DFA, 1) string 00 is accepted by L1 but not by L2 and 2) string 01 is accepted by L2 but not by L1. Hence, neither of the two languages our subset of the other. This solution is contributed by Vineet Purswani. Another solution. L1 can have 00 string while L2 can't. L2 can have 01 while L1 can't None of them can be either equal or proper subset of each other. So Ans. D.
 Question 38
Let P be a non-deterministic push-down automaton (NPDA) with exactly one state, q, and exactly one symbol, Z, in its stack alphabet. State q is both the starting as well as the accepting state of the PDA. The stack is initialized with one Z before the start of the operation of the PDA. Let the input alphabet of the PDA be Σ. Let L(P) be the language accepted by the PDA by reading a string and reaching its accepting state. Let N(P) be the language accepted by the PDA by reading a string and emptying its stack. Which of the following statements is TRUE?
 A L(P) is necessarily Σ* but N(P) is not necessarily Σ* B N(P) is necessarily Σ* but L(P) is not necessarily Σ* C Both L(P) and N(P) are necessarily Σ* D Neither L(P) nor N(P) are necessarily Σ*
Gate IT 2005
Discuss it

Question 38 Explanation:
The language L(P) accepted by the Push Down Automata (PDA) by reading string and reaching its accepting state and the language N(P) accepted by the PDA by reading a string and emptying a stack but it may be the case that the string has a dead configuration over the transitions of the PDA i.e. PDA does not have a transition for a particular alphabet or string. Hence it does not accept all the strings over Σ*.
For example- Transitions for the PDA are as follows:
1. (q, a, Z) -> (q, aZ)
2. (q, b, Z) -> (q, bZ)
3. (q, a, a) -> (q, aa)
4. (q, a, b) -> (q, ab)
5. (q, b, a) -> (q, ba)
6. (q, null, Z) -> (q, Z)
7. (q, null ,a) -> (q, null)
8. (q, null, b) -> (q, null)
Here q is the initial and accepting state, Z is the initial stack symbol and a and b are the input alphabets.Here {null, a, b, ab, aab………..} are accepted in both the cases but in case of “bb” the PDA enters into a dead configuration as no such transition is present. Hence neither L(P) nor N(P) be necessarily Σ*. This explanation has been contributed by Yashika Arora.
 Question 39
Consider the regular grammar: S → Xa | Ya X → Za Z → Sa | ϵ Y → Wa W → Sa where S is the starting symbol, the set of terminals is {a} and the set of non-terminals is {S, W, X, Y, Z}. We wish to construct a deterministic finite automaton (DFA) to recognize the same language. What is the minimum number of states required for the DFA?
 A 2 B 3 C 4 D 5
Gate IT 2005
Discuss it

Question 39 Explanation:

Language produced by the given grammar is : L = { aa, aaa, aaaaa, aaaaaa, aaaaaaa, aaaaaaaaa ......}
It will not produce strings of length 1, 4, 8 ....
Thus, the minimum string is 'aa'. So, minimum states required to construct automata for this language are 3.

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 40
A language L satisfies the Pumping Lemma for regular languages, and also the Pumping Lemma for context-free languages. Which of the following statements about L is TRUE?
 A L is necessarily a regular language. B L is necessarily a context-free language, but not necessarily a regular language C L is necessarily a non-regular language D None of the above
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 40 Explanation:
Pumping lemma is negativity test. We use it to disprove that a languages is not regular. But reverse is not true.
 Question 41
Given below is a program which when executed spawns two concurrent processes : semaphore X : = 0 ; /* Process now forks into concurrent processes P1 & P2 */
P1 P2
repeat forever V (X) ; Compute ; P(X) ;  repeat forever P(X) ; Compute ; V(X) ;
Consider the following statements about processes P1 and P2:
1. It is possible for process P1 to starve.
2. It is possible for process P2 to starve.
Which of the following holds?
 A Both I and II are true B I is true but II is false C II is true but I is false D Both I and II are false
Gate IT 2005
Discuss it

Question 41 Explanation:

Starvation occurs when a process is not allowed to enter its critical section.
In process P1, entry section calls function Signal() on semaphore ‘X’. Thus, even when the value of X < = 0, it will increment the value of 'X' and enter critical section.
If the control is in critical section of process P1 then X > = 1. Thus, process P2 will decrement the value of X by calling function Wait() on semaphore ‘X’ and enter its critical section.
So, process P1 and P2 will never starve.

Thus, option (D) is correct.

Please comment below if you find anything wrong in the above post.
 Question 42
Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and R4, as shown below.
P1 P2
Compute: Use R1; Use R2; Use R3; Use R4; Compute; Use R1; Use R2; Use R3;. Use R4;
Both processes are started at the same time, and each resource can be accessed by only one process at a time The following scheduling constraints exist between the access of resources by the processes:
• P2 must complete use of R1 before P1 gets access to R1
• P1 must complete use of R2 before P2 gets access to R2.
• P2 must complete use of R3 before P1 gets access to R3.
• P1 must complete use of R4 before P2 gets access to R4.
There are no other scheduling constraints between the processes. If only binary semaphores are used to enforce the above scheduling constraints, what is the minimum number of binary semaphores needed?
 A 1 B 2 C 3 D 4
CPU Scheduling    Gate IT 2005
Discuss it

Question 42 Explanation:

We use two semaphores : A and B. A is initialized to 0 and B is initialized to 1.
P1:

Compute; Wait(A); Use R1; Use R2; Signal(B); Wait(A); Use R3; Use R4; Signal(B);

P2:
Compute; Wait(B); Use r1; Signal(A); Wait(B); Use R2; Use R3; Signal(A); Wait(B); Use R4; Signal(B);

In process p1, initially control will be stuck in while loop of Wait(A) because A = 0. In process p2, Wait(B) decrements the value of B to 0 . Now, P2 uses the resource R1 and increments the value to A to 1 so that process P1 can enter its critical section and use resource R1.
Thus, P2 will complete use of R1 before P1 gets access to R1.
Now, in P2 values of B = 0. So, P2 can not use resource R2 till P1 uses R2 and calls function Signal(B) to increment the value of B to 1. Thus, P1 will complete use of R2 before P2 gets access to R2.
Now, semaphore A = 0. So, P1 can not execute further and gets stuck in while loop of function Wait(A). Process P2 uses R3 and increments the value of semaphore A to 1.Now, P1 can enter its critical section to use R3. Thus, P2 will complete use of R3 before P1 gets access to R3.
Now, P1 will use R4 and increments the value of B to 1 so that P2 can enter is critical section to use R4. Thus, P1 will complete use of R4 before P2 gets access to R4.

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 43
Which of the following input sequences will always generate a 1 at the output z at the end of the third cycle?
 A 0 0 0 1 0 1 1 1 1 B 1 0 1 1 1 0 1 1 1 C 0 1 1 1 0 1 1 1 1 D 0 0 1 1 1 0 1 1 1
Digital Logic & Number representation    Gate IT 2005
Discuss it

Question 43 Explanation:
Let's take cycles as 1,2,3.

There are two flip-flops, let's call them D1 and D2.
And Q1, Q2 to be the output for flip-flop D1, D2 respectively.
here Q11 means output of D1 flip-flop for 1st cycle, similarly Q12
is the output of D1 flip-flop for 2nd Cycle.
A1, A2, A3 means input for A at cycles 1, 2, 3 respectively. Similarly for B and C.

Let's check for the option D where:

A1=0 A2=1 A3=1
B1=0 B2=1 B3=1
C1=1 C2=0 C3=1

Q11=0
Q12 = A1.B1 = 0.0 = 0
Q13 = A2.B2 = 1.1 = 1
~Q11=1
~Q12 = ~(A1.B1) = 1
~Q13 = ~(A2.B2) = 0
Q21 = 0
Q22 = C1.(~Q11) = 1.1 = 1
Q23 = C2.(~Q12) = 0.1 = 0

Z1 = 0
Z2 = Q12.Q21 = 0.0 = 0
Z3 = Q13.Q22 = 1.1 = 1

Hence, sequence given in option D is generating a 1 at the output z at the
end of the third cycle (Z3).
This explanation has been contributed by Harshit Sidhwa.
 Question 44
We have two designs D1 and D2 for a synchronous pipeline processor. D1 has 5 pipeline stages with execution times of 3 nsec, 2 nsec, 4 nsec, 2 nsec and 3 nsec while the design D2 has 8 pipeline stages each with 2 nsec execution time How much time can be saved using design D2 over design D1 for executing 100 instructions?
 A 214 nsec B 202 nsec C 86 nsec D - 200 nsec
Computer Organization and Architecture    Gate IT 2005
Discuss it

Question 44 Explanation:

Total execution time = (k + n – 1) * maximum clock cycle Where k = total number of stages and n = total number of instructions
For D1 : k = 5 and n = 100 Maximum clock cycle = 4ns Total execution time = (5 + 100 - 1) * 4 = 416
For D2 : k = 8 and n = 100 Each clock cycle = 2ns Total execution time = (8 + 100 - 1) * 2 = 214
Thus, time saved using D2 over D1 = 416 – 214 =202

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 45
A hardwired CPU uses 10 control signals S1 to S10, in various time steps T1 to T5, to implement 4 instructions I1 to I4 as shown below: Which of the following pairs of expressions represent the circuit for generating control signals S5 and S10 respectively? ((Ij+Ik)Tn indicates that the control signal should be generated in time step Tn if the instruction being executed is Ij or lk)
 A S5=T1+I2⋅T3 and S10=(I1+I3)⋅T4+(I2+I4)⋅T5 B S5=T1+(I2+I4)⋅T3 and S10=(I1+I3)⋅T4+(I2+I4)⋅T5 C S5=T1+(I2+I4)⋅T3 and S10=(I2+I3+I4)⋅T2+(I1+I3)⋅T4+(I2+I4)⋅T5 D S5=T1+(I2+I4)⋅T3 and S10=(I2+I3)⋅T2+I4⋅T3+(I1+I3)⋅T4+(I2+I4)⋅T5
Computer Organization and Architecture    Gate IT 2005
Discuss it

 Question 46
A line L in a circuit is said to have a stuck-at-0 fault if the line permanently has a logic value 0. Similarly a line L in a circuit is said to have a stuck-at-1 fault if the line permanently has a logic value 1. A circuit is said to have a multiple stuck-at fault if one or more lines have stuck at faults. The total number of distinct multiple stuck-at faults possible in a circuit with N lines is
 A 3^N B 3^N - 1 C 2^N - 1 D 2
Gate IT 2005
Discuss it

Question 46 Explanation:

In a line, there can be three possibilities : 1. Stuck-at 0 fault 2. Stuck-at 1 fault 3. No fault
Thus, total combinations = 3N
It is mentioned that one or more lines have stuck at faults. So, a case in which there is no fault in any line i.e. all lines are correct can not occur. Total combinations = 3N - 1

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 47
(34.4)8 × (23.4)8 evaluates to
 A) (1053.6)8 B) (1053.2)8 C) (1024.2)8 D) None of these
Number Representation    Gate IT 2005
Discuss it

Question 47 Explanation:

We convert (34.4)8 to decimal. = 3 * 81 + 4 * 80 + 4 * 8-1 = 3 * 8 + 4 + 0.5 = (28.5)10
We covert (23.4)8 to decimal. = 2 * 81 + 3 * 80 + 4 * 8-1 = 2 * 8 + 3 + 0.5 = (19.5)10
Now, (28.5)10 * (19.5)10 = (555.75)10
We convert (555.5)10 to octal. 555 / 8 = 69 , 555 % 8 = 3 69 / 8 = 8 , 69 % 8 = 5 8 / 8 = 1 , 8 % 8 = 0 1 / 8 = 0 , 1 % 8 = 1
We keep multiplying the decimal part by 8 till it becomes 0. 0.75 * 8 = 6.0
Thus, (555.75)10 = (1053.6)8

Thus, option (A) is correct.

Please comment below if you find anything wrong in the above post.
 Question 48
The circuit shown below implements a 2-input NOR gate using two 2-4 MUX (control signal 1 selects the upper input). What are the values of signals x, y and z?
 A 1, 0, B B 1, 0, A C 0, 1, B D 0, 1, A
Digital Logic & Number representation    Gate IT 2005
Discuss it

Question 48 Explanation:

In MUX1, equation is : g = Az + Bz’ In MUX2, equation is : f = xg + yg’ = x(Az + Bz’) + y (Az + Bz’)’
Function ‘f’ should be equal to (A + B)’ .
Using hit and try method, put x = 0, y = 1 and z = A. f = 0(AA + BA’) + 1(AA + BA’)’ f = (A + A’B)’ f = (A + B)’

Thus, option (D) is correct.

Please comment below if you find anything wrong in the above post.
 Question 49
n instruction set of a processor has 125 signals which can be divided into 5 groups of mutually exclusive signals as follows:
Group 1 : 20 signals, Group 2 : 70 signals, Group 3 : 2 signals, Group 4 : 10 signals, Group 5 : 23 signals.
How many bits of the control words can be saved by using vertical microprogramming over horizontal microprogramming?
 A 0 B 103 C 22 D 55
Computer Organization and Architecture    Gate IT 2005
Discuss it

Question 49 Explanation:

In horizontal microprogramming, each control signal is represented by one bit in the microinstruction. Therefore, total number of bits of the control words required in Horizontal microprogramming : = 20 + 70 + 2 + 10 + 23 = 125 bits
In vertical microprogramming, 'n' control signals encoded into log2 n bits. group 1 : log2 20 = 5 bits group 2 : log2 70 = 7 bits group 3 : log2 2 = 1 bits group 4 : log2 10 = 4 bits group 5 : log2 23 = 5 bits
Total number of bits required in vertical microprogramming = 5 + 7 + 1 + 4 + 5 = 22 bits
So, number of bits saved= 125 - 22 = 103 bits.

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 50
In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the height of the tree is h > 0, then the minimum number of nodes in the tree is:
 A 2h - 1 B 2h - 1 + 1 C 2h - 1 D 2h
Binary Trees    Gate IT 2005
Discuss it

Question 50 Explanation:
Let there be n(h) nodes at height h.

In a perfect tree where every node has exactly
two children, except leaves, following recurrence holds.

n(h) = 2*n(h-1) + 1

In given case, the numbers of nodes are two less, therefore
n(h) = 2*n(h-1) + 1 - 2
= 2*n(h-1) - 1

Now if try all options, only option (b) satisfies above recurrence.

Let us see option (B)
n(h) = 2h - 1 + 1

So if we substitute
n(h-1) = 2h-2 + 1, we should get n(h) = 2h-1 + 1

n(h) =  2*n(h-1) - 1
=  2*(2h-2 + 1) -1
=  2h-1 + 1.
 Question 51
Let T(n) be a function defined by the recurrence T(n) = 2T(n/2) + √n for n ≥ 2 and T(1) = 1 Which of the following statements is TRUE?
 A T(n) = θ(log n) B T(n) = θ(√n) C T(n) = θ(n) D T(n) = θ(n log n)
Analysis of Algorithms    Gate IT 2005
Discuss it

Question 51 Explanation:
n(logba) = n which is = n^(1-.5) = O(sqrt n) then by applying case 1 of master method we get T(n) = Θ(n) Please  refer http://www.geeksforgeeks.org/analysis-algorithm-set-4-master-method-solving-recurrences/ for more details.
 Question 52
Let G be a weighted undirected graph and e be an edge with maximum weight in G. Suppose there is a minimum weight spanning tree in G containing the edge e. Which of the following statements is always TRUE?
 A There exists a cutset in G having all edges of maximum weight. B There exists a cycle in G having all edges of maximum weight C Edge e cannot be contained in a cycle. D All edges in G have the same weight
Graph    Gate IT 2005
Discuss it

Question 52 Explanation:
Background : Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together.
1. A spanning tree has exactly V - 1 edges.
2. A single graph can have many different spanning trees. A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected and undirected graph is a spanning tree with weight less than or equal to the weight of every other spanning tree. The weight of a spanning tree is the sum of weights given to each edge of the spanning tree.
3. There can be more that one possible spanning trees of a graph. For example, the graph in this question has 6 possible spanning trees.
4. MST has lightest edge of every cutset. Remember Prim's algorithm which basically picks the lightest edge from every cutset.
Choices of this question : a) There exists a cutset in G having all edges of maximum weight : This is correct. If there is a heaviest edge in MST, then there exist a cut with all edges with weight equal to heavies edge. See point 4 discussed in above background. b) There exists a cycle in G having all edges of maximum weight : Not always TRUE. The cutset of heaviest edge may contain only one edge. In fact there may be overall one edge of heavies weight which is part of MST (Consider a graph with two components which are connected by only one edge and this edge is the heavies) c) Edge e cannot be contained in a cycle. Not Always True. The curset may form cycle with other edges. d) All edges in G have the same weight Not always True. As discussed in option b, there can be only one edge of heaviest weight.
 Question 53
The following C function takes two ASCII strings and determines whether one is an anagram of the other. An anagram of a string s is a string obtained by permuting the letters in s.
int anagram (char *a, char *b) {
int count [128], j;
for (j = 0;  j < 128; j++) count[j] = 0;
j = 0;
while (a[j] && b[j]) {
A;
B;
}
for (j = 0; j < 128; j++) if (count [j]) return 0;
return 1;
}
Choose the correct alternative for statements A and B.
 A A : count [a[j]]++ and B : count[b[j]]-- B A : count [a[j]]++ and B : count[b[j]]++ C A : count [a[j++]]++ and B : count[b[j]]-- D A : count [a[j]]++and B : count[b[j++]]--
Gate IT 2005
Discuss it

Question 53 Explanation:
1
 Question 54
The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list is represented as pointer to a structure. The function is called with the list containing the integers 1, 2, 3, 4, 5, 6, 7 in the given order. What will be the contents of the list after the function completes execution?
struct node {
int value;
struct node *next;
);
void rearrange (struct node *list)
{
struct node *p, *q;
int temp;
if (!list || !list -> next)
return;
p = list;
q = list -> next;
while (q)
{
temp = p -> value;
p -> value = q -> value;
q -> value = temp;
p = q -> next;
q = p ? p -> next : 0;
}
}
 A 1, 2, 3, 4, 5, 6, 7 B 2, 1, 4, 3, 6, 5, 7 C 1, 3, 2, 5, 4, 7, 6 D 2, 3, 4, 5, 6, 7, 1
Gate IT 2005
Discuss it

Question 54 Explanation:
 Question 55
A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is traversed in pre-order and the values in each node printed out, the sequence of values obtained is 5, 3, 1, 2, 4, 6, 8, 7. If the tree is traversed in post-order, the sequence obtained would be
 A 8, 7, 6, 5, 4, 3, 2, 1 B 1, 2, 3, 4, 8, 7, 6, 5 C 2, 1, 4, 3, 6, 7, 8, 5 D 2, 1, 4, 3, 7, 8, 6, 5
Tree Traversals    Gate IT 2005
Discuss it

Question 55 Explanation:
 Question 56
Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to a vertex j iff either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is
 A 4 B 7 C 23 D 99
Graph Shortest Paths    Gate IT 2005
Discuss it

Question 56 Explanation:
The task is to find minimum number of edges in a path in G from vertex 1 to vertex 100 such that we can move to either i+1 or 3i from a vertex i.
Since the task is to minimize number of edges,
we would prefer to follow 3*i.

Let us follow multiple of 3.

1 => 3 => 9 => 27 => 81, now we can't follow multiple
of 3. So we will have to follow i+1. This solution gives
a long path.

What if we begin from end, and we reduce by 1 if
the value is not multiple of 3, else we divide by 3.
100 => 99 => 33 => 11 => 10 => 9 => 3 => 1

So we need total 7 edges.
 Question 57
What is the output printed by the following program?
#include<stdio.h>
int f(int n, int k)
{
if (n == 0)
return 0;
else if (n % 2)
return f(n/2, 2*k) + k;
else return f(n/2, 2*k) - k;
}
int main ()
{
printf("%d", f(20, 1));
return 0;
}
 A 5 B 8 C 9 D 20
Functions    Gate IT 2005
Discuss it

Question 57 Explanation:
f(20,1) = 9.
f(10,2) - 1 = 9
f(5,4) - 2 = 10
f(2,8) + 4 = 12
f(1,16) - 8 = 8
f(0,32) + 16 = 16
 Question 58
Let a be an array containing n integers in increasing order. The following algorithm determines whether there are two distinct numbers in the array whose difference is a specified number S > 0.
i = 0;
j = 1;
while (j < n )
{
if (E) j++;
else if (a[j] - a[i] == S) break;
else i++;
}
if (j < n)
printf("yes")
else
printf ("no");

Choose the correct expression for E.

 A a[j] - a[i] > S B a[j] - a[i] < S C a[i] - a[j] < S D a[i] - a[j] > S
Arrays    Gate IT 2005
Discuss it

Question 58 Explanation:
 Question 59
Let a and b be two sorted arrays containing n integers each, in non-decreasing order. Let c be a sorted array containing 2n integers obtained by merging the two arrays a and b. Assuming the arrays are indexed starting from 0, consider the following four statements
1. a[i] ≥ b [i] => c[2i] ≥ a [i]
2. a[i] ≥ b [i] => c[2i] ≥ b [i]
3. a[i] ≥ b [i] => c[2i] ≤ a [i]
4. a[i] ≥ b [i] => c[2i] ≤ b [i]
Which of the following is TRUE?
 A only I and II B only I and IV C only II and III D only III and IV
Arrays    Gate IT 2005
Discuss it

 Question 60
We wish to schedule three processes P1, P2 and P3 on a uniprocessor system. The priorities, CPU time requirements and arrival times of the processes are as shown below.
 Process Priority CPU time required Arrival time (hh:mm:ss) P1 10(highest) 20 sec 00:00:05 P2 9 10 sec 00:00:03 P3 8 (lowest) 15 sec 00:00:00
We have a choice of preemptive or non-preemptive scheduling. In preemptive scheduling, a late-arriving higher priority process can preempt a currently running process with lower priority. In non-preemptive scheduling, a late-arriving higher priority process must wait for the currently executing process to complete before it can be scheduled on the processor. What are the turnaround times (time from arrival till completion) of P2 using preemptive and non-preemptive scheduling respectively.
 A 30 sec, 30 sec B 30 sec, 10 sec C 42 sec, 42 sec D 30 sec, 42 sec
CPU Scheduling    Gate IT 2005
Discuss it

Question 60 Explanation:
For Non preemptive scheduling
 P3(AT=0) P1(AT=5) P2(AT=3)
0                                                       15                                                         35                                       45 Turn Around Time= Completion Time - Arrival Time = 45 -3 = 42   For Preemptive scheduling
 P3 P3 P3 P2 P2 P1 P2 P3
0                  1                    2                 3                  4                      5                  25                  33           45 Turn Around Time= Completion Time - Arrival Time = 33 - 3 = 30
 Question 61
Consider a 2-way set associative cache memory with 4 sets and total 8 cache blocks (0-7) and a main memory with 128 blocks (0-127). What memory blocks will be present in the cache after the following sequence of memory block references if LRU policy is used for cache block replacement. Assuming that initially the cache did not have any memory block from the current job? 0 5 3 9 7 0 16 55
 A 0 3 5 7 16 55 B 0 3 5 7 9 16 55 C 0 5 7 9 16 55 D 3 5 7 9 16 55
Memory Management    Gate IT 2005
Discuss it

Question 61 Explanation:
2-way set associative cache memory, .i.e K = 2.

No of sets is given as 4, i.e. S = 4 ( numbered 0 - 3 )

No of blocks in cache memory is given as 8, i.e. N =8 ( numbered from 0 -7)

Each set in cache memory contains 2 blocks.

The number of blocks in the main memory is 128, i.e  M = 128.  ( numbered from 0 -127)
A referred block numbered X of the main memory is placed in the
set numbered ( X mod S ) of the the cache memory. In that set, the
block can be placed at any location, but if the set has already become
full, then the current referred block of the main memory should replace
a block in that set according to some replacement policy. Here
the replacement policy is LRU ( i.e. Least Recently Used block should
be replaced with currently referred block).

X ( Referred block no ) and
the corresponding Set values are as follows:

X-->set no ( X mod 4 )

0--->0   ( block 0 is placed in set 0, set 0 has 2 empty block locations,
block 0 is placed in any one of them  )

5--->1   ( block 5 is placed in set 1, set 1 has 2 empty block locations,
block 5 is placed in any one of them  )

3--->3  ( block 3 is placed in set 3, set 3 has 2 empty block locations,
block 3 is placed in any one of them  )

9--->1  ( block 9 is placed in set 1, set 1 has currently 1 empty block location,
block 9 is placed in that, now set 1 is full, and block 5 is the
least recently used block  )

7--->3  ( block 7 is placed in set 3, set 3 has 1 empty block location,
block 7 is placed in that, set 3 is full now,
and block 3 is the least recently used block)

0--->block 0 is referred again, and it is present in the cache memory in set 0,
so no need to put again this block into the cache memory.

16--->0  ( block 16 is placed in set 0, set 0 has 1 empty block location,
block 0 is placed in that, set 0 is full now, and block 0 is the LRU one)

55--->3 ( block 55 should be placed in set 3, but set 3 is full with block 3 and 7,
hence need to replace one block with block 55, as block 3 is the least
recently used block in the set 3, it is replaced with block 55.
Hence the main memory blocks present in the cache memory are : 0, 5, 7, 9, 16, 55 . (Note: block 3 is not present in the cache memory, it was replaced with block 55 )   Read the following articles to learn more related to the above question: Cache Memory Cache Organization | Introduction
 Question 62
Two shared resources R1 and R2 are used by processes P1 and P2. Each process has a certain priority for accessing each resource. Let Tij denote the priority of Pi for accessing  Rj. A process Pi can snatch a resource Rh from process Pj if Tik is greater than Tjk. Given the following :
1. T11 > T21
2. T12 > T22
3. T11 < T21
4. T12 < T22
Which of the following conditions ensures that P1 and P2 can never deadlock?
 A (I) and (IV) B (II) and (III) C (I) and (II) D None of the above
Discuss it

Question 62 Explanation:

If all the resources are allocated to one process then deadlock will never occur. So, if we allocate both R1 and R2 to process P1 or both R1 and R2 to process P2 then deadlock can be prevented. When one process completes its execution then both the resources are allocated to the other process. So, either condition (I) and (II) or condition (III) and (IV) ensures that deadlock never occurs.

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.
 Question 63
In a computer system, four files of size 11050 bytes, 4990 bytes, 5170 bytes and 12640 bytes need to be stored. For storing these files on disk, we can use either 100 byte disk blocks or 200 byte disk blocks (but can't mix block sizes). For each block used to store a file, 4 bytes of bookkeeping information also needs to be stored on the disk. Thus, the total space used to store a file is the sum of the space taken to store the file and the space taken to store the book keeping information for the blocks allocated for storing the file. A disk block can store either bookkeeping information for a file or data from a file, but not both. What is the total space required for storing the files using 100 byte disk blocks and 200 byte disk blocks respectively?
 A 35400 and 35800 bytes B 35800 and 35400 bytes C 35600 and 35400 bytes D 35400 and 35600 bytes
Computer Organization and Architecture    Gate IT 2005
Discuss it

Question 63 Explanation:

Using 100 bytes disk blocks :
1. File of size 11050 bytes Blocks required to store data = 11050/100 = 111 Blocks required for bookkeeping = (111 * 4)/100 = 5 Total blocks = 111 + 5 = 116
2. File of size 4990 bytes Blocks required to store data = 4990/100 = 50 Blocks required for bookkeeping = (50 * 4)/100 = 2 Total blocks = 50 + 2 = 52
3. File of size 5170 bytes Blocks required to store data = 5170/100 = 52 Blocks required for bookkeeping = (52 * 4)/100 = 3 Total blocks = 52 + 3 = 55
4. File of size 12640 bytes Blocks required to store data = 12640/100 = 127 Blocks required for bookkeeping = (127 * 4)/100 = 6 Total blocks = 127 + 6 = 133
Total space required for storing the files using 100 byte disk blocks = (116 + 52 + 55 + 133) * 100 = 35600 bytes

Using 200 bytes disk blocks :
1. File of size 11050 bytes Blocks required to store data = 11050/200 = 56 Blocks required for bookkeeping = (56 * 4)/200 = 2 Total blocks = 56 + 2 = 58
2. File of size 4990 bytes Blocks required to store data = 4990/200 = 25 Blocks required for bookkeeping = (25 * 4)/200 = 1 Total blocks = 25 + 1 = 26
3. File of size 5170 bytes Blocks required to store data = 5170/200 = 26 Blocks required for bookkeeping = (26 * 4)/200 = 1 Total blocks = 26 + 1 = 27
4. File of size 12640 bytes Blocks required to store data = 12640/200 = 64 Blocks required for bookkeeping = (64 * 4)/200 = 2 Total blocks = 64 + 2 = 66
Total space required for storing the files using 100 byte disk blocks = (58 + 26 + 27 + 66) * 200 = 35400 bytes

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.
 Question 64
The availability of a complex software is 90%. Its Mean Time Between Failure (MTBF) is 200 days. Because of the critical nature of the usage, the organization deploying the software further enhanced it to obtain an availability of 95%. In the process, the Mean Time To Repair (MTTR) increased by 5 days. What is the MTBF of the enhanced software
 A 205 days B 300 days C 500 days D 700 days
Software Engineering    Gate IT 2005
Discuss it

Question 64 Explanation:
Availability = MTBF/(MTBF + MTTR) Option 1 : 0.9 = 200/(200 + a) = 22.22 Case 2 :0.95 = b/(b+22.22+5)=  517.18(near to option C)
 Question 65
To carry out white box testing of a program, its flow chart representation is obtained as shown in the figure below:   For basis path based testing of this program, its cyclomatic complexity is
 A 5 B 4 C 3 D 2
Gate IT 2005
Discuss it

Question 65 Explanation:
N(nodes) = 9 E(edges) = 10 Cyclomatic Complexity = E - N + 2P = 10 -9 + 2*1 = 3
 Question 66
In a data flow diagram, the segment shown below is identified as having transaction flow characteristics, with p2 identified as the transaction center   A first level architectural design of this segment will result in a set of process modules with an associated invocation sequence. The most appropriate architecture is
 A p1 invokes p2, p2 invokes either p3, or p4, or p5 B p2 invokes p1, and then invokes p3, or p4, or p5 C A new module Tc is defined to control the transaction flow. This module Tc first invokes pl and then invokes D A new module Tc is defined to control the transaction flow. This module Tc invokes p2. p2 invokes p1, and then invokes p3, or p4, or p5
Software Engineering    Gate IT 2005
Discuss it

Question 66 Explanation:
N(nodes) = 9 E(edges) = 10 Cyclomatic Complexity = E - N + 2P = 10 -9 + 2*1 = 3
 Question 67
A company maintains records of sales made by its salespersons and pays them commission based on each individual's total sales made in a year. This data is maintained in a table with following schema:
salesinfo = (salespersonid, totalsales, commission)
In a certain year, due to better business results, the company decides to further reward its salespersons by enhancing the commission paid to them as per the following formula:
If commission < = 50000, enhance it by 2% If 50000 < commission < = 100000, enhance it by 4% If commission > 100000, enhance it by 6%
The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of these scripts is to run as a separate transaction as follows:
 T1 Update salesinfo Set commission = commission * 1.02 Where commission < = 50000; T2 Update salesinfo Set commission = commission * 1.04 Where commission > 50000 and commission is < = 100000; T3 Update salesinfo Set commission = commission * 1.06 Where commission > 100000;
Which of the following options of running these transactions will update the commission of all salespersons correctly
 A Execute T1 followed by T2 followed by T3 B Execute T2, followed by T3; T1 running concurrently throughout C Execute T3 followed by T2; T1 running concurrently throughout D Execute T3 followed by T2 followed by T1
SQL    Gate IT 2005
Discuss it

Question 67 Explanation:
T3 followed by T2 followed by T1  If this sequence is not followed then it may happen that Officer of one slab get benefited twice. Say an officer is having commission as 99,999,He must be get updated commision according to T2.But then 99,999*1.04=1,03998 and he again becomes eligible for next slab of commision. T3 followed by T2 followed by T1 will be check all border cases like above.So Answer is D
 Question 68
A table 'student' with schema (roll, name, hostel, marks), and another table 'hobby' with schema (roll, hobbyname) contains records as shown below:
Table: Student
Roll Name Hostel Marks
1798 Manoj Rathod 7 95
2154 Soumic Banerjee 5 68
2369 Gumma Reddy 7 86
2643 Suhas Kulkarni 5 78
2872 Kiran Vora 5 92
2926 Manoj Kunkalikar 5 94
2959 Hemant Karkhanis 7 88
3125 Rajesh Doshi 5 82

Table: hobby
Roll Hobbyname
1798 chess
1798 music
2154 music
2369 swimming
2581 cricket
2643 chess
2643 hockey
2711 volleyball
2872 football
2926 cricket
2959 photography
3125 music
3125 chess
The following SQL query is executed on the above tables:
select hostel
from student natural join hobby
where marks > = 75 and roll between 2000 and 3000;
Relations S and H with the same schema as those of these two tables respectively contain the same information as tuples. A new relation S’ is obtained by the following relational algebra operation: S’ = ∏hostel ((σs.roll = H.rollmarks > 75 and roll > 2000 and roll < 3000 (S)) X (H)) The difference between the number of rows output by the SQL statement and the number of tuples in S’ is
 A 6 B 4 C 2 D 0
SQL    Gate IT 2005
Discuss it

Question 68 Explanation:
Output of above Query
Roll Hostel
2369 7
2581 6
2643 5
2643 5
2872 5
2926 5
2959 7
Total   rows selected by running SQL Query: 7 Total rows by Relation Algebra : 4  i.e 5,6,7 (Unique values only) 7-3=4   Answer is B
 Question 69
In an inventory management system implemented at a trading corporation, there are several tables designed to hold all the information. Amongst these, the following two tables hold information on which items are supplied by which suppliers, and which warehouse keeps which items along with the stock-level of these items. Supply = (supplierid, itemcode) Inventory = (itemcode, warehouse, stocklevel) For a specific information required by the management, following SQL query has been written
Select distinct STMP.supplierid
From Supply as STMP
Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode
And Inventory.warehouse = 'Nagpur');
For the warehouse at Nagpur, this query will find all suppliers who
 A do not supply any item B supply exactly one item C supply one or more items D supply two or more items
SQL    Gate IT 2005
Discuss it

 Question 70
In a schema with attributes A, B, C, D and E following set of functional dependencies are given
A → B A → C CD → E B → D E → A
Which of the following functional dependencies is NOT implied by the above set?
 A CD → AC B BD → CD C BC → CD D AC → BC
ER and Relational Models    Gate IT 2005
Discuss it

Question 70 Explanation:
 Question 71
A network with CSMA/CD protocol in the MAC layer is running at 1 Gbps over a 1 km cable with no repeaters. The signal speed in the cable is 2 x 108 m/sec. The minimum frame size for this network should be
 A 10000 bits B 10000 bytes C 5000 bits D 5000 bytes
Data Link Layer    Gate IT 2005
Discuss it

Question 71 Explanation:
Frame Size S >= 2BL/P

Where,

Cable Length L = 1KM = 1000M
Propogation Speed P = 2 x 10^8 m/sec
Bandwidth = 1 Gbps = 10^9 bps

See this for details of above formula.

S >= (2 *  10^9 * 1000) / (2 x 10^8)
>= 10000 bits
 Question 72
A channel has a bit rate of 4 kbps and one-way propagation delay of 20 ms. The channel uses stop and wait protocol. The transmission time of the acknowledgement frame is negligible. To get a channel efficiency of at least 50%, the minimum frame size should be
 A 80 bytes B 80 bits C 160 bytes D 160 bits
Data Link Layer    Gate IT 2005
Discuss it

Question 72 Explanation:

Bit rate = 4 kbps One-way propagation delay = 20 ms
Efficiency = Transmission time of packet/(Transmission time of packet + 2 * Propagation delay) 0.5 = x/(x + 2 * 20 * 10-3) x = 20 * 10-3 x = 40 * 10-3
Minimum frame size / Bit rate = 40 * 10-3 Therefore, Minimum frame size = 40 * 10-3 * 4 * 103 = 160 bits

Thus, option (D) is correct.

Please comment below if you find anything wrong in the above post.
 Question 73
On a TCP connection, current congestion window size is Congestion Window = 4 KB. The window size advertised by the receiver is Advertise Window = 6 KB. The last byte sent by the sender is LastByteSent = 10240 and the last byte acknowledged by the receiver is LastByteAcked = 8192. The current window size at the sender is
 A 2048 bytes B 4096 bytes C 6144 bytes D 8192 bytes
Transport Layer    Gate IT 2005
Discuss it

Question 73 Explanation:
 Question 74
In a communication network, a packet of length L bits takes link L1 with a probability of p1or link L2 with a probability of p2. Link L1 and L2 have bit error probability of b1 and b2respectively. The probability that the packet will be received without error via either L1 or L2 is
 A (1 - b1)Lp1 + (1 - b2)Lp2 B [1 - (b1 + b2)L]p1p2 C (1 - b1)L (1 - b2)Lp1p2 D 1 - (b1Lp1 + b2Lp2)
Network Layer    Gate IT 2005
Discuss it

Question 74 Explanation:

Number of bits in a packet = L bits
Probability of link 'l1' = p1 Bit error probability for link 'l1' = b1 No bit error probability for link 'l1' = (1 - b1)
Probability of link 'l2' = p2 Bit error probability for link 'l2' = b2 No bit error probability for link 'l2' = (1 - b2)
Link 'l1' and 'l2' are mutually exclusive. Thus, probability that the packet will be received without error = (1 - b1)Lp1 + (1 - b2)Lp2

Thus, option (A) is correct.

Please comment below if you find anything wrong in the above post.
 Question 75
In a TDM medium access control bus LAN, each station is assigned one time slot per cycle for transmission. Assume that the length of each time slot is the time to transmit 100 bits plus the end-to-end propagation delay. Assume a propagation speed of 2 x 108 m/sec. The length of the LAN is 1 km with a bandwidth of 10 Mbps. The maximum number of stations that can be allowed in the LAN so that the throughput of each station can be 2/3 Mbps is
 A 3 B 5 C 10 D 20
Data Link Layer    Gate IT 2005
Discuss it

Question 75 Explanation:
Tt = 10^(-5) seconds

Tp = 0.5*10^(-5) seconds

efficiency = [1/(1+a)]

where a = (Tp/Tt) = 0.5

therefore efficiency = 2/3

effective bandwidth = (2/3)*10Mbps

number of users = {(2/3)*10} / (2/3) = 10

 Question 76
A company has a class C network address of 204.204.204.0. It wishes to have three subnets, one with 100 hosts and two with 50 hosts each. Which one of the following options represents a feasible set of subnet address/subnet mask pairs?
 A 204.204.204.128/255.255.255.192 204.204.204.0/255.255.255.128 204.204.204.64/255.255.255.128 B 204.204.204.0/255.255.255.192 204.204.204.192/255.255.255.128 204.204.204.64/255.255.255.128 C 204.204.204.128/255.255.255.128 204.204.204.192/255.255.255.192 204.204.204.224/255.255.255.192 D 204.204.204.128/255.255.255.128 204.204.204.64/255.255.255.192 204.204.204.0/255.255.255.192
Network Layer    Gate IT 2005
Discuss it

Question 76 Explanation:
Class A	1.0.0.1 to 126.255.255.254
Class B	128.1.0.1 to 191.255.255.254
Class C	192.0.1.1 to 223.255.254.254
Class D	224.0.0.0 to 239.255.255.255
(127.0.0.0 to 127.255.255.255 - used for loopback functionality : which will point back to the computer's own tcp/ip network configuration.) (1)x.x.x.0 and x.x.x.255 addresses are used for directed broadcast address and network ID. So,these two addresses are not used by hosts. (2)Network ID is computed by performing logical & on IP address with subnet mask. -> IPV4 addresses are 32 bit and they are used as follows for:
Identifying Networks(bit no.)        Identifying Hosts(bit no.)
Class A              1-8      	  			9-32
Class B              1-16   	  			17-32
Class C              1-24	       		        25-32
Now, let's come back to the question: Here, company has class C address of 204.204.204.0(11001100.11001100.11001100.00000000), 1-24 bits are identifying the network. So, network has IP addresses from 204.204.204.0 to 204.204.204.255. ->Subnetting is a practice in which we can divide the network in two or more parts. For this we will have to borrow few bits from the hosts part. -> In subnet mask, all network + subnetwork bits are 1 and host bits are 0.
Option (A)
204.204.204.128/255.255.255.192
204.204.204.0/255.255.255.128
204.204.204.64/255.255.255.128
1) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.11000000 Network bits-26 (as 26 bits are 1 in the subnet mask) so sub-network id = 204.204.204.128 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e. 2^6) -2 = 62 hosts (refer (1) ) 2) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.10000000 Network bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7) -2 =126 hosts (refer (1) ) 3) 11001100.11001100.11001100.01000000/11111111.11111111.11111111.10000000 Network bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 ( refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7) -2 = 126 hosts (refer (1) ) Though the networks are divided into subnets containing 62,126,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have same network ID thus,they are not different.Thus,this division is only of two subnets but we need 3 ,so A option is incorrect.
Option (B)
204.204.204.0/255.255.255.192
204.204.204.192/255.255.255.128
204.204.204.64/255.255.255.128
1) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.11000000 Network bits-26 (as 26 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e. 2^6)-2=62 hosts (refer (1)) 2) 11001100.11001100.11001100.11000000/11111111.11111111.11111111.10000000 Network bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.128 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7)-2=126 hosts (refer (1)) 3) 11001100.11001100.11001100.01000000/11111111.11111111.11111111.10000000 Network bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7)-2=126 hosts (refer (1)) Though the networks are divided into subnets containing 62,126,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have same network ID thus,they are not different.Thus,this division is only of two subnets.
Option (C)
204.204.204.128/255.255.255.128
204.204.204.192/255.255.255.192
204.204.204.224/255.255.255.192
1) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.10000000 Network bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.128 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e. 2^7) -2 =126 hosts (refer 1) 2) 11001100.11001100.11001100.11000000/11111111.11111111.11111111.11000000 Network bits-26 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.192 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6)-2=62 hosts(refer 1) 3) 11001100.11001100.11001100.11110000/11111111.11111111.11111111.11000000 Network bits-26 (as 26 bits are 1 in the subnet mask) so sub-network id == 204.204.204.192 (refer (2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6) -2=62 hosts (refer 1) Though the networks are divided into subnets containing 62,62,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have same network ID thus,they are not different.Thus,this division is only of two subnets.
Option (D)
204.204.204.128/255.255.255.128
204.204.204.64/255.255.255.192
204.204.204.0/255.255.255.192
1) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.10000000 --> Network bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.128 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e. 2^7)-2=126 hosts (refer(1)) 2) 11001100.11001100.11001100.01000000/11111111.11111111.11111111.11000000 --> Network bits-26 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.64 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6)-2=62 hosts (refer(1)) 3) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.11000000 --> Network bits-26 (as 26 bits are 1 in the subnet mask) so sub-network id == 204.204.204.0 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6)-2=62 host bits (refer(1)) This satisfies the minimum criteria of 50,50 and 100 hosts and all subnet IDs are different .Thus,option D is correct. This explanation is provided by Shashank Shanker.
 Question 77
Assume that "host1.mydomain.dom" has an IP address of 145.128.16.8. Which of the following options would be most appropriate as a subsequence of steps in performing the reverse lookup of 145.128.16.8? In the following options "NS" is an abbreviation of "nameserver".
 A Query a NS for the root domain and then NS for the "dom" domains B Directly query a NS for "dom" and then a NS for "mydomain.dom" domains C Query a NS for in-addr.arpa and then a NS for 128.145.in-addr.arpa domains D Directly query a NS for 145.in-addr.arpa and then a NS for 128.145.in-addr.arpa domains
Network Layer    Gate IT 2005
Discuss it

Question 77 Explanation:
 Question 78
Consider the following message M = 1010001101. The cyclic redundancy check (CRC) for this message using the divisor polynomial x5 + x4 + x2 + 1 is :
 A 01110 B 01011 C 10101 D 10110
Data Link Layer    Gate IT 2005
Discuss it

Question 78 Explanation:
M = 1010001101
Divisor polynomial: 1.x5 +1.x4+0.x3+1.x2+0.x2+1.x0
Divisor polynomial bit= 110101
Bits to be appended to message= (divisor polynomial bits – 1) = 5
Append 5 zeros to message bits, modified message: 101000110100000
Now, divide and XOR the message with divisor polynomial bits. Make resultant reminder to 5 bit again and that is the CRC send along with the message. This explanation has been contributed by Sandeep Pandey. Please visit the following links to learn more on CRC and its calulation: Wikipedia article: Cyclic Redundancy Check GeeksforGeeks article: Error Detection | Computer Networks
 Question 79
Suppose that two parties A and B wish to setup a common secret key (D-H key) between themselves using the Diffie-Hellman key exchange technique. They agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and party B chooses 5 as their respective secrets. Their D-H key is
 A 3 B 4 C 5 D 6
Gate IT 2005
Discuss it

Question 79 Explanation:

Primitive root = g = 3 Modulus = p = 7 Xa = 2   and   Xb = 5
Ya = 32 mod 7 = 2 Yb = 35 mod 7 = 5
We assume D-H key to be K.
K = YaXb mod 7 K = 25mod 7 = 4 Or K = YbXa mod 7 K = 62 mod 7 = 1

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 80
Given below is an excerpt of an xml specification.
<Book>
<title> GATE 2005 </title>
<type value = "BROCHURE"/>
<accno>10237623786</accno>
</Book>
<Book>
<type value = "FICTION"/>
<accno>0024154807</accno>
</Book>
Given below are several possible excerpts from "library.dtd". For which excerpt would the above specification be valid?
 A B C D
HTML and XML    Gate IT 2005
Discuss it

 Question 81
Q81 Part_A A disk has 8 equidistant tracks. The diameters of the innermost and outermost tracks are 1 cm and 8 cm respectively. The innermost track has a storage capacity of 10 MB. What is the total amount of data that can be stored on the disk if it is used with a drive that rotates it with (i) Constant Linear Velocity (ii) Constant Angular Velocity?
 A (i) 80 MB (ii) 2040 MB B (i) 2040 MB (ii) 80 MB C (i) 80 MB (ii) 360 MB D (i) 360 MB (ii) 80 MB
Memory Management    Gate IT 2005
Discuss it

Question 81 Explanation:

Constant linear velocity :
Diameter of inner track = d = 1cm Circumference of inner track : = 2 * 3.14 * (d/2) = 3.14 cm
Storage capacity = 10 MB (given) Circumference of all equidistant tracks : = 2 * 3.14 *(0.5 + 1 + 1.5 + 2 + 2.5 + 3+ 3.5 + 4) = 113.14cm
Here, 3.14 cm holds 10 MB. Therefore, 1 cm holds 3.18 MB. 113.14 cm holds 113.14 * 3.18 = 360 MB. Total amount of data that can be stored on the disk = 360 MB

Constant angular velocity :
In case of CAV, the disk rotates at a constant angular speed. Same rotation time is taken by all the tracks. Total amount of data that can be stored on the disk = 8 * 10 = 80 MB

Thus, option (D) is correct.

Please comment below if you find anything wrong in the above post.
 Question 82
Q 81_Part B A disk has 8 equidistant tracks. The diameters of the innermost and outermost tracks are 1 cm and 8 cm respectively. The innermost track has a storage capacity of 10 MB. If the disk has 20 sectors per track and is currently at the end of the 5th sector of the inner-most track and the head can move at a speed of 10 meters/sec and it is rotating at constant angular velocity of 6000 RPM, how much time will it take to read 1 MB contiguous data starting from the sector 4 of the outer-most track?
 A 13.5 ms B 10 ms C 9.5 ms D 20 ms
Gate IT 2005
Discuss it

Question 82 Explanation:

Radius of innermost track = 0.5 cm Radius of outermost track = 4 cm Distance traversed by header = 4 – 0.5 = 3.5 cm = 3.5 * 100 m = 350 m Time taken by header = 350 * 10 = 3500 s = 3.5 ms
It is given that header at the end of the 5th sector of the innermost track. To start from front of 4th sector it must rotate upto 18 sector.
Thus, header does 6000 rotations in 60000ms and 1 rotation in 10 ms. So, to traverse sector 18 it takes 9 ms.
Storage capacity = 10 MB Thus, 10 MB data is read in 10 ms. 1 MB can be read in 1 ms.
Total time taken to read 1 MB contiguous data = (1 + 9 + 3.5) ms = 13.5ms

Thus, option (A) is correct.

Please comment below if you find anything wrong in the above post.
 Question 83
Q 82_Part A A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table. If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are
 A 800000 B 40080 C 32020 D 100
File structures (sequential files, indexing, B and B+ trees)    Gate IT 2005
Discuss it

Question 83 Explanation:

Number of block access = nr * bs + br where br and bs are number of blocks in relations R and S respectively, and nr is the number of tuples in relation R.
We select the relation with small number of tuples as outer relation R. So, R is T2.
Number of block access = 400 * 80 + 20 = 32020

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.
 Question 84
Q82_Part B A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table. If, instead of Nested-loop join, Block nested-loop join is used, again with the most appropriate choice of table in the outer loop, the reduction in number of block accesses required for reading the data will be
 A 0 B 30400 C 38400 D 798400
File structures (sequential files, indexing, B and B+ trees)    Gate IT 2005
Discuss it

Question 84 Explanation:

Number of block access = nr * bs + br where br and bs are number of blocks in relations R and S respectively, and nr is the number of tuples in relation R.
We select the relation with small number of tuples as outer relation R. So, R is T2. Number of block access = 400 * 80 + 20 = 32020
The memory buffer space holds one block of records for T1 and one block of records for T2 simultaneously. So, number of block accesses is 80 * 20 + 20 = 1620
So, Total number of block access = 32020 - 1620 = 30400

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 85
Q83 Part_A Consider the context-free grammar E → E + E E → (E * E) E → id
where E is the starting symbol, the set of terminals is {id, (,+,),*}, and the set of nonterminals is {E}.
Which of the following terminal strings has more than one parse tree when parsed according to the above grammar?
 A id + id + id + id B id + (id* (id * id)) C (id* (id * id)) + id D ((id * id + id) * id)
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 85 Explanation:

According to leftmost derivation :
E -> E + E (using E -> E + E) E -> E + E + E (using E -> E + E) E -> E + E + E + E (using E -> E + id) E -> id + E + E + E (using E -> id) E -> id + id + E + E (using E -> id) E -> id + id + id + E (using E -> id) E -> id + id + id + id

According to rightmost derivation :
E -> E + E (using E -> E + E) E -> E + E + E (using E -> E + E) E -> E + E + E + E (using E -> E + id) E -> E + E + E + id (using E -> id) E -> E + E + id + id (using E -> id) E -> E + id + id + E (using E -> id) E -> id + id + id + id

Thus, option (A) is correct.

Please comment below if you find anything wrong in the above post.
 Question 86
Q 83_Part B Consider the context-free grammar E → E + E E → (E * E) E → id
where E is the starting symbol, the set of terminals is {id, (,+,),*}, and the set of non-terminals is {E}.
For the terminal string id + id + id + id, how many parse trees are possible?
 A 5 B 4 C 3 D 2
Regular languages and finite automata    Gate IT 2005
Discuss it

Question 86 Explanation:
Background Required to solve the question - Parse Tree Construction.
Explanation : In order to produce the yield id + id + id + id ,
we only required 3 productions of type E → E + E  as 3 ‘+’ are
required in the final string. This can be done in 5 ways as shown
in the picture given below:
This explanation has been provided by Pranjul Ahuja.
 Question 87
Q84 Part_A
A sink in a directed graph is a vertex i such that there is an edge from every vertex j ≠ i to i and there is no edge from i to any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph G.
i = 0
do {
j = i + 1;
while ((j < n) && E1)
j++;
if (j < n) E2;
} while (j < n);

flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3)
flag = 0;

if (flag)
printf("Sink exists");
else
printf ("Sink does not exist");
Choose the correct expressions for E1 and E2
 A E1 : A[i][j] and E2 : i = j; B E1 : !A[i][j] and E2 : i = j + 1; C E1: !A[i][j] and E2 : i = j; D E1 : A[i][j] and E2 : i = j + 1;
Gate IT 2005
Discuss it

Question 87 Explanation:
For vertex i to be a sink, there should be no edge from i to any other vertex. According the input given in question,
A[i][j] = 1 means there is an edge from vertex i to j.
A[i][j] = 0 means there is no edge from i to j
For a node to i to be sink,
A[i][j] should be 0 for all j
A[j][i] should be 1 for all j.
The above pseudo code checks every vertex i for sink, starting from i = 0. It basically checks every vertex j after i for being a sink. The trick in pseudo code is, it doesn't check for j smaller than i. The i picked by this loop may not be sink. It basically makes sure that we don't ignore a potential sink. The check whether i is actually a sink or not is done later after do while loop. Vertex i is a potential sink while A[i][j] is zero Thus, E1 : !A[i][j] If the above condition is false, then i is not a sink. All j < i can also not be a sink because there is no edge from i to j. Now, the next potential sink can be j. So, E2 : i = j Thus, option (C) is correct.

 Question 88
Q84 Part_B
A sink in a directed graph is a vertex i such that there is an edge from every vertex j ≠ i to i and there is no edge from i to any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph G.
i = 0
do {
j = i + 1;
while ((j < n) && E1) j++;
if (j < n) E2;
} while (j < n);

flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3)
flag = 0;

if (flag)
printf("Sink exists");
else
printf("Sink does not exist");
Choose the correct expressions for E3
 A (A[i][j] && !A[j][i]) B (!A[i][j] && A[j][i]) C (!A[i][j] | |  A[j][i]) D (A[i][j] | | !A[j][i])
Graph    Gate IT 2005
Discuss it

Question 88 Explanation:
Below explanation is for Previous Part of this question: For vertex i to be a sink, there should be no edge from i to any other vertex. According the input given in question,
A[i][j] = 1 means there is an edge from vertex i to j.
A[i][j] = 0 means there is no edge from i to j
For a node to i to be sink,
A[i][j] should be 0 for all j
A[j][i] should be 1 for all j.
The above pseudo code checks every vertex i for sink, starting from i = 0. It basically checks every vertex j after i for being a sink. The trick in pseudo code is, it doesn't check for j smaller than i. The i picked by this loop may not be sink. It basically makes sure that we don't ignore a potential sink. The check whether i is actually a sink or not is done later after do while loop. Vertex i is a potential sink while A[i][j] is zero Thus, E1 : !A[i][j] If the above condition is false, then i is not a sink. All j < i can also not be a sink because there is no edge from i to j. Now, the next potential sink can be j. So, E2 : i = j Explanation for this question The following pseudo code basically checks if the potential sink picked by the code above is actually a sink or not.
flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3)
flag = 0;
flag equals to 0 means i is not a sink. The code sets the flag 0 as soon as it finds out that i is not a sink.
A node i is not a sink if either of the following
two conditions become true for any j not equal to i.
A[i][j] is 1 for any j
OR
A[j][i] is 0 for any j
E3 : (A[i][j] | | !A[j][i]) Therefore option D is correct
 Question 89
Q85  Part_A Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each updation interval, three tasks are performed.
1. A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible neighbour as 1. Otherwise, the cost is set to ∞.
2. From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
3. Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following options. Identify the correct table.
1) Table for node A
 A - - B B 1 C C 1 D B 3 E C 3 F C 4
2) Table for node C
 A A 1 B B 1 C - - D D 1 E E 1 F E 3
3)
Table for node B
 A A 1 B - - C C 1 D D 1 E C 2 F D 2
4) Table for node D
 A B 3 B B 1 C C 1 D - - E E 1 F F 1
 A A B B C C D D
Graph    Gate IT 2005
Discuss it

Question 89 Explanation:
This solution is contributed by Sandeep Pandey.
 Question 90
Q85 Part_B Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each updation interval, three tasks are performed.
1. A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible neighbour as 1. Otherwise, the cost is set to ∞.
2. From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
3. Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following options. Identify the correct table.
1) Table for node A
 A - - B B 1 C C 1 D B 3 E C 3 F C 4
2) Table for node C
 A A 1 B B 1 C - - D D 1 E E 1 F E 3
3)
Table for node B
 A A 1 B - - C C 1 D D 1 E C 2 F D 2
4) Table for node D
 A B 3 B B 1 C C 1 D - - E E 1 F F 1
Continuing from the earlier problem, suppose at some time t, when the costs have stabilized, node A goes down. The cost from node F to node A at time (t + 100) is
 A >100 but finite B ∞ C 3 D >3 and ≤100
Graph    Gate IT 2005
Discuss it

There are 90 questions to complete.

## GATE CS Corner

See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.