0 votes 0 votes What will be regular grammar for given regular expression $r=(ab^*+b)^*ab$ Theory of Computation theory-of-computation regular-grammar regular-language + – saurabh rai asked Mar 27, 2018 • edited Mar 29, 2018 by Sukanya Das saurabh rai 405 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply srestha commented Mar 27, 2018 reply Follow Share $S_{1}\rightarrow aS_{2}|bS_{2}|ab$ $S_{2}\rightarrow bS_{2}|S_{1}$ 0 votes 0 votes srestha commented Mar 27, 2018 reply Follow Share or $S_{1}\rightarrow aS_{2}|S_{2}$ $S_{2}\rightarrow bS_{2}|S_{1}|ab$ 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes Regex can also be written as $\left (a+b \right )^{*}ab$ Corresponding DFA is and grammar will be $S \rightarrow bS|aA$ $A \rightarrow aA|bB$ $B\rightarrow λ |aA|bS$ Mk Utkarsh answered Mar 27, 2018 Mk Utkarsh comment Share Follow See all 0 reply Please log in or register to add a comment.