# What is the regular expression of this language? [duplicate]

$\Sigma = \{0, 1\}$

$L = \{x$| $x \in \Sigma^*$ $\&$ $\#_0(x) = 3$ $or$ $\#_1(x) = 3 \}$

What is the regular expression of this language?

At first I thought $r = (0+1)^*0(0+1)^*0(0+1)^*0$ $or$  $r = (0+1)^*1(0+1)^*1(0+1)^*1$

And what is it's corresponding NFA/DFA?

I've been puzzled by this language and if it's regular for a while now.

## marked as duplicate by D.W.♦Jun 24 '16 at 15:34

• Ah you're right! I was too fixated on the $(0+1)^*$ and not making them $(0)^*$ and $(1)^*$ respectively. – marcusvb Jun 24 '16 at 13:03