edited by
10,293 views
32 32 votes

Which regular expression best describes the language accepted by the non-deterministic automaton below?

  1. $(a + b)^* \ a(a + b)b$
  2. $(abb)^*$
  3. $(a + b)^* \ a(a + b)^* \ b(a + b)^*$
  4. $(a + b)^*$

7 Answers

Best answer
47 47 votes

A is the answer.

Say $s_1, s_2 , s_3$ and $t$ are the states (in sequence) with $s_1$ being the start state

$s_1= \epsilon + s_1a + s_1b = \epsilon +s_1(a+b) = (a+b)^*$ [using Arden's theorem  $R= Q+RP$ , then $R= QP^*$][$\epsilon$ because of being the start state]

$s_2 = s_1a = (a+b)^*a$

$s_3= s_2a+s_2b = s_2(a+b) = (a+b)^*a(a+b)$

$t= s_3b= (a+b)^*a(a+b)b$

$t$ is final state so regular expression is $(a+b)^*a(a+b)b$

edited by
1 1 vote

Another quick approach of solving this question for keen observers :-

asterisk (*)  or  Kleene star

From the given NFA we can see EPSILON is not accepted in its language. 

When power of kleene closure taken "Zero". 

Option A. Has two paths aab or abb to reach final state. So, it is True✅

Option B.  when power of kleene closure zero then option B becomes epsilon which is not accepted by the NFA. 

Option C. when power of kleene closure is zero regular expression produces only string ab which is not accepted by the NFA. So option C is also false. 

Option D. When power of kleene closure is zero the regular expression produces Epsilon which is not accepted by the NFA. So the option d is also false. 

 

0 0 votes

the first S represents (a+b)*

and the next 2 states are S so they are same as S(first state) 

that is output of 2,3 states are generated by first S, that means we can combine those 3 states and finally make S as final state 

which lead to option D that is (a+b)*

0 0 votes
  • option b and option d genrate null so it is false.becz it is not accepted by finite autometa
  • option c genrate string ab which is also false

 so option a is true

0 0 votes

The given NFA accepts all the strings that contains at least 1 ‘a’ and ends with ‘b’

  1.  is the answer 
  2. it does not accept string starting with b while our NFA accepts string starting with both ‘a’ and ‘b’  (Hence False)
  3. this expression accepts strings ending with ‘a’ (Hence False)
  4.  Same as option C (Hence False)
edited by
0 0 votes
here I can see A is the answer as the first step we can go any no of a and b and then just follow the steps and concatenate those.
Answer:
Position:
Show:

Related questions

56 56 votes
4 answers 4 answers
18.0k
18.0k views
Ishrat Jahan asked Nov 1, 2014
18,044 views
Let $L$ be a regular language. Consider the constructions on $L$ below:$\text{repeat} (L) = \{ww \mid w \in L\}$$\text{prefix} (L) = \{u \mid \exists v : uv \in L\}$$\tex...
40 40 votes
3 answers 3 answers
15.9k
15.9k views
Ishrat Jahan asked Nov 1, 2014
15,908 views
Let $L$ be a regular language. Consider the constructions on $L$ below:repeat $(L) = \{ww \mid w \in L\}$prefix $(L) = \{u \mid ∃v : uv \in L\}$suffix $(L) = \{v \mid ...
64 64 votes
5 answers 5 answers
14.3k
14.3k views
Ishrat Jahan asked Oct 31, 2014
14,282 views
For a state machine with the following state diagram the expression for the next state $S^+$ in terms of the current state $S$ and the input variables $x$ and $y$ is$S^+ ...
44 44 votes
7 answers 7 answers
14.4k
14.4k views
Ishrat Jahan asked Oct 31, 2014
14,401 views
In the context-free grammar below, $S$ is the start symbol, $a$ and $b$ are terminals, and $\epsilon$ denotes the empty string.$S \to aSAb \mid \epsilon$$A \to bA \mid \e...