CM Assignment Saurabh 162050011
CM Assignment Saurabh 162050011
a b
\
Q1 Q6 Q3
Q2 Q5 Q6
Q4 Q5
Q3 Q2
Q5 Q2 Q1
Q6 Q1 Q4
b Q3
a b
Q1
b b
a
b
Q4 b
a b b
a b
Q6 b
a b
Q5
b Q2 b
Solution:-
Step 1:- Partition states into two groups 1) accepting states or final states 2) Non accepting or non-final
states
1
Computational Methods.
Roll No: - 162050011
Name: Saurabh Naik
New partition 1 = [{Q1, Q6}{Q2,Q5} {Q3, Q4}]
No new partition.
Hence state Q1=Q6, Q2=Q5 and Q3=Q4.
a b
\ a
Q1=Q6 Q1 Q3
Q2=Q5 Q2 Q1
Q3 Q2 a Q3
b
Q1 b
Q1
a
b b
Q2
Q1
Minimized DFA
Question No 2
Give Regular expression for All strings that begin and end with opposite symbols. Construct NFA and
then convert it to DFA.={a,b}
Solution:
NFA:-
M = {Q, , , Q0, F}
a,b
Q = {Q0, Q1, Q2, Q3}
a Q1 b = {a,b}
Q1
F={Q3}
Q0
Q3 a b
Q1
\
Q0 Q1 Q2
a
b Q2 Q1 Q1 {Q1, Q3}
Q2 {Q2, Q3} Q2
Q1
2
Q3
a,b
Computational Methods.
Roll No: - 162050011
Name: Saurabh Naik
NFA to DFA:-
a
b
b
a Q1 Q1Q3
Q1
Q0
a
Q1
a
a
b Q2 Q1Q3
Q1
a
b
b DFA