1 / 47

Finite Automata

Finite Automata. Irum Feroz Irum.feroz@superior.edu.pk. Why FAs ?. • Recognition Is string x in language L?. Deterministic Finite Automaton (DFA). Input Tape. String. Output. “Accept” or “Reject”. Finite Automaton. 11. 1. 0. 0,1. 1. 0111. 111. 1. 0. 0. 1.

Télécharger la présentation

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. Finite Automata Irum Feroz Irum.feroz@superior.edu.pk

  2. Why FAs ? • • Recognition • Is string x in language L?

  3. Deterministic Finite Automaton (DFA) Input Tape String Output “Accept” or “Reject” Finite Automaton

  4. 11 1 0 0,1 1 0111 111 1 0 0 1 The machine accepts a string if the process ends in a double circle Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789

  5. 1 0 0,1 accept states (F) states 1 0 0 1 states Anatomy of a Deterministic Finite Automaton q1 q0 q2 The machine accepts a string if the process ends in a double circle start state (q0) q3 Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789

  6. Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789

  7. 1 0 0,1 1 q1 0 0 1 q0 q2 q3 Anatomy of a Deterministic Finite Automaton The alphabet of a finite automaton is the set where the symbols come from: {0,1} The language of a finite automaton is the set of strings that it accepts Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789

  8. 0,1 q0 All strings of 0s and 1s L(M) =  The Language of Machine M Steven Rudich: www.cs.cmu.edu/~rudich rudich0123456789

  9. Transition Graph initial state accepting state transition state Costas Busch - RPI

  10. Alphabet For every state, there is a transition for every symbol in the alphabet

  11. Initial Configuration head Input Tape Input String Initial state Costas Busch - RPI

  12. Scanning the Input Costas Busch - RPI

  13. Costas Busch - RPI

  14. Costas Busch - RPI

  15. Input finished accept Costas Busch - RPI

  16. A Rejection Case Input String Costas Busch - RPI

  17. Costas Busch - RPI

  18. Costas Busch - RPI

  19. Input finished reject Costas Busch - RPI

  20. Another Rejection Case Tape is empty Input Finished reject Costas Busch - RPI

  21. Language Accepted: Costas Busch - RPI

  22. To accept a string: all the input string is scanned and the last state is accepting To reject a string: all the input string is scanned and the last state is non-accepting Costas Busch - RPI

  23. Another Example Accept state Accept state Accept state Costas Busch - RPI

  24. Empty Tape Input Finished accept Costas Busch - RPI

  25. Another Example trap state Accept state Costas Busch - RPI

  26. Input String Costas Busch - RPI

  27. Costas Busch - RPI

  28. Costas Busch - RPI

  29. Input finished accept Costas Busch - RPI

  30. A rejection case Input String Costas Busch - RPI

  31. Costas Busch - RPI

  32. Costas Busch - RPI

  33. Input finished reject

  34. Language Accepted:

  35. Another Example Alphabet: Language Accepted:

  36. Transition Table for symbols states

  37. All binary strings containing substring 001

  38. Construct DFA to accept (0+1)* 0 1

  39. Identify following DFA?? 0 0 0 1 1 1 1 0 00(0+1)*

  40. (0+1)*00(0+1)* 1 0 0 0 1 1

  41. (0+1)*00 0 1 0 0 1 1

  42. (0+1)*(00+01) 0 1 0 0 1 1 0 1

  43. (a+b)*abb

  44. Exercise • ab(a+b)* • a(a+b)* • (a+b)*a • (a+b)*aa (a+b)* • Exactly two strings baa and ab • (a+b)*(aa+bb) (a+b)* • (a+b) (a+b)b(a+b)* • all words containing aaa or bbb • (a*ba*ba*ba*)*

  45. ab(a+b)* accept

  46. Find language?

More Related