Question 1
A set of Boolean connectives is functionally complete if all Boolean functions can be synthesized using those. Which of the following sets of connectives is NOT functionally complete?
A
EX-NOR
B
implication, negation
C
OR, negation
D
NAND
Gate IT 2008    
Discuss it


Question 1 Explanation: 
  The EX-NOR is not functionally complete because we cannot synthesize all Boolean functions using EX-NOR gate only. This is primarily because we cannot obtain inverted output using EX-NOR. If we can obtain inversion from any gate then any logic function can be synthesized using that gate only. NAND (A.A)' = A'+A' = A' kriti_6 OR and negation (A+A)' = A'.A' = A' kriti_7 Implication and negation A->B = (A'+B) Now if B is taken as negation of A then A->A' = A'+A' = A' Thus negation can be using these combinations of logics. This solution is contributed by Kriti Kushwaha.
Question 2
A sample space has two events A and B such that probabilities P(A ∩ B) = 1/2, P(A') = 1/3, P(B') = 1/3. What is P(A U B)?
A
11/12
B
10/12
C
9/12
D
8/12
Probability    Gate IT 2008    
Discuss it


Question 3
What is the chromatic number of the following graph? 2008_3
A
2
B
3
C
4
D
5
Graph Theory    Gate IT 2008    
Discuss it


Question 3 Explanation: 
The chromatic number of a graph is the smallest number of colors needed to color the vertices so that no two adjacent vertices have the same color. In this graph, minimum number of colors needed to color given graph would be equal to 3.
Question 4
What is the size of the smallest MIS(Maximal Independent Set) of a chain of nine nodes?
A
5
B
4
C
3
D
2
Analysis of Algorithms    Gate IT 2008    
Discuss it


Question 4 Explanation: 
A set of vertices is called independent set such that no two vertices in the set are adjacent. A maximal independent set (MIS) is an independent set which is not subset of any other independent set. The question is about smallest MIS. We can see in below diagram, the three highlighted vertices (2nd, 5th and 8th) form a maximal independent set (not subset of any other MIS) and smallest MIS.
0----0----0----0----0----0----0----0----0
Question 5
Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?
A
(0 + 1) * 11(0 + 1) *
B
0 * 110 *
C
0 * 10 * 10 *
D
(0 + 1) * 1(0 + 1) * 1 (0 + 1) *
Regular languages and finite automata    Gate IT 2008    
Discuss it


Question 5 Explanation: 
By looking at option A and D clearly not feasible solution.
Between B and C both contains exactly two 1's but in option B, both 1 will always come together where as in C it is general string.
Question 6
Let N be an NFA with n states and let M be the minimized DFA with m states recognizing the same language. Which of the following in NECESSARILY true?
A
m ≤ 2n
B
n ≤ m
C
M has one accept state
D
m = 2n
Regular languages and finite automata    Gate IT 2008    
Discuss it


Question 6 Explanation: 
A state in a DFA is proper subset of states of NFA of corresponding DFA
=> set of states of NFA =n
=> no of subsets of a set with n elements = 2n
=> m<=2n
Question 7
The following bit pattern represents a floating point number in IEEE 754 single precision format 1 10000011 101000000000000000000000 The value of the number in decimal form is
A
-10
B
-13
C
-26
D
None of these
Digital Logic & Number representation    Number Representation    Gate IT 2008    
Discuss it


Question 7 Explanation: 
  To convert the floating point into decimal, we have 3 elements in a 32-bit floating point representation: i. Sign ii. Exponent iii. Mantissa Sign bit is the first bit of the binary representation. '1' implies negative number and '0' implies positive number Exponent is decided by the next 8 bits of binary representation. 131-127=4 Hence the exponent of 2 will be 4. i.e 24=16. 127 is the unique number for 32 bit floating point representation. It is known as bias. It is determined by 2k-1-1 where 'k' is the number of bits in exponent field. Thus bias = 3 for 8 bit conversion and 127 for 32 bit. (28-1-1 = 128-1=127) Mantissa is calculated from the remaining 24 bits of the binary representation. It consists of '1' and a fractional part which is determined by: The fractional part of mantissa is given by: 1*(1/2) + 0*(1/4) + 1*(1/8) + 0*(1/16) +.........=0.625 Thus the mantissa will be 1+0.625=1.625 The decimal number hence given as Sign*Exponent*Mantissa = (-1)*(16)*(1.625) = -26. Related : https://www.youtube.com/watch?v=03fhijH6e2w http://quiz.geeksforgeeks.org/number-representation/ This solution is contributed by Kriti Kushwaha.,
Question 8
Consider the following Boolean function of four variables f(A, B, C, D) = Σ(2, 3, 6, 7, 8, 9, 10, 11, 12, 13) The function is
A
independent of one variable
B
independent of two variables
C
independent of three variable
D
dependent on all the variables
Gate IT 2008    
Discuss it


Question 8 Explanation: 
  The Karnaugh map solutions of the given function can be obtained in two ways. These are the minimal functions that can be obtained. Thus the functions obtained are independent of variable "D".
A'B' A'B AB AB'
00 01 11 10
A'B' 00 1 1
A'B 01 1 1
AB 11 1 1
AB' 10 1 1 1 1
A'C+AC'+AB'  
A'B' A'B AB AB'
00 0 1 11 10
A'B' 00 1 1
A'B 01 1 1
AB 11 1 1
AB' 10 1 1 1 1
A'C+AC'+B'C Related : http://quiz.geeksforgeeks.org/k-mapkarnaugh-map/ https://www.youtube.com/watch?v=ygm25sqqepg&spfreload=10 https://www.youtube.com/watch?v=i_HYxdri69Y This solution is contributed by Kriti Kushwaha.
Question 9
What Boolean function does the circuit below realize?
2008_9
A
xz+x'z'
B
xz'+x'z
C
x'y'+yz
D
xy+y'z'
Digital Logic & Number representation    Gate IT 2008    
Discuss it


Question 10
Arrange the following functions in increasing asymptotic order:
A. n1/3
B. en
C. n7/4
D. n log9n
E. 1.0000001n
A
A, D, C, E, B
B
D, A, C, E, B
C
A, C, D, E, B
D
A, C, D, B, E
Analysis of Algorithms    Gate IT 2008    
Discuss it


Question 11
For problems X and Y, Y is NP-complete and X reduces to Y in polynomial time. Which of the following is TRUE?
A
If X can be solved in polynomial time, then so can Y
B
X is NP-complete
C
X is NP-hard
D
X is in NP, but not necessarily NP-complete
NP Complete    Gate IT 2008    
Discuss it


Question 11 Explanation: 
 

In order to solve these type of questions in GATE, we will give 2 important theorems. Proofs of these is beyond the scope of this explanation. For Proofs please refer to Introduction To Algorithms by Thomas Cormen.

Theorem - 1 When a given Hard Problem (NPC, NPH and Undecidable Problems) is reduced to an unknown problem in polynomial time, then unknown problem also becomes Hard.

Case - 1  When NPC(NP-Complete) problem is reduced to unknown problem, unknown problem becomes NPH(NP-Hard).

 Case - 2 When NPH(NP-Hard) problem is reduced to unknown problem, unknown problem becomes NPH(NP-Hard).

Case - 3 When undecidable problem is reduced to unknown problem, unknown problem becomes also becomes undecidable.

Remember that Hard problems needs to be converted for this theorem but not the other way.

Theorem - 2

When an unknown problem  is reduced to an  Easy problem(P or NP) in polynomial time, then unknown problem also becomes easy.

Case - 1  When an unknown problem  is reduced to a P type problem, unknown problem also becomes P.

Case - 2 When an unknown problem  is reduced to a NP type problem, unknown problem also becomes NP.

Remember that unknown problems needs to be converted for this theorem to work but not the other way.

In the given question, X which is unknown problem is reduced to NPC problem in polynomial time so Theorem - 1 will not work. But all NPC problems are also NP, so we can say that X is getting reduced to a known NP problem so that  Theorem - 2 is applicable and X is also NP. In order to make it NPC, we have to prove it NPH first which is not the case as Y is not getting reduced to X.

This solution is contributed by Pranjul Ahuja.

 

Question 12
Which of the following is TRUE?
A
The cost of searching an AVL tree is θ (log n) but that of a binary search tree is O(n)
B
The cost of searching an AVL tree is θ (log n) but that of a complete binary tree is θ (n log n)
C
The cost of searching a binary search tree is O (log n ) but that of an AVL tree is θ(n)
D
The cost of searching an AVL tree is θ (n log n) but that of a binary search tree is O(n)
Analysis of Algorithms    Balanced Binary Search Trees    Gate IT 2008    
Discuss it


Question 12 Explanation: 
AVL tree is a balanced tree.
AVL tree's time complexity of searching = θ(logn)
But a binary search tree, may be skewed tree, so in worst case BST searching time = θ(n)
Question 13
Match the programming paradigms and languages given in the following table.
2008_13
A
I-c, II-d, III-b, IV-a
B
I-a, II-d, III-c, IV-b
C
I-d, II-c, III-b, IV-a
D
I-c, II-d, III-a, IV-b
Principles of Programming Languages    Gate IT 2008    
Discuss it


Question 14
A processor that has carry, overflow and sign flag bits as part of its program status word (PSW) performs addition of the following two 2's complement numbers 01001101 and 11101001. After the execution of this addition operation, the status of the carry, overflow and sign flags, respectively will be:
A
1, 1, 0
B
1, 0, 0
C
0, 1, 0
D
1, 0, 1
Digital Logic & Number representation    Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 14 Explanation: 
01001101
+11101001
------------
100110110
carry flag =1
overflow happens only when two same sign numbers are added and carry generated is different from both added numbers.
so, overflow flag = 0,
sign bit = 0
Question 15
A paging scheme uses a Translation Look-aside Buffer (TLB). A TLB-access takes 10 ns and a main memory access takes 50 ns. What is the effective access time(in ns) if the TLB hit ratio is 90% and there is no page-fault?
A
54
B
60
C
65
D
75
Memory Management    Gate IT 2008    
Discuss it


Question 15 Explanation: 
Effective access time = hit ratio * time during hit + miss ratio * time during miss TLB time = 10ns, Memory time = 50ns Hit Ratio= 90% E.A.T. = (0.90)*(60)+0.10*110 =65
Question 16
Find if the following statements in the context of software testing are TRUE or FALSE.
(S1) Statement coverage cannot guarantee execution of loops in a program under test.
(S2) Use of independent path testing criterion guarantees execution of each loop in a program under test more than once.
A
True, True
B
True, False
C
False, True
D
False, False
Software Engineering    Gate IT 2008    
Discuss it


Question 17
How many bytes of data can be sent in 15 seconds over a serial link with baud rate of 9600 in asynchronous mode with odd parity and two stop bits in the frame?
A
10,000 bytes
B
12,000 bytes
C
15,000 bytes
D
27,000 bytes
Data Link Layer    Misc Topics in Computer Networks    Gate IT 2008    
Discuss it


Question 17 Explanation: 
  Background required - Physical Layer in OSI Stack In serial Communications, information is transferred in or out one bit at a time. The baud rate specifies how fast data is sent over a serial line. It’s usually expressed in units of bits-per-second (bps). Each block (usually a byte) of data transmitted is actually sent in a packet or frame of bits. Frames are created by appending synchronization and parity bits to our data. frame
"9600 baud" means that the serial port is capable of transferring a 
maximum of 9600 bits per second.

1 sec--------> 9600 bits
15 sec------->9600*15 bits

Total Data To send in 1 frame = 1 bit(start) + 8 bits(char size) + 1 bit(Parity) + 2 bits(Stop) 

= 12 bits.

Number of 8-bit characters that can be transmitted per second  = (9600 * 15)/12 = 12000 bytes.
This explanation is contributed by Pranjul Ahuja.
Question 18
Which of the following is TRUE only of XML but NOT HTML?
A
It is derived from SGML
B
It describes content and layout
C
It allows user defined tags
D
It is restricted only to be used with web browsers
HTML and XML    Gate IT 2008    
Discuss it


Question 18 Explanation: 
SGML (standard generalized markup language)
both xml and html are derivative of SGML
Both xml and html describes layout and content
both are restricted to be used with web browsers
xml allows user defined tags but HTML-4 does not
Question 19
Provide the best matching between the entries in the two columns given in the table below:
2008_20
A
I-a, II-d, III-c, IV-b
B
I-b, II-d, III-c, IV-a
C
I-a, II-c, III-d, IV-b
D
I-b, II-c, III-d, IV-a
Misc Topics in Computer Networks    Gate IT 2008    
Discuss it


Question 19 Explanation: 
DNS - Allows caching of entries at local server.
Question 20
Which of the following first order formula is logically valid? Here α(x) is a first order formula with x as a free variable, and β is a first order formula with no free variable.
A
[β→(∃x,α(x))]→[∀x,β→α(x)]
B
[∃x,β→α(x)]→[β→(∀x,α(x))]
C
[(∃x,α(x))→β]→[∀x,α(x)→β]
D
[(∀x,α(x))→β]→[∀x,α(x)→β]
Propositional and First Order Logic.    Gate IT 2008    
Discuss it


Question 20 Explanation: 
  A formula is logically valid (or simply valid) if it is true in every interpretation. These formulas play a role similar to tautologies in propositional logic. A formula is VALID if no instance of it is false. So, it is enough to give any instance which gives false and prove that our formula is not valid Choice of this question: option (a) [β→(∃x,α(x))] → [∀x,β→α(x)] LHS: If β is true, then there exists an x for which α(x) is true. RHS: For all x, if β is true then α(x) is true. This is same as saying if β is true then for all x, α(x) is true. (β⟹∀x,α(x)) So, RHS⟹LHS and LHS⟹̸ RHS. Option (b) [∃x,β→α(x)] → [β→(∀x,α(x))] LHS: There exists an x such that if β is true then α(x) is true. RHS: If β is true then for all x, α(x) is true. So, RHS⟹LHS and LHS⟹̸ RHS. Option (c) [(∃x,α(x))→β] → [∀x,α(x)→β] LHS: If there is an x such that α(x) is true, then β is true. RHS: For all x, if α(x) is true, then β is true. Here, both LHS and RHS are same because β is a formula with no free variable which is independent of x. (if β is true for one x, it is true for every x and vice versa). So, RHS⟹LHS and LHS⟹RHS. Option (d) [(∀x,α(x))→β]→[∀x,α(x)→β] RHS: For every x, if α(x) is true then β is true. So, RHS⟹LHS and LHS⟹̸ RHS So, option c is correct one. because for option c, LHS and RHS being equivalent, even if the implication is reversed, it remains valid. This solution is contributed by Nitika Bansal.
Question 21
Which of the following is the negation of [∀ x, α → (∃y, β → (∀ u, ∃v, y))]
A
[∃ x, α → (∀y, β → (∃u, ∀ v, y))]
B
[∃ x, α → (∀y, β → (∃u, ∀ v, ¬y))]
C
[∀ x, ¬α → (∃y, ¬β → (∀u, ∃ v, ¬y))]
D
[∃ x, α ʌ (∀y, β ʌ (∃u, ∀ v, ¬y))]
Propositional and First Order Logic.    Gate IT 2008    
Discuss it


Question 21 Explanation: 
  When we negate a quantified statement, we negate all the quantifiers first, from left to right (keeping the same order), then we negative the statement. We can take examples as: 1. ¬[∀x ∈ A, P(x)] ⇔ ∃x ∈ A, ¬P(x). 2. ¬[∃x ∈ A, P(x)] ⇔ ∀x ∈ A, ¬P(x). 3. ¬[∀x ∈ A, ∃y ∈ B, P(x, y)] ⇔ ∃x ∈ A, ∀y ∈ B, ¬P(x, y). 4. ¬[∃x ∈ A, ∀y ∈ B, P(x, y)] ⇔ ∀x ∈ A, ∃y ∈ B, ¬P(x, y). important, to negate an implication: ¬[IF P, THEN Q] ⇔ P AND NOT Q Now question is to negate this qualified statement: [∀ x, a -> (∃y, B -> (∀u, ∃v,y))] By negating it: ¬ [∀ x, a -> (∃y, B -> (∀u, ∃v,y))] x, a ^ { ¬(∃y) , ¬[ B -> (∀u, ∃v,y) ] } x, a ^ ( ∀y, B ^ ¬ (∀u, ∃v,y)) x, a ^ ( ∀y, B ^ (∃u, ∀v, ¬y)) option D is correct. This solution is contributed by Nitika Bansal .
Question 22
What is the probability that in a randomly chosen group of r people at least three people have the same birthday?
2008_23
A
A
B
B
C
C
D
D
Probability    Gate IT 2008    
Discuss it


Question 22 Explanation: 
anil_22 This solution is contributed by Anil Saikrishna Devarasetty
Question 23
The exponent of 11 in the prime factorization of 300! is
A
27
B
28
C
29
D
30
Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 23 Explanation: 
To get exponent of 11, first we need to get figure 11 in our series
=> Below 11, there will be no factor of 11
11*12*13*14*........22.......33........44...........55.......66.....77....88...99...110...121....132.....
# # # # # # # # # # (11*11) (11*12)
143.........154......165.....176.....187......198.......209.....220.....231....242.....253....264.....275 11*11*2 ....286......297
Total count of 11's = 29
Question 24
In how many ways can b blue balls and r red balls be distributed in n distinct boxes?
A
[(n+b-1)!(n+r-1)!]/[(n-1)!b!(n-1)!r!]
B
[(n+(b+r)-1)!]/[(n-1)!(n-1)!(b+r)!]
C
n!/(b!r!)
D
[(n+(b+r)-1)!]/[n!(b+r-1)!]
Probability    Gate IT 2008    
Discuss it


Question 24 Explanation: 
  You have to distribute k balls x 1 ,x 2..... x k that correspond to the number of balls that will be placed in boxes 1, 2, 3 .....k respectively. Since, they should add up to n, you want to determine the number of solutions to the equation: x 1 +x 2 +x 3 +x 4 +......+x k =n solution for the given equation is : (n+k-1)C k = (n+k-1)!/k!(n-1)! For distributing the b blue balls into n distinct boxes, equation will be  x 1 +x 2 +x 3 +....x b = n and solution of the equation will be (n+b-1)C b = (n+b-1)!/b!(n-1)! For distributing the r red balls into n distinct boxes, equation will be x 1 +x 2 +x 3 +....x r = n and solution of the equation will be (n+r-1)C r = (n+r-1)!/r!(n-1)! And For every way of distributing the b blue balls, there are r ways to distribute the red balls, so our total is br. i.e. (n+b-1)! (n+r-1)! / b!(n-1)!r!(n-1)!  which is answer A. Reference: Wikipedia: Stars_and_bars_combinatorics Related: http://www.careerbless.com/aptitude/qa/permutations_combinations_imp8.php This solution is contributed by Nitika Bansal.
Question 25
Consider the field C of complex numbers with addition and multiplication. Which of the following form(s) a subfield of C with addition and multiplication?
(S1) the set of real numbers
(S2) {(a + ib) | a and b are rational numbers}
(S3) {a + ib | (a2 + b2) ≤ 1}
(S4) {ia | a is real}
A
only S1
B
S1 and S3
C
S2 and S3
D
S1 and S2
Gate IT 2008    
Discuss it


Question 25 Explanation: 
S3: is not closed
=> (0.3+0.4i)+(0.7+0.6i)=1+i
Both (0.3+0.4i) and (0.7+0.6i)
Complex numbers follows S3 but Addition of them does not follows
=>1+i, (a2+b2)<=1
=> 1+1 is not less than equal to 1
S4: {ia |a is real}
There is no multiplicative identity exists (that is 1)
S1: It is closed under both * and +
As real + real =real and real * real = real
S2: It is closed as rational + rational = rational and rational * rational = rational
Question 26
G is a simple undirected graph. Some vertices of G are of odd degree. Add a node v to G and make it adjacent to each odd degree vertex of G. The resultant graph is sure to be
A
regular
B
Complete
C
Hamiltonian
D
Euler
Graph Theory    Gate IT 2008    
Discuss it


Question 26 Explanation: 
For a graph to be Euler graph all the degrees must be Even for all nodes. In any graph all the Odd degree nodes are connected with a node.
And number of Odd degree vertices should be even.
So degree of this new node will be Even and as a new edge is formed between this new node and all other nodes of Odd degree hence here is not a single node exists with degree Odd
=> Euler Graph
Question 27
Consider the following Hasse diagrams.
2008_28
Which all of the above represent a lattice?
A
(i) and (iv) only
B
(ii) and (iii) only
C
(iii) only
D
(i), (ii) and (iv) only
Gate IT 2008    
Discuss it


Question 27 Explanation: 
A hasse diagram will be lattice when every pair of element have at least upper bound and greatest lower bound.
Question 28
If M is a square matrix with a zero determinant, which of the following assertion (s) is (are) correct? (S1) Each row of M can be represented as a linear combination of the other rows (S2) Each column of M can be represented as a linear combination of the other columns (S3) MX = 0 has a nontrivial solution (S4) M has an inverse
A
S3 and S2
B
S1 and S4
C
S1 and S3
D
S1, S2 and S3
Gate IT 2008    
Discuss it


Question 28 Explanation: 
  A matrix with number of rows equal to number of columns is square matrix and when determinant of square matrix is zero, it is called singular matrix or non- invertible matrix. Properties of singular matrix: Singular matrices are those where some rows or columns can be expressed by a linear combination of others. here M is a square matrix with zero determinant i.e. M is singular |M|=0 Statements(s1,s2): correct BY using property of singular matrix, we can see that columns or rows do not contain additional information.They are redundant and using row elimination or column elimination, matrix determinant is equal to zero.so it can be represented as linear combinations. Statement (s3): correct As |M| is equal to zero,it will give non trivial solution. as matrix properties say, for a non trivial solution, determinat should be equal to zero. Statement(s4): incorrect Let us understand this concept in detail. We know that the formula for finding the inverse of a square matrix M is: M −1 = adjoint(M)/|M| If |M| = 0, then M −1 would given an indeterminate form; i.e. its inverse will not exist. Note: this comes into the basic fundamental of matrix.so read basics. This solution is contributed by Nitika Bansal.
Question 29
If f(x) is defined as follows, what is the minimum value of f(x) for x ∊ (0, 2] ?
2008_31
A
2
B
2(1/12)
C
2(1/6)
D
2(1/2)
Gate IT 2008    
Discuss it


Question 30
If the final states and non-final states in the DFA below are interchanged, then which of the following languages over the alphabet {a,b} will be accepted by the new DFA? 2008_32
A
Set of all strings that do not end with ab
B
Set of all strings that begin with either an a or a b
C
Set of all strings that do not contain the substring ab,
D
The set described by the regular expression b*aa*(ba)*b*
Regular languages and finite automata    Gate IT 2008    
Discuss it


Question 30 Explanation: 
  Seemingly, DFA obtained by interchanging final and non-final states will be complement of the given regular language. So, to prove that a family of string is accepted by complement of L, we will in turn prove that it is rejected by L. (A). Set of all strings that do not end with ab - This statement could be proved right by looking at the b labeled incident edges on the final states and a labeled edges preceding them. Complement of the given DFA will have first two states as final states. First state doesn’t have any b labeled edge that has a labeled edge prior to it. Similarly, second final state doesn’t have any such required b labeled edge. Similarly, it could be proven that all the strings accepted by the given DFA end with ab. Now that L ∪ complement(L) = (a + b) ∗ , L should be the set of all the strings ending on ab and complement(L) should be set of all the strings that do not end with ab. [CORRECT] (B). Set of all strings that begin with either an a or ab - This statement is incorrect. To prove that we just have to show that a string beginning with a or ab exists, which is accepted by the given DFA. String abaab is accepted by the given DFA, hence it won’t be accepted by its complement. [INCORRECT] (C). Set of all strings that do not contain the substring ab - To prove this statement wrong, we need to show that a string exists which doesn’t contain the substring ab and is not accepted by current DFA. Hence, it will be accepted by its complement, making this statement wrong. String aba is not accepted by this DFA. [INCORRECT] (D). The set described by the regular expression b ∗ aa ∗ (ba) ∗ b ∗ - String abaaaba is not accepted by the given DFA, hence accepted by its com This solution is contributed by vineet purswani.
Question 31
Consider the following languages.

L1 = {ai bj ck | i = j, k ≥ 1}
L1 = {ai bj | j = 2i, i ≥ 0}
Which of the following is true?
A
L1 is not a CFL but L2 is
B
L1 ∩ L2 = ∅ and L1 is non-regular
C
L1 ∪ L2 is not a CFL but L2 is
D
There is a 4-state PDA that accepts L1, but there is no DPDA that accepts L2
Regular languages and finite automata    Context free languages and Push-down automata    Gate IT 2008    
Discuss it


Question 31 Explanation: 
A: Both L1 and L2 are CFL
B: L1 ∩ L2 = ∅ is true
L1is not regular => true
=> B is true
C: L1 ∪ L2 is not a CFL nut L2 is CFL is closed under Union
=> False
D: Both L1 and L2 accepted by DPDA
Question 32
Consider a CFG with the following productions. S → AA | B A → 0A | A0 | 1 B → 0B00 | 1 S is the start symbol, A and B are non-terminals and 0 and 1 are the terminals. The language generated by this grammar is
A
{0n 102n | n ≥ 1}
B
{0i 10j 10k | i, j, k ≥ 0} ∪ {0n 102n | n ≥ l}
C
{0i 10j | i, j ≥ 0} ∪ {0n 102n | n ≥ l}
D
The set of all strings over {0, 1} containing at least two 0's
E
None of the above
Context free languages and Push-down automata    Gate IT 2008    
Discuss it


Question 32 Explanation: 
  A− > 0A|A0|1 This production rule individually produces a CFL of the form {0i 10j |i, j ≥ 0} B− > 0B00|1 This production rule individually produces a CFL of the form {0n102n |n ≥ 0} S− > AA|B This production rule concatenates A’s CFL with itself and unions it with B’s CFL. Hence, CFL accepted by the given CFG will be {0n102n|n ≥ 0} ∪ {0i 10j 10k |i, j, k ≥ 0} According to our derivation, as none of the given CFL matches to our derived CFL, correct option should be (E) None of the above. This solution is contributed by vineet purswani.
Question 33
Which of the following languages is (are) non-regular? L1 = {0m1n | 0 ≤ m ≤ n ≤ 10000} L2 = {w | w reads the same forward and backward} L3 = {w ∊ {0, 1} * | w contains an even number of 0's and an even number of 1's}
A
L2 and L3 only
B
L1 and L2 only
C
L3 only
D
L2 only
Regular languages and finite automata    Gate IT 2008    
Discuss it


Question 33 Explanation: 
  1. L 1 is a regular language, as it can be derived by a trivial DFA with 10000 states for each alphabet in the grammar to limit on the number of 0s and 1s to 10000. 2. L 2 is a set of all palindromic strings, which isn’t a regular language because there is no way for a finite automaton to remember which alphabets have occurred. 3. L 3 is a standard regular language as there exists a DFA which can derive this language. You can read more in the references about it. Reference : http://stackoverflow.com/questions/17420332/need-regular-expression-for-finite-automata-eve 17434694#17434694 This solution is contributed by vineet purswani.
Question 34
Consider the following two finite automata. M1 accepts L1 and M2 accepts L2.
2008_36
Which one of the following is TRUE?
A
L1 = L2
B
L1 ⊂ L2
C
L1 ∩ L2' = ∅
D
L1 ∪ L2 ≠ L1
Regular languages and finite automata    Gate IT 2008    
Discuss it


Question 34 Explanation: 
2008_36_sol
Question 35
Consider the following state diagram and its realization by a JK flip flop
2008_37
The combinational circuit generates J and K in terms of x, y and Q.
The Boolean expressions for J and K are :
A
(x⊕y)'and x'⊕y'
B
(x⊕y)'and x⊕y
C
x⊕y and (x⊕y)'
D
x⊕yand x⊕y
Digital Logic & Number representation    Gate IT 2008    
Discuss it


Question 36
Assume that EA = (X)+ is the effective address equal to the contents of location X, with X incremented by one word length after the effective address is calculated; EA = −(X) is the effective address equal to the contents of location X, with X decremented by one word length before the effective address is calculated; EA = (X)− is the effective address equal to the contents of location X, with X decremented by one word length after the effective address is calculated. The format of the instruction is (opcode, source, destination), which means (destination ← source op destination). Using X as a stack pointer, which of the following instructions can pop the top two elements from the stack, perform the addition operation and push the result back to the stack.
A
ADD (X)−, (X)
B
ADD (X), (X)−
C
ADD −(X), (X)+
D
ADD −(X), (X)+
Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 36 Explanation: 
 

Effective address is the address of the operand. In the given question format is (opcode, source, destination), destination ← source op destination Ex- ADD (X),(Y) -&gt; Source=location X Destination=location Y Operand at Y=operand at X +operand at Y

Here, -X = decrement pointer X and then use the new location pointed by pointer for the operand. +X = increment pointer X and then use the new location pointed by pointer for the operand. X- = decrement pointer X but first use the old location pointed by X. X+ = increment pointer X but first use the old location pointed by X.

Now stack pointer is pointing to X. Say X is 100.

shashank_67

Then,our output should pop the first two elements , i.e. 10 and 5 and put that result in memory location at 99.

1. ADD (X)- ,(X) ->  Take operand1 as data at memory location X and then decrement X. Operand1 taken as data memory location 100 = 10, X=X-1; X=99; Then take operand 2 as data at memory location new X , Operand2= 5; Now, push back their addition at location X,which is still 99 So, our result is location 99 is filled with 15 which is the desired result. 2.  ADD (X), (X)− Take operand1 as data at memory location X.Operand1 taken as data memory location 100 = 10, Then take operand 2 as data at memory location  X which is still 100, Operand 2= 10; Now, push back their addition at location X,which is 100 So,our result is location 100 is filled with 20 which is not the desired result. 3.  ADD -(X), (X)+ Decrement and then take operand1 as data at memory location X. So X=99; Operand1 taken as data memory location 99 = 5, Then increment and then take operand 2 as data at memory location X X=X+1; X=100; Operand 2= 10; Now, push back their addition at location X,which is 100 So,our result is location 100 is filled with 15 which is not the desired result. 4. ADD -(X), (X) Decrement and then take operand1 as data at memory location X. So X=99; Operand1 taken as data memory location 99 = 5, Then take operand 2 as data at memory location X which is 99 Operand 2= 5; Now, push back their addition at location X,which is 99 So,our result is location 99 is filled with 10 which is not the desired result.   This solution is contributed by Shashank Shanker khare .
Question 37
Consider a CPU where all the instructions require 7 clock cycles to complete execution. There are 140 instructions in the instruction set. It is found that 125 control signals are needed to be generated by the control unit. While designing the horizontal microprogrammed control unit, single address field format is used for branch control logic. What is the minimum size of the control word and control address register?
A
125, 7
B
125, 10
C
135, 7
D
135, 10
Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 37 Explanation: 
As each instruction akes 7 cycles
=> 140 instructions will take = 14*7 cycles
=> 2m>=980
=>m>=10 => 10+125 bits and 10 bits
Question 38
A non pipelined single cycle processor operating at 100 MHz is converted into a synchro­nous pipelined processor with five stages requiring 2.5 nsec, 1.5 nsec, 2 nsec, 1.5 nsec and 2.5 nsec, respectively. The delay of the latches is 0.5 nsec. The speedup of the pipeline processor for a large number of instructions is
A
4.5
B
4.0
C
3.33
D
3.0
Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 38 Explanation: 
For non pipelined system time required = 2.5+1.5+2.0+1.5+2.5 =10
for pipelined system = Max(stage delay)+Max(Latch delay)
=> 2.5+0.5 = 3.0
speedup = time in non-pipelined system/time in pipelined system
= 10/3 = 3.33
Question 39
Assume that a main memory with only 4 pages, each of 16 bytes, is initially empty. The CPU generates the following sequence of virtual addresses and uses the Least Recently Used (LRU) page replacement policy.
0, 4, 8, 20, 24, 36, 44, 12, 68, 72, 80, 84, 28, 32, 88, 92
How many page faults does this sequence cause? What are the page numbers of the pages present in the main memory at the end of the sequence?
A
6 and 1, 2, 3, 4
B
7 and 1, 2, 4, 5
C
8 and 1, 2, 4, 5
D
9 and 1, 2, 3, 5
Memory Management    Gate IT 2008    
Discuss it


Question 39 Explanation: 
2008_41_sol
Question 40
The two numbers given below are multiplied using the Booth's algorithm.
Multiplicand : 0101 1010 1110 1110
Multiplier: 0111 0111 1011 1101
How many additions/Subtractions are required for the multiplication of the above two numbers?
A
6
B
8
C
10
D
12
Analysis of Algorithms    Gate IT 2008    
Discuss it


Question 41
If we use Radix Sort to sort n integers in the range (nk/2,nk], for some k>0 which is independent of n, the time taken would be?
A
Θ(n)
B
Θ(kn)
C
Θ(nlogn)
D
Θ(n2)
Analysis of Algorithms    Sorting    RadixSort    Gate IT 2008    
Discuss it


Question 41 Explanation: 
Radix sort time complexity = O(wn)
for n keys of word size= w
=>w = log(nk)
O(wn)=O(klogn.n)
=> kO(nlogn)
Question 42
When n = 22k for some k ≥ 0, the recurrence relation
T(n) = √(2) T(n/2) + √n, T(1) = 1
evaluates to :
A
√(n) (log n + 1)
B
√(n) (log n )
C
√(n) log √(n)
D
n log √(n)
Analysis of Algorithms (Recurrences)    Gate IT 2008    
Discuss it


Question 42 Explanation: 
Please note that the question is asking about exact solution. Master theorem provides results in the form of asymptotic notations. So we can't apply Master theorem here. We can solve this recurrence using simple expansion or recurrence tree method.
T(n) = √(2) T(n/2) + √n
     = √(2) [√(2) T(n/4) + √(n/2) ] + √n
     = 2 T(n/4) + √2 √(n/2) +√n
     = 2[ √2 T(n/8) + √(n/4) ]+√2 √(n/2)+√n
     = √(2^3) T(n/8)+ 2 √(n/4) + √2 √(n/2) +√n
     = √(2^3) T(n/8)+√n +√n +√n
     = √(2^3) T(n/(2^3))+3√n
     .............................................
     = √(2^k) T(n/(2^k))+k√n
     = √(2^logn) + logn √n
     = √n + logn √n
     = √n(logn +1)
Question 43
For the undirected, weighted graph given below, which of the following sequences of edges represents a correct execution of Prim's algorithm to construct a Minimum Span­ning Tree?
2008_45
A
(a, b), (d, f), (f, c), (g, i), (d, a), (g, h), (c, e), (f, h)
B
(c, e), (c, f), (f, d), (d, a), (a, b), (g, h), (h, f), (g, i)
C
(d, f), (f, c), (d, a), (a, b), (c, e), (f, h), (g, h), (g, i)
D
(h, g), (g, i), (h, f), (f, c), (f, d), (d, a), (a, b), (c, e)
Graph    Gate IT 2008    
Discuss it


Question 43 Explanation: 
In prims algorithm we start with any node and keep on exploring minimum cost neighbors of nodes already covered.
Question 44
The following three are known to be the preorder, inorder and postorder sequences of a binary tree. But it is not known which is which.
MBCAFHPYK
KAMCBYPFH
MABCKYFPH
Pick the true statement from the following.
A
I and II are preorder and inorder sequences, respectively
B
I and III are preorder and postorder sequences, respectively
C
II is the inorder sequence, but nothing more can be said about the other two sequences
D
II and III are the preorder and inorder sequences, respectively
Binary Trees    Tree Traversals    Gate IT 2008    
Discuss it


Question 44 Explanation: 
The approach to solve this question is to first find 2 sequences whose first and last element is same. The reason being first element in the Pre-order of any binary tree is the root and last element in the Post-order of any binary tree is the root. Looking at the sequences given, Pre-order   =   KAMCBYPFH Post-order  =  MBCAFHPYK Left-over sequence  MABCKYFPH will be in order. Since we have all the traversals identified, let's try to draw the binary tree if possible. pranjul I. Post order
II. Pre order
III. Inorder This solution is contributed by Pranjul Ahuja.
Question 45
Consider the following sequence of nodes for the undirected graph given below.
a b e f d g c
a b e f c g d
a d g e b c f
a d b c g e f
A Depth First Search (DFS) is started at node a. The nodes are listed in the order they are first visited. Which all of the above is (are) possible output(s)?
2008_46
A
1 and 3 only
B
2 and 3 only
C
2, 3 and 4 only
D
1, 2, and 3
Tree Traversals    Gate IT 2008    
Discuss it


Question 45 Explanation: 
1: abef->c or g should be covered
4: adbc->e or f should be covered
2: abefcgd correct
3: adgebcf correct
Question 46
Consider a hash table of size 11 that uses open addressing with linear probing. Let h(k) = k mod 11 be the hash function used. A sequence of records with keys
43 36 92 87 11 4 71 13 14
is inserted into an initially empty hash table, the bins of which are indexed from zero to ten. What is the index of the bin into which the last record is inserted?
A
2
B
4
C
6
D
7
Gate IT 2008    
Discuss it


Question 46 Explanation: 
2008_48_sol
Question 47
What is the output printed by the following C code?
# include <stdio.h>
int main ()
{
    char a [6] = "world";
    int i, j;
    for (i = 0, j = 5; i < j; a [i++] = a [j--]);
    printf ("%s\n", a);
}
 /* Add code here. Remove these lines if not writing code */ 
A
dlrow
B
Null String
C
dlrld
D
worow
Arrays    C Quiz - 113    Gate IT 2008    
Discuss it


Question 47 Explanation: 
As at the base address or starting of the string "Null" is placed, so while reading array if Null comes it assumes that this is the end of array, so it terminates here only.
Question 48
Consider the C program below. What does it print?
# include <stdio.h>
# define swapl (a, b) tmp = a; a = b; b = tmp
void swap2 ( int a, int b)
{
        int tmp;
        tmp = a; a = b; b = tmp;
 }
void swap3 (int*a, int*b)
{
        int tmp;
        tmp = *a; *a = *b; *b = tmp;
}
int main ()
{
        int num1 = 5, num2 = 4, tmp;
        if (num1 < num2) {swap1 (num1, num2);}
        if (num1 < num2) {swap2 (num1 + 1, num2);}
        if (num1 > = num2) {swap3 (&num1, &num2);}
        printf ("%d, %d", num1, num2);
}
 /* Add code here. Remove these lines if not writing code */ 
A
5, 5
B
5, 4
C
4, 5
D
4, 4
Pointer Basics    C Quiz - 113    Gate IT 2008    
Discuss it


Question 48 Explanation: 
"if (num1 > = num2) {swap3 (&num1, &num2);}" statement is true, so call by reference will be performed.
Question 49
Consider the C program given below. What does it print?

#include <stdio.h>
int main ()
{
        int i, j;
        int a [8] = {1, 2, 3, 4, 5, 6, 7, 8};
        for(i = 0; i < 3; i++) {
             a[i] = a[i] + 1;
             i++;
        }
        i--;
        for (j = 7; j > 4; j--) {
              int i = j/2;
              a[i] = a[i] - 1;
        }
        printf ("%d, %d", i, a[i]);
}
 /* Add code here. Remove these lines if not writing code */ 
A
2, 3
B
2, 4
C
3, 2
D
3, 3
Arrays    C Quiz - 113    Gate IT 2008    
Discuss it


Question 49 Explanation: 
Be careful about the scope of i,
there are two variables named: i, with different scope. There are 2 main points to consider while solving this question. Scope of variable i and integer division. First for loop will run for i = 0, 2 and 4 as i is incremented twice inside loop and resultant array will be a  = 2, 2, 4, 4, 5, 6, 7, 8  (Loop will terminate at i = 4) After that i value is 3 as there is a decrement operation after for loop. Next for loop is running for j = 7, 6 and 5 and corresponding i values which is a local variable inside for loop will be 3 (7/2), 3 (6/2) and 2 (5/2). Array after this for loop will be a  = 2, 2, 3, 2, 5, 6, 7, 8 After the for loop, current i value is 3 and element at a[3] = 2. This solution is contributed by Pranjul Ahuja.
Question 50
C program is given below:
# include <stdio.h>
int main ()
{
        int i, j;
        char a [2] [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}};
        char b [3] [2];
        char *p = *b;
        for (i = 0; i < 2; i++) {
              for (j = 0; j < 3; j++) {
              *(p + 2*j + i) = a [i] [j];
              }
        }
}
 /* Add code here. Remove these lines if not writing code */ 
What should be the contents of the array b at the end of the program?
A
a b
c d
e f
B
a d
b e
c f
C
a c
e b
d f
D
a e
d c
b f
Arrays    C Quiz - 113    Gate IT 2008    
Discuss it


Question 50 Explanation: 
*p= a[0][0]
*(p+2) = a[0][1] *(p+4) = a[0][2] *(p+1) = a[1][0] *(p+3) = a[1][1] *(p+5) = a[1][2]
Question 51
The following is a code with two threads, producer and consumer, that can run in parallel. Further, S and Q are binary semaphores equipped with the standard P and V operations. semaphore S = 1, Q = 0; integer x; producer:                            consumer: while (true) do                    while (true) do P(S);                                      P(Q); x = produce ();                    consume (x); V(Q);                                     V(S); done                                       done Which of the following is TRUE about the program above?
A
The process can deadlock
B
One of the threads can starve
C
Some of the items produced by the producer may be lost
D
Values generated and stored in 'x' by the producer will always be consumed before the producer can generate a new value
Process Management    Gate IT 2008    
Discuss it


Question 51 Explanation: 
A semaphore is hardware or a software tag variable whose value indicates the status of a common resource. Its purpose is to lock the resource being used. A process which needs the resource will check the semaphore for determining the status of the resource followed by the decision for proceeding. In multitasking operating systems, the activities are synchronized by using the semaphore techniques. wait and signal are defined on the semaphore. Entry to the critical section is controlled by the wait operation and exit from a critical region is taken care by signal operation. The wait, signal operations are also called P and V operations. The manipulation of semaphore (S) takes place as following: 1. The wait command P(S) decrements the semaphore value by 1. If the resulting value becomes negative then P command is delayed until the condition is satisfied. 2. The V(S) i.e. signals operation increments the semaphore value by 1. Solution: Consumer can consume only once the producer has produced the item, and producer can produce(except the first time) only once the consumer has consumed the item. Let’s explain the working of this code. It is mentioned that Producer and Consumer execute parallely. Producer: st1 - S value is 1, P(S) on S makes it 0 and st2 - and then x item is produced. st3 - Q value is 0. V(Q) on Q makes it 1. this being an infinite while loop should infinitely iterate. In the next iteration of while loop, S is already 0 ,further P(S) on 0 sends P to blocked list of S. So producer is blocked. Consumer: P(Q) on Q makes Q =0 and then consumes the item. V(S) on S, now instead of changing the value of S to 1,consumer wakes up the blocked process on Q 's queue. Hence process P is awaken. P resumes from st2,since it was blocked at statement 1. So P now produces the next item. So consumer consumes an item before producer produces the next item. Correct Option is (D). Choice of this question: A) deadlock cannot happen has both producer and consumer are operating on different semaphores (no hold and wait ) B) No starvation happen because there is alteration between P and Consumer Which also makes them have bounded waiting. (C) Some of the items produced by the producer may be lost but it can’t.
Reference: http://www.geeksforgeeks.org/mutex-vs-semaphore/
This solution is contributed by Nitika Bansal
Question 52
An operating system implements a policy that requires a process to release all resources before making a request for another resource. Select the TRUE statement from the following:
A
Both starvation and deadlock can occur
B
Starvation can occur but deadlock cannot occur
C
Starvation cannot occur but deadlock can occur
D
Neither starvation nor deadlock can occur
Process Management    Gate IT 2008    
Discuss it


Question 52 Explanation: 
Starvation may occur, as a process may want othe resource in ||<sup>al</sup> along with currently hold resources. <br> According to given conditions it will never be possible to collect all at a time.<br> No deadlock.
Question 53
If the time-slice used in the round-robin scheduling policy is more than the maximum time required to execute any process, then the policy will
A
degenerate to shortest job first
B
degenerate to priority scheduling
C
degenerate to first come first serve
D
none of the above
Process Management    Gate IT 2008    
Discuss it


Question 53 Explanation: 
RR executes processes in FCFS manner with a time slice. It this time slice becomes long enough, so that a process finishes within it, It becomes FCFS.
Question 54
Match the following flag bits used in the context of virtual memory management on the left side with the different purposes on the right side of the table below.
2008_56
A
I-d, II-a, III-b, IV-c
B
I-b, II-c, III-a, IV-d
C
I-c, II-d, III-a, IV-b
D
I-b, II-c, III-d, IV-a
Memory Management    Gate IT 2008    
Discuss it


Question 55
Which of the following are NOT considered when computing function points for a software project?
  • (O1) External inputs and outputs
  • (O2) Programming language to be used for the implementation
  • (O3) User interactions
  • (O4) External interfaces
  • (O5) Number of programmers in the software project
  • (O6) Files used by the system
A
O2, O3
B
O1, O5
C
O4, O6
D
O2, O5
Software Engineering    Gate IT 2008    
Discuss it


Question 55 Explanation: 
Unadjusted F.P. = No. of Inputs+No of Files+No of O/P + no of enquieries
Question 56
A software project plan has identified ten tasks with each having dependencies as given in the following table: Task        Depends On T1                 - T2                T1 T3                T1 T4                T1 T5                T2 T6                T3 T7                T3, T4 T8               T4 T9               T5, T7, T8 T10             T6, T9 Answer the following questions: (Q1) What is the maximum number of tasks that can be done concurrently? (Q2) What is the minimum time required to complete the project, assuming that each task requires one time unit and there is no restriction on the number of tasks that can be done in parallel ?
A
5, 5
B
4, 5
C
5, 4
D
4, 4
Software Engineering    Gate IT 2008    
Discuss it


Question 56 Explanation: 
2008_58_sol
Question 57
A software engineer is required to implement two sets of algorithms for a single set of matrix operations in an object oriented programming language; the two sets of algo­rithms are to provide precisions of 10-3and 10-6, respectively. She decides to implement two classes, Low Precision Matrix and High Precision Matrix, providing precisions 10-3and 10-6 respectively. Which one of the following is the best alternative for the imple­mentation?
  • (S1)  The two classes should be kept independent.
  • (S2)  Low Precision Matrix should be derived from High Precision Matrix.
  • (S3)  High Precision Matrix should be derived from Low Precision Matrix.
  • (S4)  One class should be derived from the other; the hierarchy is immaterial.
A
S1
B
S2
C
S3
D
S4
Software Engineering    Gate IT 2008    
Discuss it


Question 58
Which of the following requirement specifications can be validated?<br> (S1)  If the system fails during any operation, there should not be any loss of data<br> (S2)  The system must provide reasonable performance even under maximum load conditions<br> (S3)  The software executable must be deployable under MS Windows 95, 2000 and XP<br> (S4)  User interface windows must fit on a standard monitor's screen
A
S4 and S3
B
S4 and S2
C
S3 and S1
D
S2 and S1
Software Engineering    Gate IT 2008    
Discuss it


Question 58 Explanation: 
S2: What is meaning of reasonable performance? S4: How to decide standard size of monitor.
Question 59
Let R (A, B, C, D) be a relational schema with the following functional dependencies:
A → B, B → C,
C → D and D → B. 

The decomposition of R into 
(A, B), (B, C), (B, D)
A
gives a lossless join, and is dependency preserving
B
gives a lossless join, but is not dependency preserving
C
does not give a lossless join, but is dependency preserving
D
does not give a lossless join and is not dependency preserving
Gate IT 2008    
Discuss it


Question 59 Explanation: 
Background :
  • Lossless-Join Decomposition:
    Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional dependencies are in F+ (Closure of functional dependencies)

        R1 ∩ R2 → R1
       OR
        R1 ∩ R2 → R2
    
  • Dependency Preserving Decomposition:
    Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies after decomposition is same as closure of of FDs before decomposition.
    A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposition.

Question : Let R (A, B, C, D) be a relational schema with the following functional dependencies:
A -> B, B -> C,
C -> D and D -> B. 

The decomposition of R into 
(A, B), (B, C), (B, D)
Note that A, B, C and D are all key attributes. We can derive all attributes from every attribute. Since Intersection of all relations is B and B derives all other attributes, relation is lossless. The relation is dependency preserving as well as all functional dependencies are preserved directly or indirectly. Note that C -> D is also preserved with following two C -> B and B -> D.
Question 60
Let R (A, B, C, D, E, P, G) be a relational schema in which the following functional depen­dencies are known to hold: AB → CD, DE → P, C → E, P → C and B → G. The relational schema R is
A
in BCNF
B
in 3NF, but not in BCNF
C
in 2NF, but not in 3NF
D
not in 2NF
Database Design(Normal Forms)    Gate IT 2008    
Discuss it


Question 60 Explanation: 
Candidate key = AB
B->G is partial dependency
So, not in 2NF
Question 61
Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the following NYO represents the action Y (R for read, W for write) performed by transac­tion N on object O.]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
Which of the following statements is TRUE?
A
S1, S2 and S3 are all conflict equivalent to each other
B
No two of S1, S2 and S3 are conflict equivalent to each other
C
S2 is conflict equivalent to S3, but not to S1
D
S1 is conflict equivalent to S2, but not to S3
Transactions and concurrency control    Gate IT 2008    
Discuss it


Question 61 Explanation: 
2008_63_sol All the conflicting pairs like (3WA, 1WA) are in the same order in both S1 and S2.
Question 62
A 1Mbps satellite link connects two ground stations. The altitude of the satellite is 36,504 km and speed of the signal is 3 × 108 m/s. What should be the packet size for a channel utilization of 25% for a satellite link using go-back-127 sliding window protocol? Assume that the acknowledgment packets are negligible in size and that there are no errors during communication.
A
120 bytes
B
60 bytes
C
240 bytes
D
90 bytes
Data Link Layer    Gate IT 2008    
Discuss it


Question 62 Explanation: 
2008_64_sol
Question 63
The minimum frame size required for a CSMA/CD based computer network running at 1 Gbps on a 200m cable with a link speed of 2 × 108m/s is
A
125 bytes
B
250 bytes
C
500 bytes
D
None of these
Data Link Layer    Misc    Gate IT 2008    
Discuss it


Question 63 Explanation: 
2008_65_sol
Question 64
Data transmitted on a link uses the following 2D parity scheme for error detection: Each sequence of 28 bits is arranged in a 4×7 matrix (rows r0 through r3, and columns d7 through d1) and is padded with a column d0 and row r4 of parity bits computed using the Even parity scheme. Each bit of column d0 (respectively, row r4) gives the parity of the corresponding row (respectively, column). These 40 bits are transmitted over the data link.
2008_66
The table shows data received by a receiver and has n corrupted bits. What is the mini­mum possible value of n?
A
1
B
2
C
3
D
4
Data Link Layer    Gate IT 2008    
Discuss it


Question 64 Explanation: 
(r1,d5)->1, (r4,d2)->0, (d4,d0)->1
=> n=3
Question 65
Two popular routing algorithms are Distance Vector(DV) and Link State (LS) routing. Which of the following are true?
(S1) Count to infinity is a problem only with DV and not LS routing
(S2) In LS, the shortest path algorithm is run only at one node
(S3) In DV, the shortest path algorithm is run only at one node
(S4) DV requires lesser number of network messages than LS
A
S1, S2 and S4 only
B
S1, S3 and S4 only
C
S2 and S3 only
D
S1 and S4 only
Network Layer    Gate IT 2008    
Discuss it


Question 65 Explanation: 
Shortest path algorithm runs on all nodes in both LS and DV
Question 66
Which of the following statements are TRUE?
(S1) TCP handles both congestion and flow control
(S2) UDP handles congestion but not flow control
(S3) Fast retransmit deals with congestion but not flow control
(S4) Slow start mechanism deals with both congestion and flow control
A
S1, S2 and S3 only
B
S1 and S3 only
C
S3 and S4 only
D
S1, S3 and S4 only
Transport Layer    Gate IT 2008    
Discuss it


Question 66 Explanation: 
1: with the help of TCP window=>flow control and with the help of congestion window=> Congestion control
2: No field are there in UDP header to control flow or congestion
3: It is used by TCP to overcome the problem of out of order segments by re-transmission
4: Slow start, nothing to do with flow control
Question 67
The three way handshake for TCP connection establishment is shown below.

2008_69
Which of the following statements are TRUE?
(S1) Loss of SYN + ACK from the server will not establish a connection
(S2) Loss of ACK from the client cannot establish the connection
(S3) The server moves LISTEN → SYN_RCVD → SYN_SENT → ESTABLISHED in the state machine on no packet loss
(S4) The server moves LISTEN → SYN_RCVD → ESTABLISHED in the state machine on no packet loss.
A
S2 and S3 only
B
S1 and S4
C
S1 and S3
D
S2 and S4
Transport Layer    Gate IT 2008    
Discuss it


Question 67 Explanation: 
Before Three Way Hand Shake both client and server are in closed state for start sending or receiving both client and server comes in Listen state. Steps: 1) Client sent SYN packet which will be received by the server. 2) Server will SYN + ACK packet so as to establish the connection of client. Now Client is ready to send the data. 3) Then Client will send ACK packet to server when this packet is received by server the server will also be in established state. Loss of SYN + ACK will not result in connection establishment of Client and thus it will not be able to send data to server. While ACK from client is not necessary because if client will send data packet immediately, it will considered as acknowledgement for the server . tcp This explanation has been contributed by Abhishek Kumar.
Question 68
The total number of keys required for a set of n individuals to be able to communicate with each other using secret key and public key crypto-systems, respectively are:
A
n(n-1) and 2n
B
2n and ((n(n - 1))/2)
C
((n(n - 1))/2) and 2n
D
((n(n - 1))/2) and n
Network Security    Gate IT 2008    
Discuss it


Question 68 Explanation: 
If there are 2 individuals then total number of distinct keys for communication will be 1 Similarly for 3 individuals we will need 2 distinct keys. Like ways for n users we will need n-1 keys So, total number of keys will be 1+2+3+…n-1 = (n (n-1)/2) Now for a public key encryption scheme every individual will have two keys one public key and one private key. Therefore, for n individuals to communicate we will have 2* n keys Hence, the correct answer will be ((n(n – 1))/2) and 2n. This solution is contributed by Namita Singh.
Question 69
A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys.

I. 81, 537, 102, 439, 285, 376, 305
II. 52, 97, 121, 195, 242, 381, 472
III. 142, 248, 520, 386, 345, 270, 307
IV. 550, 149, 507, 395, 463, 402, 270

Suppose the BST has been unsuccessfully searched for key 273. Which all of the above sequences list nodes in the order in which we could have encountered them in the search?
A
II and III only
B
I and III only
C
III and IV only
D
III only
Binary Search Trees    Gate IT 2008    
Discuss it


Question 69 Explanation: 
Key to be searched 273:
  • I) 81, 537, 102, 439, 285, 376, 305 is not correct We cannot go to 376 from 285 as 273 is smaller than 285.
  • II) 52, 97, 121, 195, 242, 381, 472 is not correct. We cannot go to 472 from 381 as 273 is smaller than 381.
  • III) 142, 248, 520, 386, 345, 270, 307 is correct 2008_71_sol
  • 550, 149, 507, 395, 463, 402, 270 is not correct. We cannot go to 463 from 395 in search of 273
Question 70
A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys.
I. 81, 537, 102, 439, 285, 376, 305
II. 52, 97, 121, 195, 242, 381, 472
III. 142, 248, 520, 386, 345, 270, 307
IV. 550, 149, 507, 395, 463, 402, 270
Which of the following statements is TRUE?
A
I, II and IV are inorder sequences of three different BSTs
B
I is a preorder sequence of some BST with 439 as the root
C
II is an inorder sequence of some BST where 121 is the root and 52 is a leaf
D
IV is a postorder sequence of some BST with 149 as the root
Binary Search Trees    Gate IT 2008    
Discuss it


Question 70 Explanation: 
A: I and IV are not in ascending order
B: If 439 is root, It should be 1st element in preorder
D: IV is a postorder sequence of some BST with 149 as the root, => False
Question 71
How many distinct BSTs can be constructed with 3 distinct keys?
A
4
B
5
C
6
D
9
Binary Search Trees    Gate IT 2008    
Discuss it


Question 71 Explanation: 
2nCn/(n+1) = 6C3/4 = 5
Question 72
Student (school-id, sch-roll-no, sname, saddress)
School (school-id, sch-name, sch-address, sch-phone)
Enrolment(school-id sch-roll-no, erollno, examname)
ExamResult(erollno, examname, marks)
What does the following SQL query output?
SELECT	sch-name, COUNT (*)
FROM	School C, Enrolment E, ExamResult R
WHERE	E.school-id = C.school-id
AND
E.examname = R.examname AND E.erollno = R.erollno
AND
R.marks = 100 AND S.school-id IN (SELECT school-id
                                FROM student
                                GROUP BY school-id
                                 HAVING COUNT (*) > 200)
GROUP By school-id
 /* Add code here. Remove these lines if not writing code */ 
A
for each school with more than 200 students appearing in exams, the name of the school and the number of 100s scored by its students
B
for each school with more than 200 students in it, the name of the school and the number of 100s scored by its students
C
for each school with more than 200 students in it, the name of the school and the number of its students scoring 100 in at least one exam
D
nothing; the query has a syntax error
SQL    Gate IT 2008    
Discuss it


Question 72 Explanation: 
In outer SQL query in SELECT sch-name is used where as in GROUP BY clause, school-id is used, that should be same as in SELECT clause.
Question 73
A binary tree with n > 1 nodes has n1, n2 and n3 nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbors.
n3 can be expressed as
A
n1 + n2 - 1
B
n1 - 2
C
[((n1 + n2)/2)]
D
n2 - 1
Binary Trees    Gate IT 2008    
Discuss it


Question 73 Explanation: 
2008_76_sol
Question 74
A binary tree with n > 1 nodes has n1, n2 and n3 nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbors.
Starting with the above tree, while there remains a node v of degree two in the tree, add an edge between the two neighbors of v and then remove v from the tree. How many edges will remain at the end of the process?
A
2 * n1 - 3
B
n2 + 2 * n1 - 2
C
n3 - n2
D
n2 + n1 - 2
Binary Trees    Gate IT 2008    
Discuss it


Question 74 Explanation: 
With reference to figure of answer of previous question: 2008_77_sol
Question 75
A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.
S→aS∣A
A→aAb∣bAa∣ϵ
Which of the following strings is generated by the grammar above?
A
aabbaba
B
aabaaba
C
abababb
D
aabbaab
Context free languages and Push-down automata    Gate IT 2008    
Discuss it


Question 75 Explanation: 
2008_78_sol
Question 76
A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.
S→aS∣A
A→aAb∣bAa∣ϵ
For the correct answer in Q75, how many steps are required to derive the string and how many parse trees are there?
A
6 and 1
B
6 and 2
C
7 and 2
D
4 and 2
Context free languages and Push-down automata    Parsing and Syntax directed translation    Gate IT 2008    
Discuss it


Question 76 Explanation: 
2008_78_sol
Question 77
Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB. The number of bits in the TAG, SET and WORD fields, respectively are:
A
7, 6, 7
B
8, 5, 7
C
8, 6, 6
D
9, 4, 7
Memory Management    Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 77 Explanation: 
  According to the question it is given that No. of bytes in a word= 1byte No. of words per block of memory= 128 words Total size of the cache memory= 8 KB So the total number of block can be calculated as under Cache size/(no. words per block* size of 1 word) = 8KB/( 128*1) =64 Since, it is given that the computer has a 4 way set associative memory. Therefore, Total number of sets in the cache memory given = number of cache blocks given/4 = 64/4 = 16 So, the number of SET bits required = 4 as 16= power(2, 4). Thus, with 4 bits we will be able to get 16 possible output bits As per the question only physical memory information is given we can assume that cache memory is physically tagged. So, the memory can be divided into 16 regions or blocks. Size of the region a single set can address = 1MB/ 16 = power(2, 16 )Bytes = power(2, 16) / 128 = power(2, 9) cache blocks Thus, to uniquely identify these power(2, 9) blocks we will need 9 bits to tag these blocks. Thus, TAG= 9 Cache block is 128 words so for indicating any particular block we will need 7 bits as 128=power(2,7). Thus, WORD = 7. Hence the answer will be (TAG, SET, WORD) = (9,4,7).   This solution is contributed by Namita Singh.
Question 78
Consider a computer with a 4-ways set-associative mapped cache of the following character­istics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB. While accessing the memory location 0C795H by the CPU, the contents of the TAG field of the corresponding cache line is
A
000011000
B
110001111
C
00011000
D
110010101
Memory Management    Computer Organization and Architecture    Gate IT 2008    
Discuss it


Question 78 Explanation: 
  TAG will take 9 bits SET will need 4 bits and WORD will need 7 bits of the cache memory location Thus, using the above conclusion as derived in previous question. The memory location 0C795H can be written as 0000 1100 0111 1001 0101 Thus TAG= 9 bits = 0000 1100 0 SET =4 bits =111 1 WORD = 7 bits =001 0101 Therefore, the matching option is option A.   This solution is contributed by Namita Singh .
Question 79
Consider the code fragment written in C below :
void f (int n)
{ 
  if (n <=1)  {
   printf ("%d", n);
  }
  else {
   f (n/2);
   printf ("%d", n%2);
  }
}
What does f(173) print?
A
010110101
B
010101101
C
10110101
D
10101101
Recursion    C Quiz - 112    Gate IT 2008    
Discuss it


Question 79 Explanation: 
(173)2 = 10101101
Question 80
Consider the code fragment written in C below :
void f (int n)
{
    if (n <= 1)  {
        printf ("%d", n);
    }
    else {
        f (n/2);
        printf ("%d", n%2);
    }
}
 
Which of the following implementations will produce the same output for f(173) as the above code? P1
void f (int n)
{
    if (n/2)  {
        f(n/2);
    }
    printf ("%d", n%2);
}
 
P2

void f (int n)
{
    if (n <=1)  {
        printf ("%d", n);
    }
    else {
        printf ("%d", n%2);
        f (n/2);
    }
}

A
Both P1 and P2
B
P2 only
C
P1 only
D
Neither P1 nor P2
Recursion    C Quiz - 112    Gate IT 2008    
Discuss it


Question 80 Explanation: 
  Here, basically the function f prints the binary representation of the number. function f1 also prints the binary representation of the number function f2 prints the binary representation but in reverse order. Output of f  is:- 10101101 Output of f1 is:- 10101101 Output of f2 is:- 10110101 So, the answer is option (C) which is P1 only. This solution is contributed  by Anil Saikrishna Devarasetty.
Question 81
Host X has IP address 192.168.1.97 and is connected through two routers R1 and R2 to an­other host Y with IP address 192.168.1.80. Router R1 has IP addresses 192.168.1.135 and 192.168.1.110. R2 has IP addresses 192.168.1.67 and 192.168.1.155. The netmask used in the network is 255.255.255.224.
Given the information above, how many distinct subnets are guaranteed to already exist in the network?
A
1
B
2
C
3
D
6
Network Layer    IP Addressing    Gate IT 2008    
Discuss it


Question 81 Explanation: 
Given IP addresses are of Class C
default Mask for class C = 24
Here given mask is 11 bits ( 11111111 11111111 11111111 11100000)
subnet ID: 3 bits
existing subnets: 011, 010 and 100
Question 82
Host X has IP address 192.168.1.97 and is connected through two routers R1 and R2 to an­other host Y with IP address 192.168.1.80. Router R1 has IP addresses 192.168.1.135 and 192.168.1.110. R2 has IP addresses 192.168.1.67 and 192.168.1.155. The netmask used in the network is 255.255.255.224.
Which IP address should X configure its gateway as?
A
192.168.1.67
B
192.168.1.110
C
192.168.1.135
D
192.168.1.155
IP Addressing    Gate IT 2008    
Discuss it


Question 82 Explanation: 
For: 192.168.1.110/28
For network address keep Network bits as it is and put host bits =0 in any given IP address.
Network address = 192.168.1.01100000 =>192.168.1.96
For: 192.168.1.97/28
Network address = 192.168.1.01100000 =>192.168.1.96
There are 82 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.