COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following options is correct?Statement 1:Initial State of NFA is Initial State of DFA.Statement 2:The final state of DFA will be every combination of final state of NFA.
A
Statement 1 is true and Statement 2 is true
B
Statement 1 is true and Statement 2 is false
C
Statement 1 can be true and Statement 2 is true
D
Statement 1 is false and Statement 2 is also false
Explanation: 

Detailed explanation-1: -Which of the following options is correct? Statement 1: Initial State of NFA is Initial State of DFA. Statement 2: The final state of DFA will be every combination of final state of NFA. Explanation: Statement 1 and 2 always true for a given Language.

Detailed explanation-2: -The correct answer is option 4. Option i: For every NFA with an arbitrary number of final states, there is an equivalent NFA with only one final state.

Detailed explanation-3: -Statement 1: Initial State of NFA is Initial State of DFA. This statement is true because when converting an NFA to a DFA, the initial state of the DFA is the epsilon closure of the initial state of the NFA.

Detailed explanation-4: -Formal definition of NFA: ∑: finite set of the input symbol. q0: initial state. F: final state. : Transition function.

Detailed explanation-5: -In particular, every DFA is also an NFA. Sometimes the term NFA is used in a narrower sense, referring to an NFA that is not a DFA, but not in this article. Using the subset construction algorithm, each NFA can be translated to an equivalent DFA; i.e., a DFA recognizing the same formal language.

There is 1 question to complete.