edited by
344 views
0 votes
0 votes
Consider the following context sensitive productions.

$$\begin{align}S &\to bSb \mid AcA\\
Ab &\to A\\
Ab &\to b\\
bA &\to b\\
bA &\to A
\end{align}$$

$G$ be a grammar given all the rules except the last, $G'$ be the grammar by all the rules mending the last.

Among $G$ and $G'$ which one is regular, which one is not?

-----------------------------------------------------------------------------------------------------------------------------------

I told both regular, which is wrong according to ans. If one is regular ,can another be non regular?
edited by

1 Answer

1 votes
1 votes
Case 1.

Grammar without the last production rule.

 

We have the production that can reduce number of b's on the right side of the terminal c. That is b's on the left must be more or equal to the b's on the right. Not regular.

$a^{m}cb^{n} ( m>= n , n > 0 and m > 0)$

 

Case 2.

Grammar with the last production rule included . We now have the power to change the number of b's on either side of c. Hence regular.
$a^{m}cb^{n} ( n > 0 and m > 0)$
edited by

Related questions

2 votes
2 votes
1 answer
1
VS asked Jan 24, 2018
588 views
L={ xy | x,y$\epsilon$ (a+b)*, na(x) = nb(y) }
1 votes
1 votes
0 answers
2
gari asked Jan 1, 2018
629 views
Identify the language. apbqcrds | p+r=q+s
1 votes
1 votes
0 answers
3
set2018 asked Dec 8, 2017
365 views
Let L = {ambnbkdl⎪(n+k = odd) only if m = l; m, n, k, l 0}. Which of the following is true about L?1)L is CFL but not DCFL2)L is regular but not CFL3)L is DCFL but not...
2 votes
2 votes
1 answer
4
Tuhin Dutta asked Dec 4, 2017
444 views
$L = \{ wcww^r |\ w,c\ \epsilon\ ( a + b\ )^* \}$Identify the language.