# Automata Theory | Set 3

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 8
- Automata Theory | Set 9
- Automata Theory | Set 7
- Automata Theory | Set 10
- Automata Theory | Set 4
- Automata Theory | Set 2
- Automata Theory | Set 5
- Automata Theory | Set 1
- Automata Theory | Set 6
- Theory of Computation | Applications of various Automata
- Theory of Computation | Generating regular expression from finite automata
- Construct Pushdown automata for L = {a
^{(2*m)}c^{(4*n)}d^{n}b^{m}| m,n ≥ 0} - TOC | Finite Automata with Output (Set 5)
- TOC | Finite Automata with Output (Set 3)
- Construct Pushdown automata for L = {0
^{(n+m)}1^{m}2^{n}| m, n ≥ 0}