Which of the following is (are) correct about the regular expression?
a a* b b* c c* d d*
$L={a^n b^n c^m d^m \mid n\ge 1,\ m\ge 1}\cup{a^n b^m c^m d^n \mid n\ge 1,\ m\ge 1}$
$S\to AB\mid C$
$A\to aAb\mid ab$
$B\to cBd\mid cd$
$C\to aCd\mid aDd$
$D\to bDc\mid bc$
Choose the correct answer from the options given below:
The given regular expression is $aa^*bb^*cc^dd^$, where:
$L={a^n b^n c^m d^m \mid n \ge 1, m \ge 1}\cup{a^n b^m c^m d^n \mid n \ge 1, m \ge 1}$
consists of strings where $a$'s are followed by $b$'s, which are followed by $c$'s, and then $d$'s.
Each of these letters $a, b, c, d$ can occur one or more times in any order. For example, $abcd$, $aabcdd$, etc. So the language $L$ can generate regular expressions $aa^*bb^*cc^dd^$.
$S \to AB \mid C$
$A \to aAb \mid ab$
$B \to cBd \mid cd$
$C \to aCd \mid aDd$
$D \to bDc \mid bc$
This is true.
For example:
$S \to AB \mid C$
$S \to abcd$
This statement is false.
The regular expression $aa^*bb^*cc^dd^$ generates strings where each letter $a, b, c, d$ can occur one or more times, but there is no constraint that the number of occurrences of each letter must be equal.
For example, the regular expression can generate strings like $abcd$, $abccdd$, $aaaabbbccddd$, etc., where the number of occurrences of each letter is not necessarily equal.
So option C is the correct answer.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.