Following questions have been asked in GATE CS 2011 exam.

**1) The lexical analysis for a modern language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?**

(A) Finite state automata

(B) Deterministic pushdown automata

(C) Non-deterministic pushdown automata

(D) Turing machine

Answer (A)

Lexical analysis is the first step in compilation. In lexical analysis, program is divided into tokens. Lexical analyzers are typically based on finite state automata. Tokens can typically be expressed as different regular expressions:

An identifier is given by [a-zA-Z][a-zA-Z0-9]*

The keyword if is given by if.

Integers are given by [+-]?[0-9]+.

**2) Which of the following pairs have DIFFERENT expressive power?**

(A) Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)

(B) Deterministic push down automata (DPDA) and Non-deterministic pushdown automata

(C) Deterministic single-tape Turing machine and Non-deterministic single-tape Turing Machine

(D) Single-tape Turing machine and multi-tape Turing machine

Answer (B)

DPDA cannot handle languages or grammars with ambiguity, but NDPDA can handle languages with ambiguity and any context-free grammar.

**3) A deterministic finite automation (DFA)D with alphabet ∑= {a,b} is given below**

**Which of the following finite state machines is a valid minimal DFA which accepts the same language as D?**

Answer (A)

Options (B) and (C) are invalid because they both accept ‘b’ as a string which is not accepted by give DFA. D is invalid because it accepts bb+a which are not accepted by given DFA.

Please see GATE Corner for all previous year paper/solutions/explanations, syllabus, important dates, notes, etc.

Please write comments if you find any of the answers/explanations incorrect, or you want to share more information about the topics discussed above.

## Recommended Posts:

- Automata Theory | Set 1
- Automata Theory | Set 5
- Automata Theory | Set 6
- Automata Theory | Set 4
- Automata Theory | Set 2
- Theory of Computation | Applications of various Automata
- Theory of Computation | Generating regular expression from finite automata
- Construct Pushdown automata for L = {0
^{n}1^{m}2^{m}3^{n}| m,n ≥ 0} - Construct Pushdown automata for L = {a
^{(2*m)}c^{(4*n)}d^{n}b^{m}| m,n ≥ 0} - Construct Pushdown automata for L = {0
^{n}1^{m}2^{(n+m)}| m,n ≥ 0} - TOC | Designing Deterministic Finite Automata (Set 2)
- Detailed Study of PushDown Automata
- TOC | Designing Deterministic Finite Automata (Set 1)
- Practice problems on finite automata | Set 2
- Practice problems on finite automata