Redirected
edited by
9,764 views

6 Answers

15 votes
15 votes

 L= w1aw2: |w1|≥ 3, |w2|≤ 5.

image

Here final states are -> q4 , q5, q6 , q7 , q8 , q9

[Edit]- By mistake, I have written q4 in two states. Actually, I should have start with q0 but started with q1. So understand the concept.  :)

Thanks, @Sourav Basu   :)

edited by
1 votes
1 votes

the above  given answer is almost correct  

the correct dfa is

as follows

|w2|<=5

1 votes
1 votes
yes you are right since L={w1aw2}  where  length of w1(  |w1|  )  >= 3    and   length of  w2(  |w2|  )  <= 5

so   in  this  dfa  1st condition  |w1| is followed  upto  state q3   it will accept all strings having  |w1|>=3  

    2nd  condition is |w2| <= 5  so  q4 is accepting state  since  |w2|  can be 0  also   q21,q22,q23,q24 are accepting states also

since |w2| canbe 1,2,3.4 respectively  but it is wrong at  state q5 since  it should also be accepting  since condition is |w2|<=5

means  |w2| can be 5  so  q5 also be accepting and also  there should be an extra state which will act as dead state  name it

q6.

dead state -  state telling dfa not to accept strings ending computation at this state.

q0,q1,q2,q3 arev also dead states
1 votes
1 votes
To construct the DFA here we first consider the corresponding REGULAR EXPRESSION which makes it easy to construct DFA .

The regular expression for the given question is :

(a+b)(a+b)(a+b)(a+b)*a(a+b+€)(a+b+€)(a+b+€)(a+b+€)(a+b+€)

Where , € is the epsilon

Now see  @vijaycs

answer it is really well clear now.

Related questions

0 votes
0 votes
1 answer
1
4 votes
4 votes
1 answer
3
Naveen Kumar 3 asked Mar 19, 2019
4,419 views
Give dfa's for the languages$L= \{ab^5wb^2 : w ∈ \{a,b\}^* \}$$L= \{ab^na^m : n ≥ 2 , m ≥3\}$ $L = \{w_1abw_2 : w_1 ∈ \{a,b\}^*,w_2 ∈ \{a,b\}^* \}$
0 votes
0 votes
1 answer
4
Naveen Kumar 3 asked Mar 19, 2019
878 views
$L$ = {$awa : w ∈$ {$a,b$}* }Show that if we change the following figure, making $q_3$ a nonfinal state and making $q_0, q_1,q_2$ final states, theresulting dfa accepts...