Compiler Design Questions and Answers - Finite Automata Part-2

1. A finite automata recognizes ____________
a) Any Language
b) Context Sensitive Language
c) Context Free Language
d) Regular Language

Answer: d
Explanation: All regular languages are implemented by finite automata.

2. Which of the following statement is true for Dead State?
a) It cannot be reached anytime
b) There is no necessity of the state
c) If control enters no way to come out from the state
d) If control enters FA deads

Answer: c
Explanation: It is a rejecting state for if the control enters it reaches the dead end and cannot reach an accepting state.

3. Which of the following statement is true for Moore Machine?
a) Output depends on present state
b) Output depends on present input
c) Output depends on present state and present input
d) Output depends on present state and past input

Answer: a
Explanation: The definition states that moore machines output is determined by the current state only.

4. Which of the following statement is true for Mealy Machine?
a) Output depends on present state
b) Output depends on present input
c) Output depends on present state and present input
d) Output depends on present state and past input

Answer: c
Explanation: The definition states that its output is determined by current state and current input.

5. Which is true for in accessible state?
a) It cannot be reached anytime
b) There is no necessity of the state
c) If control enters no way to come out from the state
d) If control enters FA deads

Answer: a
Explanation: The very meaning of in accessible state is that it cannot be reached at any point of time.

6. In Mealy Machine O/P is associated with ____________
a) Present state
b) Next state
c) Input
d) None of the mentioned

Answer: b
Explanation: The definition states that its output is determined by current state and current input.

7. In Moore Machine O/P is associated with ____________
a) Present state
b) Next state
c) Input
d) None of the mentioned

Answer: a
Explanation: The definition states that moore machines output is determined by the current state only.

8. Which type of string is accepted by the following finite automata?
a) All string
b) Null string
c) No string
d) None of the mentioned

Answer: b
Explanation: Null strings are not accepted by finite automata.

9. Myhill-Nerode Theorem is used for __________
a) Minimization of DFA
b) Maximization of NFA
c) Conversion of NFA
d) Conversion of DFA

Answer: a
Explanation: Myhill–Nerode theorem provides a necessary and sufficient condition for a language to be regular. The Myhill–Nerode theorem can be generalized to trees. And used for minimization of DFA.

10. Conversion of a DFA to an NFA __________
a) Is impossible
b) Requires the subset construction
c) Is Chancy
d) Is nondeterministic

Answer: b
Explanation: In order to convert NDFA to DFA we work with sets of state where each state in the DFA corresponds to a set of NFA states.