For the next transition table:
$$\begin{array}{|c|c|c|c|}\hline&0&1&2\\\hline a&a&b&d\\\hline b&a&b&c\\\hline c&c&d&a\\\hline d&c&c&a\\\hline\end{array}\\a\text{ is initial state}\\\{a,d\}\text{ are final states}$$
Make the digraph of the finite automaton and indicate if it is DFA (deterministic) or NDFA (non-deterministic).
Build a regular grammar that generates the language recognized by the automaton and indicate it.
- The digraph I made is:
where $\mathrm{start}=a$, $\,s0=b$, $\,s1=c$, $\,s2=d$ and the states marked with a tick are final states.
The finite state machine (which is an automaton) $A=(\{a,b,c,d\},\{0,1,2\},\delta,a,\{a,d\})$, where $\delta:\{a,b,c,d\}\times\{0,1,2\}\to\{a,b,c,d\}$ is deterministic because each state has at most one change of state for each letter of the alphabet and there are no state changes for the null word.
- A regular $\require{cancel}\cancel{\text{grammar}}\text{ expression}$ could be: $$\require{cancel}\xcancel{\begin{align*}L(A)&=0^*\\&\vee2^*\\&\vee(220^*2^*)^*\\&\vee(11^*0)^*\\&\vee(11^*20^*\vee2)^*\\&\vee(11^*20^*\vee(12))^*\\&\vee(11^*20^*\vee1)^*.\end{align*}}$$ \begin{align*}a&=0^*\vee1b\vee2d\vee\lambda\\b&=1^*\vee0a\vee2c\\c&=1d\vee2a\vee0^*\\d&=1c\vee0c\vee2a\vee\lambda\end{align*} and from here I do not know how to build the regular expression and then build the regular grammar (I have seen this and this links but I do not understand them since I could not even get the regular expression) because I have never seen an automaton with $2$ final states!!
Also, the statement what does it mean by indicating the regular grammar?
Everything is correct?
Thanks!
External link:
- Automaton created by automatonsimulator.com. You can test it introducing words here.


At the time of writing this, the crossed out answer in the question is a regular expression, but your new answer is almost the correct regular grammar! (almost because production rules should not have Kleene star, unlike as you wrote in $a=0^*\ ...$) Using your notation, a full specification/"indication" of the regular grammar should be the following:
$$\begin{align*}a&\rightarrow0a\vee1b\vee2d\vee\lambda\\b&\rightarrow 1b\vee0a\vee2c\\c&\rightarrow\ ...\\d&\rightarrow\ ...\end{align*}$$
Edit: Now I see that the "indicating it" part of question #2 is confusing. Unless "indicating" is formally defined in your class (very unlikely), I think the better thing to do in case something like this happened in exam is to ask the examiner for clarification (e.g. "Does indicate mean to show the tuple?").
On my comment about "if I were to take the exam", treat it as "according to my own understanding of the question" and as I understand question #2, indicating the grammar just means complete specification of the 4-tuple.