You are on page 1of 7

MST (Solution)

Q2 A. (a) The Moore machine is:


Present State Next State Output
Input=0 Input=1
q0 q1 q0 0
q1 q1 q2 0
q2 q1 q3 0
q3 q1 q0 1

The corresponding Mealy machine is:


Present State Input=0 Input=1
Next State Output Next State Output
q0 q1 0 q0 0
q1 q1 0 q2 0
q2 q1 0 q3 1
q3 q1 0 q0 0
Marking Scheme:
1 mark is deducted for 2 wrong transitions. 1.5 mark is deducted for 4 wrong transitions. 2
mark is deducted for 6 wrong transitions.
Q2. (b) The corresponding RE is 1(0+1)*
Corresonding Regular Grammar(Any of the following is correct):
S->ε|1A S->ε|1A S->ε|10S|11S Any equivalent
A->0S|1S|0|1 A->0S|1S grammar
Marking Scheme:
Here, S->ε contains 1 mark. Rest all are evaluated according along with the problem
formulation (RE).
Q5(a) €, aa, bbb, aabbb is accepted (1 mark), aabbb, ababbb, bbbabbba..etc (2 marks),

Correct answer (4 marks)

Q5(b) Let {A, E} be q0, {F} be q1, {B, H} be q2, {G} be q3, {C} be q4

If Unreachable state is not removed but remaining minimized states are correct (2 marks)
Correct answer(3 marks)
Q7.

Solution:

Part (a):

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

OR

a + b + a(a + b)*a + b(a + b)*b

If the string a + b is not accepted by the regular expression, deduct 1 mark.

Part (b):

The complement DFA: (2 marks)


Part (c):

Regular expression corresponding to the complement DFA:

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

OR

ε + a(a + b)*b + b(a + b)*a

If the regular expression does not contain null string (ε), deduct 1 mark.

You might also like