0

How can I show that the language $L=\{ w \in \{a,b\}^*: \text{ the word w contains an even number of a and an odd number of b} \}$ is regular using the closure properties?

Mary Star
  • 13,956

1 Answers1

3

Suppose $A$ is the set of words that have an even number of as, and $B$ is the set of words that have an odd number of bs. Then $L = A\cap B$. Do you know anything about regular languages and intersections?

MJD
  • 65,394
  • 39
  • 298
  • 580
  • Ok..And since regular languages are closed under the intersection, $L$ is regular, right? Are the languages $A$ and $B$ known to be regular,or do I have to prove it first? – Mary Star Jan 28 '14 at 14:10
  • 2
    You have to prove it first. – MJD Jan 28 '14 at 14:11
  • 1
    Do I have to prove it by constructing a DFA? Or could I also find a regular expression for the language? Is such an expression for $A$: ${aa}^$ and for $B$: $ b | {bbb}^ $ ? – Mary Star Jan 28 '14 at 14:22
  • 2
    Those are not the right expressions. Language $A$ includes the word aba, and language $B$ includes the word bbbbb. – MJD Jan 28 '14 at 14:38
  • 1
    Oh, yes..you're right! Is it maybe something like that for $A$: $(b^ab^ab^)^ $ ? – Mary Star Jan 28 '14 at 14:47