There is a set of strings of even length over $\{k,l,m\}$ that contain exactly one $k$. And I try to write its regular expression.
I think it can be in that format:
ODD PREFIX k EVEN SUFFIX | EVEN PREFIX k ODD SUFFIX
Is this idea true? If it is true, it looks too long, is there any shorter way to write it?
Best Answer
Although your answer shows that you have understood the question, you need to be more precise. In particular, the prefix and the suffix should be words on the alphabet $A = \{l, m\}$. Then, step by step, one has: