CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following grammar G
S bS | aA | b
A bA | aB
B bB | aS | a
Let Na(w) and Nb(w) denote the number of a's and b's in a string w respectively. The language L(G) {a,b}+generated by G is

Open in App
Solution

Draw the fa of the given grammar as shown below:

Clearly, the machine is accepting Na(w)=3k,where k ϵ {0,1,2,3,...}

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Regular Grammars Part - 2
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon