0% found this document useful (0 votes)
156 views4 pages

Untitled

This document contains 23 problems related to formal languages and automata. It asks the reader to find regular expressions for various languages, determine if claims about regular expressions are true or false, construct finite automata to recognize certain languages, and prove whether operations on languages preserve regularity.

Uploaded by

Bigious Boious
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views4 pages

Untitled

This document contains 23 problems related to formal languages and automata. It asks the reader to find regular expressions for various languages, determine if claims about regular expressions are true or false, construct finite automata to recognize certain languages, and prove whether operations on languages preserve regularity.

Uploaded by

Bigious Boious
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1-1

California State Polytechnic University, Pomona


Computer Science Department
CS3110: Formal Languages and Automata
Spring 2023
Instructor: Prof. Tony Diaz
Hw#2
1. Find all strings in L((a+b)*b(a+ab)*) of length less than four.
b ,bb ,ba ,ab ,bbb ,bba ,bab, baa, aab, abb, aba

2. Find a regular expression for the set { anbm : (n+m) is odd }.


(aa)*a(bb)*+(aa)*(bb)*b

3. Given a regular expression for the complement of L1{anbm, n ≥ 3, m


≤4}.
(λ+a+aa)b* + a*(bbbbb)b* + (a+b)*ba(a+b)*

4. Find a regular expression for L={w∈{0,1}*: w has exactly one pair of


consecutive zeros.
(1+01)*00(1+10)*

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.

The language accepted by the automata is a*(a(a+b)*a+b)+(a*+b+c))(a+b*)*

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.

15. The symmetric difference of two sets S1 and S2 is defined as


S1ΘS2= {x :x ∈S1or x ∈S2, but x is not in both S1and S2}.
Show that the family of regular languages is closed under symmetric
Difference.
The symmetric difference between S1 and S2 is essentially (S1-S2)⋃(S2-S1). For any set
(N-M)=(N⋂M’) so the difference for S1 and S2 is S1ΘS2 = (S1⋂S2)⋃(S2⋂S1’). The
regular language is therefore closed under the intersection, complement, and union, the family is
closed because of symmetric difference.

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.

17. For a string a1a2···an define the operation shift as


shift(a1a2· · · an) = a2· · · ana1. From this, we can define the operation
on a language as shift(L) = {v :v = shift(w) for some w ∈L}. Show that
the regularity is preserved under the shift operation.

18. Show that the following language is not regular. L = {anbkcn:n ≥ 0,


k ≥n}.

19. Show that the following language is not regular. L = {w :na(w) = nb(w)}.Is L*
Regular?

20. Determine whether or not the following language on Σ = {a} is regular


L = {an:n = 2k for some k ≥ 0}.

21. Make a conjecture whether or not the following language is regular. Then
prove your conjecture.
L = {anblak:n >5, l >3, k ≤ l}.

22. Let L1 and L2 be regular languages.


Is the language L={w: w ∈ L1, wR ∈ L2} necessarily regular?
The language is regular because WR ∈ L2 => W ∈ L2R and W ∈ L1 is given and W ∈
L2R => L = L1⋂L2R then L2R is regular which is closed, so then L = L1 ⋂ L2R hence the language
is regular.

23. Is the following language regular? L = {uwwRv: u, v, w ∈ {a,b}+}

You might also like