Practice Questions Modules 2 Answer
Practice Questions Modules 2 Answer
a. Regular expression
b. Regular grammar
2 Design a FA from given regular expression 10 + (0 + 11)0* 1. 1 5 each 1,2
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
3. What is a Regular Expression? Given a language, find a Regular 1 5 each 1,2
Expression for the following:
i)L = {w ɛ {a, b} *: |w| is even}.
i)The set of all strings over ∑ = {a, b, c} containing at least one a and at
least one b
3. Convert the following automaton to a regular expression using “State 1,2 6 1,2
Elimination Technique”
a
c.
d
e
4. Build a Regular Expression from an FSM using Arden’s theorem 1,2 6 1,2
5. Construct the regular expression for the given DFA using Arden’s 1,2 8 1,2
theorem
6. 1,2 8 1,2
Construct the regular expression for the given DFA Arden’s theorem
7. Construct the regular expression for the given DFA using Arden’s 1,2 5 1,2
theorem
q1 = q1 0 + ε
Similarly,
q2 = q1 1 + q2 1
q3 = q2 0 + q3 (0+1)
Since the final states are q1 and q2, we are interested in solving q1
and q2 only. Let us see q1 first
q1 = q1 0 + ε
We can re-write it as
q1 = ε + q1 0
Assuming R = q1, Q = ε, P = 0
We get
q1 = ε.(0)*
q1 = 0* (ε.R*= R*)
Substituting the value into q2, we will get
q2 = 0* 1 + q2 1
q2 = 0* 1 (1)* (R = Q + RP → Q P*)
r = q1 + q2
= 0* + 0* 1.1*
r = 0* + 0* 1+ (1.1* = 1+)
8. i)Convert Finite automata into Regular Grammar 1,2 8 1,2
ii)Convert Regular Grammar into Finite automata
S→0A | 1A
A→0A | 1A| +B |-B
B→0B | 1B | 0 | 1
iv)4(1+2) *11(1/2)