0
$\begingroup$

This question already has an answer here:

$\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.

$\endgroup$

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ @D.W. In my humble opinion you take it too serious with marking duplicate questions. Marcus is struggling to find a solution for this paritcular problem and you can assume that he has already read explanations. Linking a thread which explains the general problem is only little better than posting an IBAN and say: buy that book and read it. This platform is called stackexchange and not stackreference. If the exact same question (as the UI string says) has already been answered, then it is totally okay to close it. $\endgroup$ – alsdkjasdlkja Jun 24 '16 at 17:39
  • 1
    $\begingroup$ Thanks for the feedback, @nxrd. I guess different people can reasonably hold different opinions on where to draw the line. My thought process: We expect people to show us in the question what they've tried and what approaches they've considered (as explained here). If he has already read those resources and tried applying them and wasn't able to, I encourage him to edit the question to show what happened when he tried applying those techniques and where specifically he got stuck, and it can be considered for re-opening. $\endgroup$ – D.W. Jun 24 '16 at 17:49
  • 1
    $\begingroup$ As far as our mission, for many of us generating an archive of high-quality questions and answers that will be useful not only to the asker but also to others in the future is at least as important or more important than acting as a help desk for the world. See also blog.codinghorror.com/rubber-duck-problem-solving and blog.stackoverflow.com/2011/06/optimizing-for-pearls-not-sand and meta.stackexchange.com/q/217115/160917 for more on general philosophy. $\endgroup$ – D.W. Jun 24 '16 at 17:50
0
$\begingroup$

enter image description here

Check RE and FA for finite automata construction.

It has to be regular since we can create Regular Expression for it.

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.