# GATE CS 2008

Question 2 |

Q ^{c} U R^{c} | |

P U Q ^{c} U R^{c} | |

P ^{c} U Q^{c} U R^{c} | |

U |

**Set Theory & Algebra**

**GATE CS 2008**

**Discuss it**

Question 3 |

0 | |

either 0 or 1 | |

one of 0, 1 or -1 | |

any real number | |

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

the normalized value 2 ^{-127} | |

the normalized value 2 ^{-126} | |

the normalized value +0 | |

the special value +0 |

**GATE CS 2008**

**Number Representation**

**Discuss it**

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?

A) B) C) D)

A | |

B | |

C | |

D |

**Digital Logic & Number representation**

**GATE CS 2008**

**Discuss it**

Question 6 |

decimal 10 | |

decimal 11 | |

decimal 10 and 11 | |

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 f

_{1}, f_{3}and f in canonical sum of products form (in decimal) for the circuitA) m(4, 6) B) m(4, 8) C) m(6, 8) D) m(4, 6, 8)

A | |

B | |

C | |

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

Question 8 |

It is not accepted by a Turing Machine | |

It is regular but not context-free | |

It is context-free but not regular | |

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 a

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.

^{p}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

I and II | |

I and IV | |

II and III | |

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?

It is the position in a sentential form where the next shift or reduce operation will occur
| |

It is non-terminal whose production will be used for reduction in the next step | |

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 | |

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 ->abbcdeHere { 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.