How to construct regular expression for language L which contain all words in which there is a letter 'a' and the letter 'b'?Of course, I understand that it's easy problem but I just start to learn this science? Please, any advices and hints.
Construct regular expression for language
regular expressions
For $ \Sigma =   \big\{ a,b \big\} $, all words containing letter $a$ and letter $b$ may be, in my view, expressed as follows:$$ R = (a + b)^*a(a + b)^*b(a + b)^* + (a + b)^*b(a + b)^*a(a + b)^* $$can be reduced to:$$ R = (a + b)^*\big[ a(a + b)^*b + b(a + b)^*a \big](a + b)^* $$Graphically:Now: $$\Sigma ^* = \big\{ ab, ba, aab, aaab, babaa, bab, ... \big\}$$This means any number of letters $a$ and/or $b$ before and after $a$ letter, followed by letter $b$ followed by any number of letters $a$ and/or $b$ or($a$,  $b$) in the reverse order, ie. any number of letters $a$ and/or $b$ before and after the letter $b$, followed by a letter $a$ followed by any number of letters $a$ and/or $b$.