Find Regular Grammer and Transition Graph,for the following language on {a, b}: All words that end in either a or bbb.
Find Regular Grammer and Transition Graph,for the following language on {a, b}: All words that end in either a or bbb.
We are given that the language ends with a or bbb and before that there can have any occurrence of a and b
So, Regular Grammar will be
S --> A | B
A --> Xa
B --> Xbbb
X - > Xa | Xb | 
where S is the starting symbol denoting either A or B will be taken
A will produce strings ending with a and B will produce strings ending with bbb.
X will generate string (a + b)*
Regular expression: The strings can end with a or bbb, and before this any occurrence of a and b are possible.
So, Regular Expression is
RE = (a + b)a + (a + b)*bbb = (a + b)(a + bbb)
NFA Table:
We will start with state q0 and will accept single a to reach to the state q1 which is final state and will accept b to reach q2, then again b to reach q3 and one more b to reach to the state q4 which is the next final state. Also we can accept any no. of a's in the state q1 and any no. of b's in the state q4
Step by step
Solved in 2 steps with 1 images