1 / 17

CSCI 2670 Introduction to Theory of Computing

CSCI 2670 Introduction to Theory of Computing. September 8, 2005. Announcement. Remove problems 1.46c and 1.55(c,f,j) from your homework assignments New assignment 1.7(d,h), 1.16b, 1.21b (show the GNFA steps),1.19a Old text numbers 1.5(d,g), 1.12b, 1.16b, 1.14a. Agenda. This week

drew
Télécharger la présentation

CSCI 2670 Introduction to Theory of Computing

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. CSCI 2670Introduction to Theory of Computing September 8, 2005

  2. Announcement • Remove problems 1.46c and 1.55(c,f,j) from your homework assignments • New assignment 1.7(d,h), 1.16b, 1.21b (show the GNFA steps),1.19a • Old text numbers 1.5(d,g), 1.12b, 1.16b, 1.14a

  3. Agenda • This week • Proved every RE has a corresponding DFA • I.e., every RE describes a regular language • Showed how to convert GNFA to RE • Today • Prove every DFA has a corresponding RE • Example of conversion from GNFA to RE • Proving a language is not regular?

  4. a12 a22 a11 q2 q1 a21 a13 a32 a23 a31 q3 a33 Accounting for loops a22a23a33*a32 a11a13a33*a31 a12a13a33*a32 q1’ q2’ a21a23a33*a31

  5. Every DFA has a corresponding RE Proof: Let M be any DFA and let w be any string in Σ*. Convert M to G, a GNFA, then convert G to R, a regular expression, using methods shown in class. • Want to show wL(M) iff wL(R). • First show wL(M) iff wL(G). • Then show wL(G) iff wL(R).

  6. wL(M) iff wL(G) • Assume wL(M) and w = w1w2…wn, where each wi  Σ. Then there is a sequence of states q1, q2, …, qn+1 such that • q1 = q0 • qn+1F • qi+1 = (qi,wi) for each i = 1, 2, …, n • When w is read by G, the sequence of states qs, q1, q2, …, qn+1, qt would accept w • i.e., wL(G)

  7. wL(M) iff wL(G) • Assume wL(G) and w = w1w2…wn, where each wiΣ. Then there is a sequence of states qs, q1, q2, …, qn+1, qt such that • q1 = q0 • qn+1F • qi+1 = (qi,wi) for each i = 1, 2, …, n • When w is read by M, the sequence of states q1, q2, …, qn+1 would accept w • i.e., wL(M)

  8. wL(G) iff wL(R) • Prove by induction on number of states in G Base case: If G has 2 states then clearly wL(G) iff wL(R). Induction step: Assume wL(G) iff wL(R) for every G with k-1 states. Prove w  L(G) iff wL(R) for every G with k states.

  9. wL(R) if wL(G) Assume wL(G) and an accepting branch of the computation G enters on w is qs, q1, q2, …, qt. Let G’ be the GNFA that results from removing one of G’s states, qrip. There are two possibilities: Case 1: qrip is never entered in the computation of w. Then the same branch of computation exists in G’.

  10. wL(R) if wL(G) Assume wL(G) and an accepting branch of the computation G enters on w is qs, q1, q2, …, qt. Let G’ be the GNFA that results from removing one of G’s states, qrip. There are two possibilities: Case 2: qrip is entered in the computation of w (bracketed byqi and qj). Then the new transition between qi and qj in G’ describes the computation that could be done on the computation of w through the branch qi, qrip, qj. So G’ accepts w. By induction wL(R).

  11. wL(G) if wL(R) Assume wL(R). By induction hypothesis, wL(G’), the k-1 state GNFA resulting from removing one state from G. By construction, any computation in G’ can also be done in G – possibly going through an extra state qrip. Therefore, wL(G).

  12. 1 1 0 q1 q2 0 Example

  13. qs qt Example 1 1 0 q1 q2 0 ε ε Step 1: Add two new states

  14. qs qt Example 1 101*0 1 0 q1 q2 0 ε ε 1*0 Step 2: Remove q1

  15. qs qt Example 101*0 q2 ε 1*0 1*0(101*0)* Step 3: Remove q2

  16. 1 1 0 q1 q2 0 Example So this DFA Is equivalent to the regular expression 1*0(101*0)*

  17. Have an excellent weekend

More Related