I have a language as follows:
$L = \{ w \in \{a,b\}^* | (\#_a(w) + 2\#_b(w)) \equiv 0 (mod\space 4)\}$
I'm trying to prove the regularity or irregularity of the language, but I don't know how. I have tried the pumping lemma, but any sufficiently long string will have a pumpable substring that evenly divides. I also can't seem to form any regular expression that expresses the language accurately. I run into similar problems using the Myhill-Nerode theorem (there is a finite number of states under a modulo operation), so I've exhausted my options and don't know how to proceed. What am I missing?
This language is regular. Notice that I only need to know the numbers $x$ and $y$ modulo 4 in order to answer whether the equation $x + 2y \equiv 0 \pmod{4}$ is satisfied or not. In fact, I only need to know $y$ modulo 2! So we can construct a DFA where the states are $$ \{(x, y) \mid x \in [0, 3], y \in [0, 1]\}$$ the initial state is $(0, 0)$, the accepting states are any $(x, y)$ such that $x + 2y \equiv 0 \pmod{4}$, and the transitions will be $$(x, y) \xrightarrow{a} (x + 1 \,\operatorname{mod} 4, y)$$ $$(x, y) \xrightarrow{b} (x, y + 1\,\operatorname{mod} 2)$$