1 / 29

Lecture # 7

Lecture # 7. Finite Automata. FA corresponding to finite languages. Example Consider the language L = { Λ , b, ab, bb} , defined over Σ ={a, b}, expressed by Λ + b + ab + bb OR Λ + b ( Λ + a + b) The language L may be accepted by the following FA. Example continued ….

dolph
Download Presentation

Lecture # 7

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. Lecture # 7 Finite Automata

  2. FA corresponding to finite languages • Example Consider the language L = {Λ, b, ab, bb}, defined over Σ ={a, b}, expressed by Λ + b + ab + bb OR Λ + b (Λ + a + b) The language L may be accepted by the following FA

  3. Example continued …

  4. Example Continued … • It is to be noted that the states x and y are called Dead States, Waste Baskets or Davey John Lockers, as the moment one enters these states there is no way to leave it.

  5. Note • It is to be noted that to build an FA accepting the language having less number of strings, the tree (Graph) kind of structure may also help in this regard, which can be observed in the following transition diagram for the Language L, discussed in the previous example

  6. Example • Consider the language L = {aa, bab, aabb, bbba}, defined over Σ ={a, b}, expressed by aa + bab + aabb + bbba OR aa (Λ + bb) + b (ab + bba) The above language may be accepted by the following FA

  7. Example Continued …

  8. Example • Consider the language : L = {w belongs to {a,b}*: length(w) >= 2 and w neither ends in aa nor bb}. • The language L may be expressed by the regular expression (a+b)*(ab+ba) • This language may be accepted by the following FA

  9. Example Continued …

  10. Note • It is to be noted that building an FA corresponding to the language L, discussed in the previous example, seems to be quite difficult, but the same can be done using tree structure along with the techniquediscussed in the book Introduction to Languages and Theory of Computation, by J. C. Martin • so that the strings ending in aa, ab, ba and bb should end in the states labeled as aa, ab, ba and bb, respectively; as shown in the following FA

  11. Example • Consider the language • L = {w belongs to {a,b}*: w does not end in aa}. • The language L may be expressed by the regular expression Λ + a + b + (a+b)*(ab+ba+bb) • This language may be accepted by the following FA

  12. Example Continued …

  13. Defining Languages (continued)… • Method 5 (Transition Graph) Definition: A Transition graph (TG), is a collection of the followings • Finite number of states, at least one of which is start state and some (maybe none) final states. • Finite set of input letters (Σ) from which input strings are formed. • Finite set of transitions that show how to go from one state to another based on reading specified substrings of input letters, possibly even the null stringΛ.

  14. Note • It is to be noted that in TG there may exist more than one paths for certain string, while there may not exist any path for certain string as well. • If there exists at least one path for a certain string, starting from initial state and ending in a final state, the string is supposed to be accepted by the TG, otherwise the string is supposed to be rejected. Obviously collection of accepted strings is the language accepted by the TG.

  15. Example • Consider the Language L , defined over Σ = {a, b} of all strings including Λ. The language L may be accepted by the following TG • Remember: we have different paths for same string like aaΛ= Λaa = aΛa = [ aa ] • The language L may also be accepted by the following TG

  16. Example Continued … • TG1 • TG2

  17. Example Consider the following TGs • TG1 • TG2 • TG3 These TGs accept Empty Language

  18. Example • Consider the language L of strings, defined over Σ={a, b}, starting with b. The language L may be expressed by RE b(a + b)* , may be accepted by the following TG

  19. Example • Consider the language L of strings, defined over Σ={a, b}, notending in b. The language L may be expressed by RE Λ + (a + b)*a , may be accepted by the following TG

  20. Example • Consider the Language L of strings, defined over Σ = {a, b}, containing double a. • The language L may be expressed by the following regular expression (a+b)* (aa) (a+b)* • This language may be accepted by the following TG

  21. Example Continued … • Multiple paths (options) are visible for Double a.

  22. Example • Consider the language L of strings, defined over Σ={a, b}, having double a or double b. • The language L can be expressed by RE (a+b)* (aa + bb) (a+b)* • The above language may also be expressed by the following TGs.

  23. Example continued …

  24. OR

  25. OR

  26. Note • In the above TG if the states are not labeled then it may not be considered to be a single TG

  27. Thank You…

More Related