1 / 18

CSCI 2670 Introduction to Theory of Computing

CSCI 2670 Introduction to Theory of Computing. August 24, 2005. Announcements. Please send me an email by midnight tonight Office hours changed Tues & Wed 11:00 – 12:30. Agenda. Last class Introduced deterministic finite automata Formally defined DFA’s Informally described DFA’s

Download Presentation

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 August 24, 2005

  2. Announcements • Please send me an email by midnight tonight • Office hours changed • Tues & Wed 11:00 – 12:30

  3. Agenda • Last class • Introduced deterministic finite automata • Formally defined DFA’s • Informally described DFA’s • This class • Quiz • Continue Chapter 1

  4. Group 1 0,1 0 q2 1 q3 0 q4 q1 0 1 1 q5 0,1 Hint: What string doesn’t this DFA accept?

  5. Group 2 0,1 q2 0,1 q3 0 q1 0,1 1 q4 0,1 q5 Hint: String length counts.

  6. Group 3 0,1 1 q1 q2 0 q3 0,1 Hint: Symbol position counts.

  7. Group 4 0 q1 q2 1 0,1 0,1 0,1 q3 q4 Hint: Can you simplify this DFA?

  8. 0,1 Group 5 q7 1 1 q1 q3 q5 1 1 0 0 0 0 0 0 q4 q6 q2 1 1 Hint: For each state, what do you know about how many times each symbol has appeared?

  9. Group 6 0 1 q1 q2 0 1 q3 0, 1 Hint: What happens when you get to q3?

  10. Remainder of class • Formal definition of computation • Definition of a regular language • Designing finite automata

  11. Formalizing computation • Let M = (Q,,,q0,F) be a finite automaton and let w = w1w2…wn be any string over . Macceptsw if there is a sequence of states r0, r1, …, rn, of Q such that • r0 = q0 • start in the start state • ri=(ri-1, wi) • the transition function determines each step • rn F • the last state is one of the final states

  12. Regular languages • A deterministic finite automaton Mrecognizes the language A if A = { w | M accepts w } • Alternatively, we say the language of M is A L(M) = { w | M accepts w } • Any language recognized by a deterministic finite automaton is called a regular language

  13. Designing finite automata • Select states specifically to reflect some important concept • even number of 0’s • odd number of occurrences of the string 010 • Ensure this meaning is relevant to the language you are trying to define • Try to get “in the head” of the automaton

  14. Example • Design a DFA accepting all strings over {0,1,2,3} such that the sum of the symbols in the string is equivalent to 2 modulo 4 or 3 modulo 4

  15. Step 1 • What states do we need? • One state for each value modulo 4 • q1 represents 1 modulo 4 • q2 represents 2 modulo 4 • q3 represents 3 modulo 4 • q4 represents 0 modulo 4

  16. Step 2 • Create the state transition table

  17. Step 3 • What elements of the 5-tuple do we know? • Q, , and  • So we still need q0 and F • q0 = q4 • F = {q2, q3}

  18. 3 1 0 q1 q2 0 2 2 3 1 1 3 2 2 q4 q3 0 0 1 3 Draw DFA

More Related