E N D
Convert the NDFA to DFA Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
The Equivalence of NDFA’s and DFA’s:for every NDFA can construct an equivalence DFA, one which accept the same language.Def.: let L be a set accepted by NDFA, then their exist a DFA that accept this L. If NDFA= (K, ∑, q0, δ, F) be accepted language, then we defined DFA= (K, ∑, q0,δ, F) where the state (K) of DFA are all the subset of the set of states of NDFA and K =2K and F= is the set of all states in K containing a set of F. Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
0 1 Ex1:Let M = ({q0, q1}, {0, 1}, q0, δ, {q1}) be a NDFA where δ is:- δ(q0, 0) = {q0, q1} - δ(q0,1) = {q1}- δ(q1, 0) = Φ- δ(q1, 1) = {q0, q1}convert it to DFA that accepts the same language. 0,1 q0 q1 1 Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
0,1 Solution:-δ(q0, 0) = q0 q1 = [q0q1]-δ(q0, 1) = [q1]-δ(q1, 0) =Φ -δ(q1, 1) = q1 q0 = [q0q1]-δ(q0q1, 0) = q0q1Φ =[q0q1]-δ(q0q1, 1) = q0q1 q1 = [q0q1] 0 q0 q0q1 1 1 q1 [ ] 0 Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
Ex2: Let NDFA= ({q0, q1, q2}, {0, 1}, q0, δ, {q1}) where δ is:- δ(q0, 0) = {q1}- δ(q0, 1) = {q0, q1}- δ(q1, 0) = {q0, q2}convert it to DFA that accepts the same language. 1 0,1 q0 q1 0 0 q2 Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
Solution:-δ(q0, 0) = [q1]-δ(q0, 1) = q0 q1 = [q0q1]-δ(q1, 0) = q0 q2 = [q0q2]-δ(q0q1, 0) = q1 q0q2 = [q0q1q2]-δ(q0q1, 1) = q0q1Φ = [q0q1]-δ(q0q2, 0) = q1Φ = [q1]-δ(q0q2, 1) = q0q1Φ = [q0q1] Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
-δ(q0q1q2, 0) = q1 q0q2Φ = [q0q1q2]-δ(q0q1q2, 1) = q0q1ΦΦ = [q0q1] 0,1 Φ 0 1 q0 q0 q2 0 q1 q0 q1 0 1 1 1 0 0 1 q0 q1q2 Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.SalarAtroshi
a,b a,b Ex3: Let NDFA= ({q, r, s, t}, {a, b}, q, δ, {t}) where δ is:- δ(q, a) = {q, r}- δ(r, a) = {s}- δ(s, b) = {t}- δ(t, a) = {t}- δ(t, b) = {t}- δ(q, b) = {q}convert it to DFA that accepts the same language. q r s t a a b Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
Solution:-δ(q, a) = q r = [qr]-δ(q, b) = [q]-δ(qr, a) = qr s = [qrs]-δ(qr, b) = q Φ = [q]-δ(qrs, a) = qr s Φ = [qrs]-δ(qrs, b) = q t = [qt]-δ(qt, a) = qr t = [qrt] Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi
-δ(qt, b) = q t = [qt]-δ(qrt, a) = qr s t = [qrst]-δ(qrt, b) = q t = [qt]-δ(qrst, a) = qr s t = [qrst]-δ(qrst, b) = q ΦΦ t = [qt] b b a qrt a a q qr a qrs b qt b a b a b qrst Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi