I want to predict language from the given regular expression.Regular Expression: $$(b^* (aaa)^* b^*)^*$$As per my assumption language may be like:Let the string contain alphabet $\{a,b\}$ where every string contain number of $'a'$ divided/multiply by $3$.Let me know whether my assumption is correct or not.Thanks
Predict language from given expression $(b^* (aaa)^* b^*)^*$
regular languages;regular expressions
A simple counter example can be found for your answer. Take the string $$ababa$$ Here, the alphabet is $\{a,b\}$ and the number of $a$s is a multiple of $3$, yet it doesn't fit into the regular expression.In the regular expression, $b^*(aaa)^*b^*$ denotes strings that contain an arbitrary (possibly zero length) sequence of $b$s, a sequence of $a$s that is a multiple of $3$ (possibly zero again), followed by an arbitrary length sequence of $b$s.So, $(b^*(aaa)^*b^*)^*$ is such a sequence repeated over any number of times, including the empty string.You could call the language as$$L=\{x|x\text{ contains sequences of consecutive }\\a\text{s and }b\text{s, where the length of each sequence of }a\text{s is a multiple of }3\}$$over the alphabet $\Sigma=\{a,b\}$.In general, a language is just some subset of the set of all strings over a given alphabet. Given a language, there need not be any straightforward way of describing it in English. A regular expression, given the alphabet, completely specifies and describes the language.