Last Updated : 13 Dec, 2018

Convert to a DFA for the following NFA:

Stae 0 1
p {q, s} {q}
*q {r} {q, r}
r {s} {p}
*s φ {p}


Where, p is the starting state,
Both q ans s are final states.

Which of the following option is correct regarding DFA of above transition functions?
(A) There are 7 final states and 3 non-final states in DFA
(B) There are 6 final states and 6 non-final states in DFA
(C) There are 5 final states and 5 non-final states in DFA
(D) There are 5 final states and 3 non-final states in DFA


Answer: (A)

Explanation: The table for the equivalent DFA using the subset construction is:

State a b
{p} {q, s} {q}
*{q, s} {r} {p,q ,r}
*{q} {r} {q, r}
{r} {s} {p}
*{p, q, r} {q, r, s} {p, q, r}
*{q, r} {r, s} {p, q, r}
*{s} φ {p}
*{q, r, s} {r, s} {p, q, r}
*{r, s} {s} {p}
φ φ φ


Where, {p} is the starting state,
State {q, s}, {q}, {p, q, r}, {q, r}, {s}, {q, r, s}, {r, s} are final states.

There are total 10 states in DFA, in which 7 states are final and 3 states are non-final.

So, option (A) is correct.

Quiz of this Question


Share your thoughts in the comments