Theory of Automata V4 Assignment 2 29 April 2025
Regular Expressions (RE)
Deadline: Saturday, 9 am, 3 May 2025
(Submit in LMS and provide a hard copy in Class)
Assignment Instructions and Submission Guidelines:
• For each problem, write the regular expression that defines
the language.
• List 3 example strings that are accepted and 3 example strings
that are rejected for each regular expression.
• It can be handwritten or in a Word document. (It's up to your
convenience)
Problem Set 1:
1. Write a regular expression over {0,1} that accepts all strings containing
at least one '1'.
2. Write a regular expression over {a, b} that accepts strings that start with
'a'.
3. Write a regular expression over {0,1} that end with '0'.
4. Write a regular expression that accepts the empty string and only the
string "0" over {0,1}.
5. Write a regular expression that accepts strings of exactly length 3 over
{a, b}.
6. Write a regular expression that accepts only the string "ab" over {a,b}.
7. Write a regular expression that accepts strings over {0,1} with no
consecutive 1’s.
Theory of Automata V4 Assignment 2 29 April 2025
Problem Set 2:
1. Write a regular expression that accepts strings over {0,1} where the
number of 1’s is even.
2. Write a regular expression that accepts strings over {a,b} where baa
appears as a substring.
3. Write a regular expression over {a,b} where no two a’s appear
consecutively.
4. Write a regular expression that accepts strings over {0,1} starting and
ending with the same symbol.
5. Write a regular expression that accepts strings over {a,b} with exactly
two b’s.
Problem Set 3:
1. Write a regular expression over {a,b,c} where 'b' never appears before
'a'.
2. Write a regular expression over {a,b} that accepts strings containing at
least two a's and at most one b.
3. Write a regular expression that accepts binary strings that do not
contain the substring "1011".
4. Write a regular expression over {0,1} that accepts strings where the
number of 0's and 1's is equal.