GATE CS 2008


Question 1
1
A
1
B
-1
C
INF
D
-INF
Numerical Methods and Calculus    GATE CS 2008    
Discuss it


Question 1 Explanation: 
103
Question 2
If P, Q, R are subsets of the universal set U, then 2 
A
Qc U Rc
B
P U Qc U Rc
C
Pc U Qc U Rc
D
U
Set Theory & Algebra    GATE CS 2008    
Discuss it


Question 2 Explanation: 
104
Question 3
The following system of equations 6 has a unique solution. The only possible value(s) for α is/are
A
0
B
either 0 or 1
C
one of 0, 1 or -1
D
any real number
E
any real number other than 5
Numerical Methods and Calculus    GATE CS 2008    
Discuss it


Question 3 Explanation: 
The choice E was not there in GATE paper. We have added it as the given 4 choices don't seem correct.
Augment the given matrix as

1 1 2 | 1
1 2 3 | 2
1 4 a | 4

Apply R2 <- R2 - R1 and R3 <- R3 - R1

1 1 2 | 1
0 1 1 | 1
0 3 a-2 | 3

Apply R3 <- R3 - 3R2

1 1 2 | 1
0 1 1 | 1
0 0 a-5 | 0

So for the system of equations to have a unique solution,

a - 5 != 0
or

a != 5
or
a = R - {5} 
Thanks to Anubhav Gupta for providing above explanation. Readers can refer below MIT video lecture for linear algebra. https://www.youtube.com/watch?v=QVKj3LADCnA&index=2&list=PLE7DDD91010BC51F8
Question 4
In the IEEE floating point representation, the hexadecimal value 0 × 00000000 corresponds to
A
the normalized value 2-127 
B
the normalized value 2-126
C
the normalized value +0 
D
the special value +0 
GATE CS 2008    Number Representation    
Discuss it


Question 4 Explanation: 

106

Question 5
In the Karnaugh map shown below, X denotes a don't care term. What is the minimal form of the function represented by the Karnaugh map?
7

A) 8  


B) 9

C) 10

D) 11 
A
A
B
B
C
C
D
D
Digital Logic & Number representation    GATE CS 2008    
Discuss it


Question 5 Explanation: 
107
Question 6
Let r denote number system radix. The only value(s) of r that satisfy the equation 12
A
decimal 10
B
decimal 11
C
decimal 10 and 11
D
any value > 2
Digital Logic & Number representation    GATE CS 2008    
Discuss it


Question 6 Explanation: 
As we can see 121 contains digit ‘2’ which can’t be represented directly in base ‘2’ (as digits should be less than base) so number system must have   “r>2”. Ans (D) part.
Question 7
Given f1, f3 and f in canonical sum of products form (in decimal) for the circuit 14 15
A) sigma_Em(4, 6)

B) sigma_Em(4, 8)

C) sigma_Em(6, 8)

D) sigma_Em(4, 6, 8)
A
A
B
B
C
C
D
D
Digital Logic & Number representation    GATE CS 2008    
Discuss it


Question 7 Explanation: 
From logic diagram  we have f=f1.f2+f3 f=m(4,5,6,7,8).f2+m(1,6,15)----(1) from eq(1) we need to find such f2 so that we can get  f=m(1,6,8,15) eq(1)  says we can get m(1,6,15) from f3 ,so only  8 left now from option (a,b,d) we get (4,6), (4,8) ,(4,6,8) respectively for m(4,5,6,7,8)f2 which is not required as m4 is undesired. But option (D) m(4,5,6,7,8)(6,8)+(1,6,15)
  • m(6,8)+m(1,6,15)
  • m(1,6,8,15)an
s is  ( C) part.
Question 8
Which of the following is true for the language 16
A
It is not accepted by a Turing Machine
B
It is regular but not context-free
C
It is context-free but not regular
D
It is neither regular nor context-free, but accepted by a Turing machine
Recursively enumerable sets and Turing machines    GATE CS 2008    
Discuss it


Question 8 Explanation: 
Turing machine can be designed for ap using the concept of ‘Sieve of Eratosthenes’.
 
Suppose we are given an integer ‘n’ and we want to find out all the prime numbers less than or equal to ‘n’. We repeat the following steps : We find the smallest number in the list, declare it prime and eliminate all the multiples of that number from the list. We keep doing this until each element has been declared prime or eliminated from the list.
 
Now, if p = 0 or p = 1, we reject the input. Else, we replace the first and the last ‘a’ with symbol $.
 
In the above steps, what we do is we find the first non-black symbol from the left. Let this symbol occur at position ‘x’. Suppose ‘x’ is a prime number. If this non-blank symbol is $, input string will be accepted. But, if the symbol is ‘a’, we mark it as a* and replace all the multiples of ‘x’ with the symbol ‘blank’. If at the end, symbol $ is replaced with 'blank’, we reject the input string (because p will be multiple of some ‘x’ in that case). Else, we go back and repeat the steps.
 
Thus, the input is neither regular nor context-free, but is accepted by a Turing machine.
 
Please comment below if you find anything wrong in the above post.
Question 9
Which of the following are decidable?
I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free
A
I and II
B
I and IV
C
II and III
D
II and IV
Undecidability    GATE CS 2008    
Discuss it


Question 9 Explanation: 
(A) Intersection of two regular languages is regular and checking if a regular language is infinite is decidable. (B) Deciding regularity of a context free language is undecidable. We check if L(CFG) contains any string with length between n and 2n−1 , where n is the pumping lemma constant. If so, L(CFG) is infinite otherwise it is finite. (C) Equality problem is undecidable for all languages except in case of finite automata i.e. for regular languages. (D) We have to check if the grammar obeys the rules of CFG. If, it obeys such rules then it is decidable.  Thus, option (B) is correct. Please comment below if you find anything wrong in the above post.
Question 10
Which of the following describes a handle (as applicable to LR-parsing) appropriately?
A
It is the position in a sentential form where the next shift or reduce operation will occur
B
It is non-terminal whose production will be used for reduction in the next step
C
It is a production that may be used for reduction in a future step along with a position in the sentential form where the next shift or reduce operation will occur
D
It is the production p that will be used for reduction in the next step along with a position in the sentential form where the right hand side of the production may be found
Parsing and Syntax directed translation    GATE CS 2008    
Discuss it


Question 10 Explanation: 
Let's first understand the terminology used here. LR Parsing - Here 'L' stands for Left to Right screening of input string, and 'R' stands for Right Most Derivation in Reverse ( because it is about bottom-up parsing). Sentential Form - Suppose For a given Context Free Grammar G, we have a start symbol S, then to define Language generated by Grammar G, i.e. L(G), we start the derivation starting from S using the production rules of the grammar. After one complete derivation we get a string w which consists of only terminal symbols, i.e. w belongs to L(G). Then we can say that w is a sentence of the Grammar G. Now, while the derivation process, if it gets some form q, where q may contain some Non-terminal then we say that q is a sentential form of the Grammar G. Even the start symbol S is also the sentential form of the Grammar G ( because it also contains Non-terminal S).

For Ex :

Grammar is :

S-> aAcBe

A->Ab|b

B->d

Input string : abbcde

Derivation : ( Top-Down, Right Most Derivation)

S->aAcBe
->aAcde
->aAbcde
->abbcde 
Here { abbcde } is the sentence of the Grammar( because it contains only terminal symbols), and { S, aAcBe, aAcde, aAbcde } are the sentential forms of the G ( because these forms contain non-terminals during the derivation process ) Now, let's look at the question. The question is related to LR parsing which is a bottom-up parsing. Let's take the same grammar above, as it is a bottom up parsing we need to start from the string "abbcde" and try to get S using production rules.

: abbcde

->aAbcde ( using A-> b )

->aAcde ( using A-> Ab )

->aAcBe ( using B -> d )

->S ( using S-> aAcBe ) 
The above process is called reduction. The RHS of the Production which is being replaced by their LHS is called Handle, So , { b, Ab, d, aAcBe} are handles, and replacing it with its LHS is called Handle-Pruning. Hence option D suits best.
There are 85 questions to complete.

Company Wise Coding Practice    Topic Wise Coding Practice