Constructing Regular Grammars
Now that you have seen a couple of examples of regular grammars, you can probably construct some yourself. Try your hand at constructing a regular grammar for the language of all binary strings that contain 101 as a substring. Use the applet below. Again, be sure to read the instructions carefully. One thing to be aware of is that when you include symbols on the right hand side of the rules you construct, you must leave a space between them (if there is more than one symbol on the right hand side), as in
A → a B.
Also, if you want to construct a rule of the form
A → ε
you must type in the word "lambda" for the right hand side.
Finally, you can click the "Compare" button to determine whether you have constructed a correct grammar for the language.