I am new to theoretical cs and am working through it slowly. I have completed a simple question and was wondering if my answer is correct or not. Thank you kindly for any feedback.
The question is: Given the alphabet $\{a, b\}$ Construct a regular expression that defines the language $M$ containing all words beginning with exactly one $a$ or exactly one $b$. Words in $M$ are at least of length $1$. Words in $M$ can begin and end with the same letter substring or begin and end with different letter substrings.
My answer is: $( a( b( a + b)^*)^*) + (b ( a (a + b)^*)^*)$
Thank you.
working through [CS] slowly
Exactly what Donald Knuth set out to do.) $\endgroup$