For each of the exercises from DFA Seminary 1 write a regex describing the same language.
3.1.1. $ L=\{w \in \{0,1\}^* \text{ | w contains an odd number of ones} \} $
3.1.2. The language of binary words which contain exactly two ones
3.1.3. The language of binary words which encode odd numbers (the last digit is least significative)
3.1.4. The set of all binary strings having the substring 00101
3.2.1.
$ A=\{ 0^{2k} \mid k \geq 1 \}$
$ B = \{0, \epsilon \}$
$ AB = ? $
3.2.2.
$ A = \{ 0^n 1^n \mid n \geq 1 \}$
$ B = \{ 1^n \mid n \geq 1 \} $
$ AB = ? $
$ BA = ? $
3.2.3
$ A = \{ 0^n 1^n 0^m \mid m \geq n \geq 1 \}$
$ B = \{ 0^n \mid n \geq 1 \} $
$ AB = ? $
$ BA = ? $
3.2.4.
$ A = ∅ $
$ B = \{ 1^n \mid n \geq 1 \} $
$ AB = ? $
$ A^* = ? $
$ B^* = ? $
Are the following regex pair equivalent?
3.3.1
$ E1 = ab|a|b $
$ E2 = (a|\epsilon)(b|\epsilon) $
3.3.2
$ E1 = a(b|c)(d|e)|abb|abc $
$ E2 = ab(b|c|d|e)|acd|ace $
3.3.3
$ E1 = (a\mid b)^*aa^* \mid \epsilon $
$ E2 = (a\mid ba)^*(b\mid ba)^* $
3.3.4
$ E1 = ((ab^*a)^+b)^* $
$ E2 = (a(b\mid aa)^*ab)^* $
3.4.0. Write a regular expression for the language of arithmetic expressions containing +, * and numbers. Hint: you can abbreviate $ 0 \cup 1 \cup \ldots \cup 9 $ by $ [0-9] $
3.4.1. Write a regular expression for $ L = \{ \omega \text{ in } \text{{0,1}} ^* \text{ | EVERY sequence of two or more consecutive zeros appears before ANY sequence of two or more consecutive ones} \} $
3.4.2. Find a regular expression for the set of all binary strings with the property that none of its prefixes has two more 0's than 1's nor two more 1's than 0's.
3.4.3. Write a regular expression which generates the accepted language of A. Then try to find the most simple and easy to understand way to write it.