This is an old revision of the document!


3. Regular Expressions

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.1.

3.1.1.

$ 0^*10^*(10^*10^*)^*$

3.1.2. The language of binary words which contain exactly two ones

3.1.2.

3.1.2.

$ 0^*10^*10^*$

3.1.3. The language of binary words which encode odd numbers (the last digit is least significative)

3.1.3.

3.1.3.

$ (0 \cup 1)^*1$

3.1.4. The set of all binary strings having the substring 00101

3.1.4.

3.1.4.

$ ((1(01^*0)^*1)\cup0)^*$