1 / 36

Theory of Computation

Theory of Computation. Exercise. Design an FA for the language L of strings, defined over Σ ={a, b}, of odd length. Solution: The language L may be expressed by the following RE: (a+b)((a+b)(a+b)) * or ((a+b)(a+b)) * (a+b) This language may be accepted by the following FA.

annathomas
Download Presentation

Theory of Computation

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. Theory of Computation

  2. Exercise Design an FA for the language L of strings, defined over Σ={a, b}, of odd length. Solution:The language L may be expressed by the following RE: (a+b)((a+b)(a+b))* or ((a+b)(a+b))*(a+b) This language may be accepted by the following FA

  3. Solution continued … a,b 1 – 2+ a,b

  4. Example Consider the Language L , defined over Σ = {a, b} of all strings including Λ, The language L may be accepted by the following FA The language L may also be accepted by the following FA a,b 2+ 1 a,b

  5. Example Continued … The language L may be expressed by the following regular expression (a + b)* a,b 

  6. Example Consider the Language L , defined over Σ = {a, b} of all non empty strings. The language L may be accepted by the following FA The above language may be expressed by the following regular expression (a + b)+ a,b – + a,b

  7. Example Consider the following FA, defined over Σ = {a, b} The above FA does not accept any string. Even it does not accept the null string, as there is no path starting from initial state and ending in the final. a,b – + a,b

  8. 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 FA

  9. Example Continued … 2 a,b b a a 3+ 1- b

  10. Example Consider the language L of strings, defined over Σ={0, 1}, having double 0’s or double 1’s, The language L may be expressed by the regular expression (0+1)* (00 + 11) (0+1)* This language may be accepted by the following FA

  11. Example Continued … + - x 0 0 0,1 0 1 1 1 y

  12. Example Consider the language L of strings, defined over Σ={a, b},having triple a’s or triple b’s. The language L may be expressed by RE (a+b)* (aaa + bbb) (a+b)* This language may be accepted by the following FA

  13. Example Continued … a 2 4 a a b a,b a b 1–– 6+ a b b 3 b 5

  14. Example Consider the EVEN-EVEN language, defined over Σ={a, b}. As discussed earlier that EVEN-EVEN language can be expressed by the regular expression (aa+bb+(ab+ba)(aa+bb)*(ab+ba))* EVEN-EVEN language may be accepted by the following FA

  15. Example Continued … b 3 1 b a a a a b 4 2 b

  16. 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

  17. Example Continued … 4+ 2 1– 5+ 3 a b a b a a b b b a

  18. 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

  19. Example Continued … a aa a b a b a a ab Λ b a ba b a b a b b b bb

  20. Consider the language L= {x Є{0,1}* | x ends in 1 and does not contain the substring 00} The language L may be expressed by the regular expression (1+01)*(1+01) OR (1+01)+ This language may be accepted by the following FA Example

  21. Example Cont…

  22. Example Consider the language L of strings, defined over Σ={0, 1},Strings ending in 0. The language L may be expressed by the Regular Expression: (0+1)*0 This language may be accepted by the following FA

  23. Example Cont…

  24. Example Consider the language L of strings, defined over Σ={0,1},Strings ending in 11. The language L may be expressed by the Regular Expression: (0+1)*11 This language may be accepted by the following FA

  25. Example Cont…

  26. Example The language L, defined over Σ={0,1}, strings ending with 10 The regular expression for the above language is: (0+1)*(10) This language may be accepted by the following FA (Next slide)

  27. Example Cont…

  28. Example The language given in the previous example may also be accepted by the following FA (Next slide)

  29. Example Cont…

  30. A finite automata, accepting {a+b}*{baaa}. Example

  31. A finite automaton accepting {00}*{11}* Example

  32. Example Cont…

  33. Consider the language L of strings defined over Σ={a,b}, containing ab and bba The regular expression for the above language is as (a+b)*(ab+bba)(a+b)* This language may be accepted by the following FA (Next slide) Example

  34. Example Cont…

  35. Thank You!

More Related