Finding the regular expression equivalent for the given finite automaton This is another homework problem I'm stuck with. For the given finite automata, I am asked to find out the equivalent regular expression. 

On inspecting the given automata, I started deducing the expressions that it accepts and tried to find a pattern, and this is what I was able to figure out -

The automata makes the following transitions to a final state upon said input -


$q_1 to \ q_3$ on input of a single symbol $b$, $a^*b$, $ba^*$, or $a^*ba^*$.
Traversing through the cycle $q_1,q_3,q_2$ (and so on repeating) on input of  $(a^*b^4a^*)^*$, a  $((a^*b)^4)^*$.


Now the equivalent regular expression must be the sum of all these expressions,

R = $b + (a^*b) + (ba^*) + (a^*ba^*) + (a^*b^4a^*)^* + ((a^*b)^4)^*$.

Is there a better, concise expression for this or am I missing something? If not, How do I approach the simplification process of this expression?
Your DFA accepts the language of all words over $\{a,b\}$ in which the number of $b$s is of the form $3n+1$ (i.e., it is equivalent to 1 modulo 3). More generally, upon reading a word $w$, the DFA will be in state $q_1$ if it read a number of $b$s which is a multiple of 3; in state $q_3$ if it read a number of $b$s which is equivalent to 1 modulo 3; and in state $q_2$ if it read a number of $b$s which is equivalent to 2 modulo 3.

Using this description, it is easy to come up with a regular expression equivalent to your DFA. Rather than do that, let me give regular expressions for the language $L_{even}$ of words over $\{a,b\}$ containing an even number of $a$s, and for the language $L_{odd}$ of words over $\{a,b\}$ containing an odd number of $a$s:


$L_{even}$: $b^*(ab^*ab^*)^*$.
$L_{odd}$: $b^*ab^*(ab^*ab^*)^*$.


These examples should enable you to solve your specific problem.