1 / 61

Deterministic Finite Automata

Deterministic Finite Automata. DFA. A primitive computing machine with very limited amount of memory. Example (inspired from Sipser’s book): Automatic door mechanism :. DOOR. Front pad. Rear pad. Example. DOOR. Front pad. Rear pad. FRONT REAR BOTH. NEITHER. FRONT REAR

apria
Download Presentation

Deterministic Finite Automata

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. Deterministic Finite Automata

  2. DFA • A primitive computing machine with very limited amount of memory. • Example (inspired from Sipser’s book): Automatic door mechanism: DOOR Front pad Rear pad

  3. Example DOOR Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  4. Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  5. Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  6. DOOR Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  7. Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  8. Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  9. Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  10. DOOR Front pad Rear pad FRONT REAR BOTH NEITHER FRONT REAR BOTH CLOSED OPEN NEITHER

  11. DFA D F A INPUT TAPE ACCEPT or REJECT

  12. DFA parts a b b q0 q1 q2 q3 a a a b b q4 a b TRANSITION GRAPH

  13. DFA parts a b b q0 q1 q2 q3 a a a b b q4 a b STATES : {q0 , q1, q2, q3, q4}

  14. DFA parts a b b q0 q1 q2 q3 ACCEPTING STATE a a a b b q4 a b

  15. DFA parts NON-ACCEPTING STATE a b b q0 q1 q2 q3 a a a b b q4 a b

  16. DFA parts a b b q0 q1 q2 q3 START STATE a a a b b q4 a b

  17. DFA parts ALPHABET: Σ = {a,b} a b b q0 q1 q2 q3 a a a b b q4 a b

  18. DFA parts ALPHABET: Σ = {a,b} a b b q0 q1 q2 q3 a a a b b TRANSITION q4 a b

  19. DFA parts ALPHABET: Σ = {a,b} a b b q0 q1 q2 q3 a a a b b q4 a b Exactlyone transition from every state under each symbol in the alphabet.

  20. DFA parts ALPHABET: Σ = {a,b} a b b q0 q1 q2 q3 a a a b b q4 a b Exactlyone transition from every state under each symbol in the alphabet.

  21. DFA transition graph a b b q0 q1 q2 q3 a a a b b q4 a b

  22. DFA transition graph a b b q0 q1 q2 q3 a a a b b q4 a b JUNK or TRAP STATE

  23. DFA continued a b b q0 q1 q2 q3 a a a b b TAPE q4 a b

  24. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b bba q4 a b

  25. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b a b bb q4 a b

  26. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b bb q4 a b

  27. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b b b q4 a b

  28. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b b q4 a b

  29. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b b q4 a b

  30. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b q4 a b

  31. DFA continued Input string: abb a b b q0 q1 q2 q3 a a a b b q4 ACCEPT a b

  32. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b b bbba q4 a b

  33. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b a b bbb q4 a b

  34. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b b abb q4 a b

  35. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b b b bb q4 a b

  36. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b b bb q4 a b

  37. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b b b b q4 a b

  38. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a a b b q4 b a b

  39. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a b b a q4 b a b

  40. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a b a q4 b a b

  41. DFA continued Input string: abbb a b b q0 q1 q2 q3 a a b a q4 b REJECT a b

  42. Empty string • Denoted by the Greek letters εorλ. • Contains no letters.

  43. Empty string Input string: ε a b b q0 q1 q2 q3 a a a b b q4 a b The tape is empty

  44. Empty string Input string: ε a b b q0 q1 q2 q3 a a a b b q4 REJECT a b

  45. Other Example More than one accepting states a b b q0 q1 q2 q3 a a a b b q4 a b

  46. Other Example Input string: ε a b b q0 q1 q2 q3 a a a b b q4 a b

  47. Other Example Input string: ε a b b q0 q1 q2 q3 a a a b b q4 ACCEPT a b

  48. Other Example Input string: ε a b b q0 q1 q2 q3 a a a b b q4 ACCEPT a b • The automaton accepts with input the empty string εiff the START state is an ACCEPTING state.

  49. DFA formally • In order to completely determine a DFA we need five things: • Its set of states, • the alphabet of the input strings, • a the transition function between states, • a start statefrom which the computation begins and • the set of states for which the DFA accepts.

  50. DFA formally • A DFA M is a quintuple (Q, Σ, δ, q0, F) where a b b q0 q1 q2 q3 a a a b b q4 a b

More Related