310 views
1 votes
1 votes

1 Answer

Best answer
1 votes
1 votes

G:

S --> bSb|AcA

Ab --> A, Ab --> b

bA --> b , 

now start with S --> bSb

--> b (bSb) b

--> bb(AcA)bb  [  we have only one choice left of c , that is bA-->b  , on right we have two choice  Ab --> A, Ab --> b ]

--> bbAc (Ab)b --> bbAc bb --> b (bA)cbb --> bb c bb   

S=> bb c bb 

again ,  bb(AcA)bb --> b(bA) c (Ab) b --> bb c Ab --> bb c b

No of b's on the right may be less.

so here L(G) = {bm c bn  | m ≥ n, m,n ≥1}  that leans L(G) is Context Free .  But not regular.

Now you can see among those options only option B is matching.

now try to find L(G') also ..

for G'

S --> bSb|AcA

Ab --> A, Ab --> b

bA --> b , bA --> A

S --> b(S)b --> b bSb b --> b b b(S) b b b --> bb (b A) cA bbb 

we have 2 choice here , either bA --> b , or  bA --> A

by putting bA-->b we get   S --> bbb c Abbb --> bbb c (Ab) bb --> bbb c bbb   [ both left and right of c has 3 b's]

by putting bA--> A we get   S --> bb A cAbbb --> b (bA) c (Ab)bb --> bb c Abb --> bb c bb [ both left and right of c has 2 b's ]

number of b can be vary in both sides of c .

so L(G') = { bm c bn | m,n ≥ 1 }

that means L(G') is regular .

Hence only option B is correct .

selected by
Answer:

Related questions

1 votes
1 votes
2 answers
1
0 votes
0 votes
2 answers
3
suneetha asked Dec 22, 2018
342 views
i thought that it is the language where both start and end symbols are same and i got 65 but the ans is 29
0 votes
0 votes
1 answer
4