This is my homework.
Exercise 3: Find a regular grammar for the language L = {
| n + m is an odd number}. Show the way you obtain it.
The question ask to show the way I obtain the answer. So here is my explain.
We construct the DFA
![]()
From DFA, we got
S -> aA | bA
A -> aS | bS | null
Therefore, the regular grammar is
G = {V , T , S, P}
where
V = {S, A}
T = {a, b}
P = {S -> aA | bA, A -> aS | bS | null}
However, the next question is:
Construct a DFA that accepts the language generated by the grammar in Exercise 3. Simplify the constructed DFA if possible.
So I think that drawing the DFA is not the expected explaining for Exercise 3. Perhaps there is another ways to obtain the regular language without drawing DFA. Please let me know.
Thank you.