How can I write a regular expression that denotes language on the alphabet {a,b} of the strings that do not present "b" consecutive and the total number of "a" is multiple of three?.

  • 4
    $\begingroup$ Construct a DFA/NFA for your language, and then convert it into a regular expression. $\endgroup$ – Yuval Filmus Jun 7 '19 at 10:45
  • $\begingroup$ Just make sure that you either add three a's (as many times you want with the kleene operator) or add an b and immediately 3 a's. Try to write this as a RegEx yourself $\endgroup$ – Panzerkroete Jun 7 '19 at 18:36
  • $\begingroup$ Check how to convert finite automata to regular expressions. $\endgroup$ – John L. Jun 7 '19 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.