What exactly is the difference between $$ C = \{a^*\}\{b\}\{a^*\}\{b\}\{a^*\}\{b\} $$ and $$ D = \{a^nba^nba^nb | n \geq 0 \} $$
It is known that D is non-regular and C is regular, but I am not sure why.
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityWhat exactly is the difference between $$ C = \{a^*\}\{b\}\{a^*\}\{b\}\{a^*\}\{b\} $$ and $$ D = \{a^nba^nba^nb | n \geq 0 \} $$
It is known that D is non-regular and C is regular, but I am not sure why.
The exact difference is that the expression for D uses -the same n- for all the 'a' substrings. The expression for C does not impose that restriction on its strings, i.e each of the 'a' substrings of a string in C may or may not be of different lengths.
C is a regular expression over $\Sigma\{a,b\}$. We can design a finite automaton that can accept the language which can be generated from C. On the other hand, the language D is not regular. Using pumping lemma for regular language it can be proved that D is not regular. Hope this will help you. If you need more explanation then please feel free to ask.