Vous êtes sur la page 1sur 1

International Institute of Information

Technology, Bangalore

CS/DS 601: Theory of Computation


Sample questions: Finite state automata and
regular languages
1. Give a DFA (with three states) that accepts all binary strings that are
divisible by 4.
2. Give an NFA for accepting the language containing all binary strings that
are divisible by 5. Describe its equivalent DFA.
3. Give a DFA that accepts all binary strings that contains the string 110 as
its substring.
4. Give a DFA that accepts the set of all binary strings that do not contain
three or more consecutive 0s.

5. Give an NFA that accepts the set of all strings over the alphabet {a, b}
that have the same first and last symbols.
6. Give an NFS for accepting all binary strings that contain either the key-
word 000 or the keyword 010. Convert it into its equivalent DFA. How
many states will the equivalent minimal DFA have?
7. Give a regular expression for the set of all binary strings with exactly one
pair of consecutive 0s in them.
8. Give a regular expression that the set of all strings over the alphabet
{a, b, c} where each string contains at least one a and at least one b.

9. Determine of the regular expressions (a + b)∗ a and b∗ a(a + bb∗ a)∗ are
equivalent or not, i.e., do they represent the same language over {a, b}.
10. Give a regular expression to specify the set of all valid dates in the year
2016 in the format dd/mm/yyyy. Please note that this is a leap year.

11. Define a regular expression for the set of strings {a2 mb2 n | m, n > 0} over
the alphabet {a, b}.
12. Use pumping lemma to show that the language of addition, i.e., the lan-
guage {am bn cm+n } is not regular.

Vous aimerez peut-être aussi