-3

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

Raphael
  • 72,336
  • 29
  • 179
  • 389

1 Answers1

0

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}$$

3SAT
  • 459
  • 1
  • 5
  • 14