You are on page 1of 1

Chapter 4 and 5 problems

**These will be collected on Friday, February 6th during class – please write final
answers legibly!**

1) Construct a regular expression defining each of the following languages over the
alphabet Σ = {a b}.
a) All words in which a appears tripled, if at all. This means that every clump of
a’s contains 3 or 6 or 9… a’s.
b) All words that contain exactly 2 b’s or exactly 3 b’s, not more.
c) All strings that have exactly one double letter in them.
d) All strings in which the letter b is never tripled.
e) All strings in which the total number of a’s in divisible by 3 no matter how
they are distributed (such as aabaabbaba).
f) All strings in which any b’s that occur are found in clumps of an odd number
at a time (such as abaabbbab).
g) All strings that have an even number of a’s and an odd number of b’s. (This
one is tough!)
2) Show that (explain how) the following pairs of regular expression define the
same language over the alphabet Σ = {a b}
a) ((a + bb)*aa)* and λ + (a + bb)*aa
b) (aa)*( λ + a) and a*
c) λ + a(a + b)* + (a + b)*aa(a + b)* and ((b*a)*ab*)*
3) If the only difference between L and L* is the word λ, is the only difference
between L2 and L* the word λ? (L2 is the language LL -- L concatenated with
itself).
4) Build an FA that accepts only the language of all words with b as the second
letter. Show both the picture and the transition table for this machine.
5) Build an FA that accepts only those words that have more than four letters.
6) Build an FA that accepts only those words that have fewer than four letters.
7) Build an FA that accepts only those words that do not end with ba.
8) Build an FA that accepts only those words that begin or end with a double letter.

You might also like