Can this language be expressed with a regular expression?

83 views Asked by At

The given language is: B = { aibic2m | i ≥ 0, m ≥ 0 } ∪ { arbsc2t | r ≥ 4, s ≥ 4, t ≥ 0}

My Prof has provided a regular expression for this language which is: a4a* b4b* (c2)* + (epsilon + ab + a2b2 + a3b3)(c2)*

I believe that this is incorrect and that this language is not regular. Is there a possible regex for this language, if not this one?

As far as I'm aware (i) Any language with balanced strings is not regular as it cannot be expressed as a regular expression/DFA/NFA and is instead context free so it can be represented as a PDA/CF-grammar (ii) The union of a non-regular CF language and a regular language is CF

So the first half of the union should not be regular, while the second half is regular as none of the superscripts on the tokens are related to each other. Thus the overall language B is non-regular, correct?

Regarding my Prof's solution, the left part refers to the arbsc2t part of the language B and seems correct, but the right part seems to refer to the part of B that is aibic2m, and doesn't seem to generate all of the strings in the language.

1

There are 1 answers

3
trincot On

Your teacher is right.

The right part of the solution is indeed intended to deal with aibic2m, and it is also true it does not cover all of that.

But here is the catch: For i >= 4, aibic2m is a subset of arbsc2t! So the only cases that that second expression does not cover is when i < 4, which means there are just 4 specific cases to deal with, and by listing them separately the "problem" with the equal superscripts disappears.