Contruct the Deterministic Finite Automata

71 Views Asked by At

Give a DFA for $\Sigma = \{0, 1, 2, 3, 4\}$ that recognizes strings over the alphabet $0, 1, 2, 3, 4$ which are integers with a digit sum of $6$ and may have leading zeros. For example, $1230$ should be in the language since $1 + 2 + 0 + 3 = 6$, and $0024$ or $24$ should be in the language since $0 + 0 + 2 + 4 = 6$, but $203$, $301$ and $2341$ should not be in the language since their digit sums are $5$, $4$ and $10$ respectively.