Asg 2
Asg 2
Fall 2021
Submission through Moodle is due by Sunday October 17th at 23:55
1. [5 pts] Give a regular expression for every string w over {0, 1} where the value of w,
when interpreted as a binary number, is at least 40.
2. [5 pts] Give a finite state automaton for the language denoted by the regular expression
r1∗ (r2 + r3 ), where r1 = a∅a, r2 = aa∗ (a + b∗ ), and r3 = (b + ab)∗ aa(b + ba)∗ .
4. [10 pts] Consider the regular grammar G1 = (V1 , Σ, S1 , P1 ), where V1 = {S1 , A, B},
Σ = {a, b}, and P1 consists of the productions S1 → abA, A → baB, and B → aA | bb.
Also consider the grammar G2 = ({S2 , B}, Σ, S2 , P2 ), where the productions in P2 are:
S2 → aaB | λ
B → bB | ab
Give a left-linear grammar for the language L(G1 ) ∪ L(G2 ).
5. [15 pts] Suppose L is a regular language. Use the closure properties of regular languages
to show that each of the following languages is regular as well.
6. [20 pts] For each of the following languages, prove or disprove if it is regular.
Part B (Not graded): Questions in this part are for your extra practice. Do
NOT submit your solutions to questions in this part.
1. Give a regular expression for each of the following languages over Σ = {a, b}: