-3
$\begingroup$

This question already has an answer here:

I was wondering if there was a method that can be used to generate a Regular Expression for a language. Take the Language $L$ as an example where:

$L= \{w \in \{0, 1\}^{\ast} \mid \text{length of } w \text{ is a multiple of } 2 \text{ or } 3\}.$

Can you show the step by step method to make the RE for this language? Cheers

$\endgroup$

marked as duplicate by D.W. Jan 16 '16 at 18:12

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$ In general? No, because that would imply you could algorithmically decide whether a given language is regular (impossible). Of course, there are certain methods, e.g. build an NFA and convert it. (Community votes, please: duplicate?) $\endgroup$ – Raphael Jan 16 '16 at 15:33
  • 2
    $\begingroup$ Anyway, what have you tried and where did you get stuck? $\endgroup$ – Raphael Jan 16 '16 at 15:34
0
$\begingroup$

Hint: Let's denote $w_{\text{two}}$ words with length that is a multiple of $2$

and $w_{\text{three}}$ words with length that is a multiple of $3$

So think about:

$$|w_{\text{three}}|\bigg|_{3}\cup|w_{\text{two}}|\bigg|_{2}$$

$\endgroup$

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