-1

(https://i.stack.imgur.com/lU278.png)

Why option C is also not correct?

Naina
  • 11
  • 1
  • 1
    Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then check the [help/on-topic] to see which questions are on-topic on this site. You might want to delete this question and ask it on https://cs.stackexchange.com/ instead, but check the help pages there first. – Progman Nov 17 '22 at 14:01
  • Option C is not correct because it includes strings of the form `b^na^n`. Basically, unless the string is in the form `a*b*`, it is guaranteed to have the same number of `a`s as `b`s, and those strings are not regular. – Welbog Nov 19 '22 at 18:13

1 Answers1

0

Let's evaluate each one in turn. Let L be the language over {a, b} with #a = #b.

(a) L intersect ab. This is the language of strings of the form a^n b^n. This is not regular by the Myhill-Nerode theorem since each string a^k has a unique shortest string b^k which can be appended to get a string in the language, and there are clearly infinitely many such cases, so there can be no finite automaton for the language.

(b) (L intersect ab) union ab. This is regular because (L intersect ab) is clearly a subset of ab, but the union of a subset with any of its supersets is the superset; thus, (L intersect ab) union ab = ab which is regular since it has just three unique equivalence classes: those strings which can be followed by ab to get a string in the language; those that can only be followed by b* to get a string in the language; and those strings which cannot be followed by anything to get a string in the language.

(c) L union ab. This is not regular because strings of the form b^(k+1)a have unique shortest strings a^k which can be appended to get a string in the language, and there are clearly infinitely many such cases, so there can be no finite automaton to cover them all.

(d) (L intersect ab) union ba. This is not regular because strings of the form a^(k+1)b have unique shortest strings b^k which can be appended to get strings in the language, and there are infinitely many such cases, so no finite automaton can cover them all.

Patrick87
  • 27,682
  • 3
  • 38
  • 73