• edited by
21,833 views
70 70 votes

Match the following NFAs with the regular expressions they correspond to:

P
Q
R
S

 

  1. $\epsilon + 0\left(01^*1+00\right)^*01^*$

  2. $\epsilon + 0\left(10^*1+00\right)^*0$

  3. $\epsilon + 0\left(10^*1+10\right)^*1$

  4. $\epsilon + 0\left(10^*1+10\right)^*10^*$

  1. $P-2, Q-1, R-3, S-4$
  2. $P-1, Q-3, R-2, S-4$
  3. $P-1, Q-2, R-3, S-4$
  4. $P-3, Q-2, R-1, S-4$

15 Answers

0 0 votes
  • For NFA P: starting at the initial final state gives $\epsilon$, and any non-empty path goes up via $0$, loops back and forth via $01^*1$ or $00$, and ends by reaching the right accepting state using $0$ and looping with $1^*$, giving $\epsilon + 0(01^*1 + 00)^*01^*$, which matches expression 1 ($P - 1$).

  • For NFA Q: starting at the initial final state gives $\epsilon$, and moving up via $0$ allows looping through paths like $10^*1$ or $00$ before returning down to the start state via $0$, giving $\epsilon + 0(10^*1 + 00)^*0$, which matches expression 2 ($Q - 2$).

  • For NFA R: starting at the initial final state gives $\epsilon$, and moving up via $0$ allows looping through paths like $10^*1$ or $10$ before returning down via $1$, giving $\epsilon + 0(10^*1 + 10)^*1$, which matches expression 3 ($R - 3$).

  • For NFA S: starting at the initial final state gives $\epsilon$, and moving up via $0$ allows looping through paths like $10^*1$ or $10$ before ending at the right accepting state using $10^*$, giving $\epsilon + 0(10^*1 + 10)^*10^*$, which matches expression 4 ($S - 4$).

Combining all matches gives $P - 1, Q - 2, R - 3, S - 4$, which corresponds to option C.

0 0 votes

To determine the correct matching, we analyze the paths and accepting states for each Non-deterministic Finite Automaton (NFA) :

 

  • NFA P: The start state is an accepting state, which allows for the empty string $\epsilon$. From the top-left state, the automaton can loop back via the start state (a $00$ path) or via the top-right state (a $01^*1$ path). This forms a combined loop of $(01^*1 + 00)^*$. The automaton accepts by either returning to the start state (adding a final $0$) or stopping at the top-right state (adding a final $01^*$). This results in the regular expression $\epsilon + 0(01^*1 + 00)^*01^*$, matching expression 1.

  • NFA Q: The start state is the only accepting state. The loop at the top-left state is formed by returning from the start state ($00$) or returning from the top-right state ($10^*1$). Because it only accepts at the start state, every accepted non-empty string must end with a $0$ transition back from the top-left state. The regular expression is $\epsilon + 0(10^*1 + 00)^*0$, matching expression 2.

  • NFA R: The start state is the only accepting state, and the transition returning to it from the top-left is a $1$, making that loop component $10$. The loop through the non-accepting top-right state is $10^*1$. Accepting paths must end with the $1$ transition back to the start state. The regular expression is $\epsilon + 0(10^*1 + 10)^*1$, matching expression 3.

  • NFA S: This NFA shares the exact same transitions as R, but the top-right state is also an accepting state. This introduces additional accepting paths that terminate in the top-right state, ending with $10^*$. Combining the paths for both accepting states gives the regular expression $\epsilon + 0(10^*1 + 10)^*10^*$, matching expression 4.

The analysis yields the matching $P - 1, Q - 2, R - 3, S - 4$. This corresponds exactly to Option C.

ago
–2 –2 votes
for these kind of qst its better to go with trail and error (i.e by taking a valid string and by checking each FA but not to go with method) bcz this method takes lots of time which will kill around 5 mins

and i did like that (trail and error)
it takes
me only 2 mins.

OPTION IS C
• edited by
Answer:
Position:
Show:

Related questions

74 74 votes
4 answers 4 answers
35.6k
35.6k views
Kathleen asked Sep 12, 2014
35,560 views
Which of the following are NOT true in a pipelined processor?Bypassing can handle all RAW hazardsRegister renaming can eliminate all register carried WAR hazardsControl h...
93 93 votes
5 answers 5 answers
26.4k
26.4k views
Kathleen asked Sep 12, 2014
26,390 views
Given below are two finite state automata ( $\rightarrow$ indicates the start state and $F$ indicates a final state)$$\overset{Y}{\begin{array}{|l|l|l|}\hline \text{} & ...
42 42 votes
4 answers 4 answers
15.5k
15.5k views
Kathleen asked Sep 12, 2014
15,470 views
Which of the following are regular sets?$\left\{a^nb^{2m} \mid n \geq 0, m \geq 0 \right\}$$\left\{a^nb^m \mid n =2m \right\}$$\left\{a^nb^m \mid n \neq m \right\}$$\lef...
84 84 votes
4 answers 4 answers
21.4k
21.4k views
Kathleen asked Sep 12, 2014
21,358 views
Match the following:$$\small{\begin{array}{|ll|ll|}\hline \text{E.} & \text{Checking that identifiers are declared before their use} & \text{P.} & \text{$L \: = \: \lef...