Untitled
Untitled
5. Find a regular expression over {0, 1} for the all strings not ending in 10.
(1+0)*(00+01+11)
6. Determine whether or not the following claim is true for all regular
expressions r1 and r2. The symbol ≡ stands for equivalence regular
expressions in the sense that both expressions denote the same language.
(a) (r1 * )* ≡ r1*.
The claim is true, the languages are the same because adding multiple star operators to a
term doesn’t change the outcome. So both (r1 * )* and r1* can generate the same strings.
(b) r1 *(r1+r2)*≡(r1+r2)*.
The claim is true. This is because r1 is a subset of (r1+r2) so essentially any string on the
left can also be generated by (r1+r2)*. Any string on the right can also be generated on
the left because the star operator allows for an empty string.
(c) (r1+ r2)*≡ (r1r2)*.
The claim is false, the expression (r1r2)* can only accept r1 followed by r2, while the left
side doesn’t follow this restriction meaning they aren't equal.
(d) (r1r2)* ≡ r1*r2*.
The claim is false, the left side of the expression generates in the pattern of r1r2… while
the right side generates in the form of r1…r1r2…r2. This shows that they would clearly
be strings that exist on one side but not the other.
7. Find an nfa that accepts the language L((abab)*+ (aaa*+b)*).
3 A 5 B 6 A 7 B 8
λ λ
F
0
λ
λ
λ
λ
1 2
1 λ 1
9 A
λ 0 1 λ λ
A A 1
4
B 2
8. Find the minimal dfa that accepts L(abb)* ∪L(a*bb*).
B
2 3
B
9. What language is accepted by the following automata.
10. Find regular expressions for the language accepted by the following automata.
a*b(a+b)*
11. Write a regular expression for the set of all C real numbers.
12. Construct a dfa that accepts the language generated by the grammar
S →abS | A,
A → baB,
B →aA | bb. ,
13. Construct right & left-linear grammars for the language L={anbm:
n≥3, m≥2}.
14. Use the construction suggested by the above exercises to construct a left-
linear grammar for the nfa below.
16. The tail of a language is defined as the set of all suffixes of its strings, that is,
tail(L) = {y : xy∈L f or some x∈Σ* }
Show that if L is regular, so is tail(L).
Given L is regular and that x and y are two different languages, when they are concatenated we
obtain “xy” so we get L=xy. Because finite automata are closed when concatenated then both x
and y are individually regular. So tail(L)=x is regular.
19. Show that the following language is not regular. L = {w :na(w) = nb(w)}.Is L*
Regular?
21. Make a conjecture whether or not the following language is regular. Then
prove your conjecture.
L = {anblak:n >5, l >3, k ≤ l}.