1 / 10

Convert the NDFA to DFA

Convert the NDFA to DFA.

jjune
Download Presentation

Convert the NDFA to DFA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Convert the NDFA to DFA Computational Theory/University of Salahaddin/College of Eng./Software Dep./Mr.Salar Atroshi

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. -δ(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

  8. 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

  9. 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

  10. -δ(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

More Related