140 views
0 0 votes
Q.3 Consider the following given language L.

 

L = { pqwwr | w, p, q, r ∈ {a,b}* }

 

The regular expression generated by the above language is?

 

A. (a+b)^2 (aa+bb) (a+b)

 

B. [(a+b)^2]* (aa+bb) (a+b)*

 

C. (a+b)*

 

D. None of these

2 Answers

Best answer
2 2 votes

Given:
 

Since (p,q,r,w) can be any string, choose:
w=E(epsilon)

Then
pqwwr = pqr

Since (p,q,r) can also be any strings, (pqr) can generate every possible string over ({a,b}).

Therefore
L=(a+b)^*
 

✅ Answer: Option C.

GATE shortcut: Whenever you see a repeated part like (ww), check if (w=e(epsilon)) is allowed. If yes, the repetition vanishes and the language often becomes much simpler.

• selected by
0 0 votes
p q w r belong closure of a b

Then they will be strings

Which make p q r independent and w to be repeated twice

That does not mean aa + bb , it could be any string of even length since two odd or even result in even .

 

If considering Mistyping p q w r are alphabets then

Option A is correct .
Position:
Show:

No related questions found