SlideShare a Scribd company logo
1 of 64
Finite Automata




                  1
Finite Automaton
                               Input
                                              A string over a given alphabet
                                              written on an input file

                              String

                                                                  Output
A control unit consisting of a
finite number of internal states

                       Finite                                     String
                       Automaton

The internal state at the next time step is
determined by the transition function


                                                                               2
Finite Accepter
  Input
  String
             Output
            “Accept”
Finite
               or
Automaton
            “Reject”



                       3
Finite Accepter
 Input String of 
                           




Internal states
              Initial state
         q0                            “Accept”
   q1               q5
                                           or
   q2              q4    final state   “Reject”
        q3



                                                  4
Formalities
Deterministic Finite Accepter (DFA)           (p.38)


      M  Q, , , q0 , F 
 Q : set of internal states
  : input alphabet
     :Q×Q            transition function
 q0   : initial state

 F    : set of final states
                                                       5
Finite Accepter
  Leftmost position
          Input String abba
       a b b a        ×                  


                                       : a particular status of the
Initial configuration                  input file and internal state


        Internal states
                       q0                                              “Accept”
             q1                   q5
                  initial state
                                                                          or
             q2               q4                                       “Reject”
                      q3



                                                                                  6
At q0 now check for
current symbol-

                                          Transition function

      a b b a    ×                     q0 , a   q1          Next
                                                                   state
                                       current state
                                           current input symbol
                                          move to the next state
       Internal states
                      q0                               “Accept”
            q1              q5
                                                          or
           q2              q4                          “Reject”
                  q3



                                                                           7
At q1 now check for
current symbol-

                                          Transition function
                                            q1 , b   q2
      a b b a    ×               
                                                                   Next
                                                                   state
                                       current state
                                           current input symbol
                                          move to the next state
       Internal states
                      q0                               “Accept”
            q1              q5
                                                          or
           q2              q4                          “Reject”
                  q3



                                                                           8
At q2 now check for
current symbol-

                                       Transition function
                                         q2 , b   q3
      a b b a    ×               




       Internal states
                      q0                           “Accept”
            q1              q5
                                                      or
           q2              q4                      “Reject”
                  q3



                                                              9
At q3 now check for
current symbol-

                                       Transition function
                                         q3 , a   q4
      a b ba     ×               




       Internal states
                      q0                           “Accept”
            q1              q5
                                                      or
           q2              q4                      “Reject”
                  q3



                                                              10
At q4 now check for
current symbol-



      a b ba     ×                  No symbol left and it
                                       stops at final state




       Internal states
                      q0                         “Accept”
            q1              q5
                                                    or
           q2              q4                    “Reject”
                  q3
                                       The string abba is accepted
                                       by the machine.
                                                                 11
Transition Graph GM

   Transition functions are the most
    important part for a finite accepter.

   We use a transition graph to represent
    a finite accepter such that
            Node  state, and
      Edge with label  transition function
          (current symbol)



                                              12
Transition Graph for 
          q2 , b   q3          Next
                                   state
        current state
            current input symbol

       q2           b               q3

    Initial state                   q0

    Final state                      qf

                                           13
Transition Graph
 abba –                                            a,b
 Finite Accepter
                                                      q5
                     a                                     a,b
       b                  a    b
      q0 a          q1 b q2 b q3 a                          q4
  initial                                                  final
  state                                                    state
                    transition
              state  q2 , b   q3                    “accept”
It is important to have a clear and intuitive picture to work with DFA.
Transition graph: vertices > states, edges > transitions                14
Initial Configuration
           Input String
a b b a

                          a,b

                           q5
           a                    a,b
   b            a    b
  q0 a    q1 b q2 b q3 a        q4


                                      15
Reading the Input
                           One at a time
                           from left to right


a b b a

                      a,b

                       q5
           a                 a,b
   b            a    b
  q0 a    q1 b q2 b q3 a     q4


                                                16
a b b a

                      a,b

                       q5
           a                a,b
   b            a    b
  q0 a    q1 b q2 b q3 a    q4


                                  17
a b b a

                      a,b

                       q5
           a                a,b
   b            a    b
  q0 a    q1 b q2 b q3 a    q4


                                  18
a b b a

                      a,b

                       q5
           a                a,b
   b            a    b
  q0 a    q1 b q2 b q3 a    q4


                                  19
Input finished

a b b a

                        a,b

                         q5
           a                  a,b
   b            a    b
  q0 a    q1 b q2 b q3 a      q4

                    Output: “accept”
                                       20
Another Example: aba
a b a

                     a,b

                      q5
          a                a,b
   b           a    b
  q0 a   q1 b q2 b q3 a    q4


                                 21
Initial Configuration


 a b a

                        a,b

                         q5
             a                a,b
      b           a    b
     q0 a   q1 b q2 b q3 a    q4


                                    22
a b a

                     a,b

                      q5
          a                a,b
   b           a    b
  q0 a   q1 b q2 b q3 a    q4


                                 23
a b a

                     a,b

                      q5
          a                a,b
   b           a    b
  q0 a   q1 b q2 b q3 a    q4


                                 24
a b a

                     a,b

                      q5
          a                a,b
   b           a    b
  q0 a   q1 b q2 b q3 a    q4


                                 25
Input finished

a b a

Output:                a,b
“reject”
                        q5
            a                a,b
   b             a    b
  q0 a     q1 b q2 b q3 a    q4


                                   26
Another Input String           

                   a,b

                    q5
        a                a,b
 b           a    b
q0 a   q1 b q2 b q3 a    q4


                                   27
End of input!         a,b

                        q5
            a                a,b
     b           a    b
    q0 a   q1 b q2 b q3 a    q4

Output:“reject”
                                   28
a,b
    GM
                                                        q5
         b             a                                      a,b
                            a    b
        q0 a          q1 b q2 b q3 a                          q4

                                           A Trap State
It is important to have a clear and intuitive picture to work with DFA.
Transition graph: vertices > states, edges > transitions                29
A Deterministic Finite Accepter or DFA is
defined as M  Q, ,  , q0 , F 
(Def. 2.1 p.38)
                                                         a,b
         GM
                                                            q5
              b            a                                      a,b
                                a    b
             q0 a         q1 b q2 b q3 a                          q4

     What are Q, , , q0, F?
     It is important to have a clear and intuitive picture to work with DFA.
     Transition graph: vertices > states, edges > transitions                30
Input Alphabet 
          a, b

                     a,b

                      q5
 b      a                  a,b
             a    b
q0 a   q1 b q2 b q3 a      q4

                                 31
Set of States Q
 Q  q0 , q1, q2 , q3 , q4 , q5

                          a,b

                           q5
 b      a                       a,b
             a    b
q0 a   q1 b q2 b q3 a           q4

                                      32
Initial State q0

                   a,b

                    q5
        a                 a,b
 b           a    b
q0 a   q1 b q2 b q3 a     q4


                                33
Set of Final States F
       F  q4 

                   a,b

                    q5
        a                a,b
 b           a    b
q0 a   q1 b q2 b q3 a    q4


                               34
Transition Function 
      :Q  Q
                        a,b
GM
                         q5
 b      a                     a,b
             a    b
q0 a   q1 b q2 b q3 a         q4

       By Transition Graph
                                    35
M  Q, , , q0 , F                               a,b

                                                         q5
     GM
          b             a                                      a,b
                             a    b
         q0 a          q1 b q2 b q3 a                          q4

What does “deterministic” mean?
                                             is a total function
Other than using transition graph GM to represent a
transition function, there are two common ways to
represent a transition function.
It is important to have a clear and intuitive picture to work with DFA.
Transition graph: vertices > states, edges > transitions                36
Transition Function                          
 q0 , a   q1  q0 , b   q5      q4 , a   q5  q4 , b   q5
 q1 , a   q5  q1 , b   q2      q5 , a   q5  q5 , b   q5
 q2 , a   q5  q2 , b   q3
 q3 , a   q4  q3 , b   q5
                                                           a,b

                                                            q5
                      b              a                           a,b
                                          a    b
                     q0 a           q1 b q2 b q3 a               q4
                                                                      37
Transition Function     
     a    b
q0   q1   q5
q1   q5   q2
q2   q5   q3
q3   q4   q5                      a,b
q4   q5   q5
q5   q5   q5                       q5
                b      a                a,b
                            a    b
               q0 a   q1 b q2 b q3 a    q4
                                             38
Extended Transition Function  *
                      including 

                * : Q  *  Q
  Transition
  function      :Q  Q
                                    a,b

                                     q5
                b       a                 a,b
                             a    b
               q0 a    q1 b q2 b q3 a     q4
                                               39
 * : Q  *  Q
        * q0 , ab  q2

                            a,b

                             q5
 b        a                       a,b
               a    b
q0 a     q1 b q2 b q3 a           q4

                                        40
 * q0 , abba  q4

                     a,b

                         q5
 b      a                     a,b
             a    b
q0 a   q1 b q2 b q3 a         q4

                                    41
 * q0 , abbbaa   q5

                      a,b

                       q5
 b      a                   a,b
             a    b
q0 a   q1 b q2 b q3 a       q4

                                  42
Extended Transition Function
          * : Q  *  Q
 Recursive Definition
   * ( q,  )  q,
   * (q, wa)   ( * (q, w), a)
 for all q Q, w*, a


                                    43
Recursive              * q,    q
     Definition
                            * q, wa    ( * (q, w), a)
             q                  wa                q

              q                w              q1 a      q

If  * q, wa   q
then  a state, say q1,                * q, wa    ( * (q, w), a)
such that  * q, wa    (q1 , a)
                  and
              * q, w  q1                                        44
 * q0 , ab                * q ,    q
  * (q0 , a ),b           * q, w    ( * (q, w), )
    *  0 ,  a ,b  
           q      ,
  q0 ,a  b  
            ,
 q1 , b  q2
                                          a,b

                                            q5
           b           a                         a,b
                            a    b
          q0 a        q1 b q2 b q3 a             q4
                                                            45
There is a walk in GM
from   q   to q with label w   1 2 ... k

           q             w              q



 In the DFA M, there is  * q, w  q
 with w   1 2 ... k
               1   2            k
           q                           q

                                                46
There is a walk in GM
from q to q with label w   1 2 ... k

         q             w             q



In the DFA M, there is  * q, w  q
with w   1 2 ... k

             1   2           k
        q                           q

                                            47
There is a walk in GM
from q to q with label w   1 2 ... k

         q             w             q

  Theorem 2.1
In the DFA M, there is  * q, w  q
with w   1 2 ... k

             1   2           k
        q                           q

                                            48
There is a walk from q0 to q5
               with label abbbaa
If and only if  * q0 , abbbaa   q5


                                a,b

                                  q5
          b      a                     a,b
                      a    b
         q0 a   q1 b q2 b q3 a         q4

                                             49
Languages Accepted by DFAs
 Take DFA M  Q, ,  , q0 , F 



   Definition: (p.40)
       The language L M         contains all input
        strings accepted by
                    M
       LM  = { strings that drive M to a final
        state}
                 = { w  * : *(q0, w) F }
                                                        50
Example

  M                              a,b

                                    q5
     b      a                             a,b
                 a    b
    q0 a   q1 b q2 b q3 a                 q4
                                       accept
LM   abba   back to complement Ex. p.51
                                                51
Another Example

 M                       a,b

                          q5
      b      a     a           a,b
                       b
     q0 a   q1 b q2 b q3 a     q4

  accept       accept        accept

LM    , ab, abba
                                      52
Formally, for a DFA M  Q, , , q0 , F 
   Since M is DFA, every w*, * q0 , w  q
                                 
    corresponding to a unique walk in the
    transition graph of M.
   If q  F                      w L(M )
        q0           w              q

   If q  F
                                    w L(M )
       q0            w              q

                                               53
Observation
   Language rejected by   M:
      LM   w  * :  * q0 , w  F 

      q0            w              q
                                        q  F


What is the complement of language on example
(p.48)? Example on p.48


                                                 54
Examples on Constructing DFAs
       LM   {a b : n  0}
                 n


  a                              a,b


  q0   b                a,b
                 q1               q2
               accept          trap state


                                            55
LM = { all strings with prefix ab }

                                 a,b



 q0       a       q1      b       q2

          b        a            accept

                  q3      a,b

                                         56
LM = { all strings without substring 001}


      1                         0                      0,1
           1

                      0                       1
                0               00                    001

           0        What if consider DFA for {strings with 001}?




                                                                   57
Regular Languages


   A language L is regular if there is a
    DFA M such that L  LM 


   All regular languages form a language
    family


                                            58
Examples of regular languages:

  abba      , ab, abba
  {a b : n  0}
    n

 { all strings with prefix   ab }
 { all strings without substring 001 }


 There exist automata that accept these
 Languages (see previous slides).
                                          59
Is the complement ofabba also regular?



How can you show that the complement of
a regular language is regular? (referring to
Hw# 3, 4 on p.47)



                                               60
Another Example
   The language    L  awa : w  a, b*
    is regular
                                              a
                                 b
since we can find a
DFA M such that                       b
                            a
    L  LM          q0         q2       q3

                       b              a
                      q4
    L*=L {}
                           a,b
                                                  61
Another Example
   The language L  awa : w  a, b*
    is regular. How about L2 ?




    Can you show L* is a regular language?

    Try Hw # 20, 21, 22


                                             62
Is L?
   If there is a DFA M for L, can you
    tell if L?

   If L is regular, then how about L-{}?
         How can you construct a DFA for L-{} from
         the DFA of L?

        How can you construct a DFA for L{} from
         the DFA of L?

    Try hw #17 & 18 p.48
                                                       63
Homework 2.1        p.47



 Try: 1 ~7, 9, 11~25
 Hand in: 2bd, 4, 6, 7e, 9bf, 18

       For hw18, state the general method then
        use the example to illustrate the method
        where L  {a,b}*
        L= {w: w= or w contains a substring “ab”}



                                                 64

More Related Content

More from issbp

Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systemsissbp
 
Os10 2
Os10 2Os10 2
Os10 2issbp
 
Os10
Os10Os10
Os10issbp
 
Os9 2
Os9 2Os9 2
Os9 2issbp
 
Os8 2
Os8 2Os8 2
Os8 2issbp
 
Os7 2
Os7 2Os7 2
Os7 2issbp
 
Os5 2
Os5 2Os5 2
Os5 2issbp
 
Os4 2
Os4 2Os4 2
Os4 2issbp
 
Os3 2
Os3 2Os3 2
Os3 2issbp
 
Os2 2
Os2 2Os2 2
Os2 2issbp
 
Class9
 Class9 Class9
Class9issbp
 
Class8
 Class8 Class8
Class8issbp
 

More from issbp (20)

Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systems
 
Os10 2
Os10 2Os10 2
Os10 2
 
Os10
Os10Os10
Os10
 
Os9 2
Os9 2Os9 2
Os9 2
 
Os9
Os9Os9
Os9
 
Os8 2
Os8 2Os8 2
Os8 2
 
Os8
Os8Os8
Os8
 
Os7 2
Os7 2Os7 2
Os7 2
 
Os7
Os7Os7
Os7
 
Os6
Os6Os6
Os6
 
Os5 2
Os5 2Os5 2
Os5 2
 
Os5
Os5Os5
Os5
 
Os4 2
Os4 2Os4 2
Os4 2
 
Os4
Os4Os4
Os4
 
Os3 2
Os3 2Os3 2
Os3 2
 
Os3
Os3Os3
Os3
 
Os2 2
Os2 2Os2 2
Os2 2
 
Os2
Os2Os2
Os2
 
Class9
 Class9 Class9
Class9
 
Class8
 Class8 Class8
Class8
 

Class2

  • 2. Finite Automaton Input A string over a given alphabet written on an input file String Output A control unit consisting of a finite number of internal states Finite String Automaton The internal state at the next time step is determined by the transition function 2
  • 3. Finite Accepter Input String Output “Accept” Finite or Automaton “Reject” 3
  • 4. Finite Accepter Input String of   Internal states Initial state q0 “Accept” q1 q5 or q2 q4 final state “Reject” q3 4
  • 5. Formalities Deterministic Finite Accepter (DFA) (p.38) M  Q, , , q0 , F  Q : set of internal states  : input alphabet  :Q×Q transition function q0 : initial state F : set of final states 5
  • 6. Finite Accepter Leftmost position Input String abba a b b a ×  : a particular status of the Initial configuration input file and internal state Internal states q0 “Accept” q1 q5 initial state or q2 q4 “Reject” q3 6
  • 7. At q0 now check for current symbol- Transition function a b b a ×   q0 , a   q1 Next state current state current input symbol move to the next state Internal states q0 “Accept” q1 q5 or q2 q4 “Reject” q3 7
  • 8. At q1 now check for current symbol- Transition function  q1 , b   q2 a b b a ×  Next state current state current input symbol move to the next state Internal states q0 “Accept” q1 q5 or q2 q4 “Reject” q3 8
  • 9. At q2 now check for current symbol- Transition function  q2 , b   q3 a b b a ×  Internal states q0 “Accept” q1 q5 or q2 q4 “Reject” q3 9
  • 10. At q3 now check for current symbol- Transition function  q3 , a   q4 a b ba ×  Internal states q0 “Accept” q1 q5 or q2 q4 “Reject” q3 10
  • 11. At q4 now check for current symbol- a b ba ×  No symbol left and it stops at final state Internal states q0 “Accept” q1 q5 or q2 q4 “Reject” q3 The string abba is accepted by the machine. 11
  • 12. Transition Graph GM  Transition functions are the most important part for a finite accepter.  We use a transition graph to represent a finite accepter such that Node  state, and Edge with label  transition function (current symbol) 12
  • 13. Transition Graph for   q2 , b   q3 Next state current state current input symbol q2 b q3 Initial state q0 Final state qf 13
  • 14. Transition Graph abba – a,b Finite Accepter q5 a a,b b a b q0 a q1 b q2 b q3 a q4 initial final state state transition state  q2 , b   q3 “accept” It is important to have a clear and intuitive picture to work with DFA. Transition graph: vertices > states, edges > transitions 14
  • 15. Initial Configuration Input String a b b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 15
  • 16. Reading the Input One at a time from left to right a b b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 16
  • 17. a b b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 17
  • 18. a b b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 18
  • 19. a b b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 19
  • 20. Input finished a b b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 Output: “accept” 20
  • 21. Another Example: aba a b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 21
  • 22. Initial Configuration a b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 22
  • 23. a b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 23
  • 24. a b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 24
  • 25. a b a a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 25
  • 26. Input finished a b a Output: a,b “reject” q5 a a,b b a b q0 a q1 b q2 b q3 a q4 26
  • 27. Another Input String  a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 27
  • 28. End of input! a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 Output:“reject” 28
  • 29. a,b GM q5 b a a,b a b q0 a q1 b q2 b q3 a q4 A Trap State It is important to have a clear and intuitive picture to work with DFA. Transition graph: vertices > states, edges > transitions 29
  • 30. A Deterministic Finite Accepter or DFA is defined as M  Q, ,  , q0 , F  (Def. 2.1 p.38) a,b GM q5 b a a,b a b q0 a q1 b q2 b q3 a q4 What are Q, , , q0, F? It is important to have a clear and intuitive picture to work with DFA. Transition graph: vertices > states, edges > transitions 30
  • 31. Input Alphabet    a, b a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 31
  • 32. Set of States Q Q  q0 , q1, q2 , q3 , q4 , q5 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 32
  • 33. Initial State q0 a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 33
  • 34. Set of Final States F F  q4  a,b q5 a a,b b a b q0 a q1 b q2 b q3 a q4 34
  • 35. Transition Function   :Q  Q a,b GM q5 b a a,b a b q0 a q1 b q2 b q3 a q4 By Transition Graph 35
  • 36. M  Q, , , q0 , F  a,b q5 GM b a a,b a b q0 a q1 b q2 b q3 a q4 What does “deterministic” mean?  is a total function Other than using transition graph GM to represent a transition function, there are two common ways to represent a transition function. It is important to have a clear and intuitive picture to work with DFA. Transition graph: vertices > states, edges > transitions 36
  • 37. Transition Function   q0 , a   q1  q0 , b   q5  q4 , a   q5  q4 , b   q5  q1 , a   q5  q1 , b   q2  q5 , a   q5  q5 , b   q5  q2 , a   q5  q2 , b   q3  q3 , a   q4  q3 , b   q5 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 37
  • 38. Transition Function   a b q0 q1 q5 q1 q5 q2 q2 q5 q3 q3 q4 q5 a,b q4 q5 q5 q5 q5 q5 q5 b a a,b a b q0 a q1 b q2 b q3 a q4 38
  • 39. Extended Transition Function  * including   * : Q  *  Q Transition function  :Q  Q a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 39
  • 40.  * : Q  *  Q  * q0 , ab  q2 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 40
  • 41.  * q0 , abba  q4 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 41
  • 42.  * q0 , abbbaa   q5 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 42
  • 43. Extended Transition Function  * : Q  *  Q Recursive Definition  * ( q,  )  q,  * (q, wa)   ( * (q, w), a) for all q Q, w*, a 43
  • 44. Recursive  * q,    q Definition  * q, wa    ( * (q, w), a) q wa q q w q1 a q If  * q, wa   q then  a state, say q1,  * q, wa    ( * (q, w), a) such that  * q, wa    (q1 , a) and  * q, w  q1 44
  • 45.  * q0 , ab    * q ,    q   * (q0 , a ),b    * q, w    ( * (q, w), )     *  0 ,  a ,b   q ,   q0 ,a  b   ,  q1 , b  q2 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 45
  • 46. There is a walk in GM from q to q with label w   1 2 ... k q w q In the DFA M, there is  * q, w  q with w   1 2 ... k 1 2 k q q 46
  • 47. There is a walk in GM from q to q with label w   1 2 ... k q w q In the DFA M, there is  * q, w  q with w   1 2 ... k 1 2 k q q 47
  • 48. There is a walk in GM from q to q with label w   1 2 ... k q w q Theorem 2.1 In the DFA M, there is  * q, w  q with w   1 2 ... k 1 2 k q q 48
  • 49. There is a walk from q0 to q5 with label abbbaa If and only if  * q0 , abbbaa   q5 a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 49
  • 50. Languages Accepted by DFAs  Take DFA M  Q, ,  , q0 , F   Definition: (p.40)  The language L M   contains all input strings accepted by M  LM  = { strings that drive M to a final state} = { w  * : *(q0, w) F } 50
  • 51. Example M a,b q5 b a a,b a b q0 a q1 b q2 b q3 a q4 accept LM   abba back to complement Ex. p.51 51
  • 52. Another Example M a,b q5 b a a a,b b q0 a q1 b q2 b q3 a q4 accept accept accept LM    , ab, abba 52
  • 53. Formally, for a DFA M  Q, , , q0 , F   Since M is DFA, every w*, * q0 , w  q  corresponding to a unique walk in the transition graph of M.  If q  F w L(M ) q0 w q  If q  F w L(M ) q0 w q 53
  • 54. Observation  Language rejected by M: LM   w  * :  * q0 , w  F  q0 w q q  F What is the complement of language on example (p.48)? Example on p.48 54
  • 55. Examples on Constructing DFAs LM   {a b : n  0} n a a,b q0 b a,b q1 q2 accept trap state 55
  • 56. LM = { all strings with prefix ab } a,b q0 a q1 b q2 b a accept q3 a,b 56
  • 57. LM = { all strings without substring 001} 1 0 0,1 1  0 1 0 00 001 0 What if consider DFA for {strings with 001}? 57
  • 58. Regular Languages  A language L is regular if there is a DFA M such that L  LM   All regular languages form a language family 58
  • 59. Examples of regular languages: abba  , ab, abba {a b : n  0} n { all strings with prefix ab } { all strings without substring 001 } There exist automata that accept these Languages (see previous slides). 59
  • 60. Is the complement ofabba also regular? How can you show that the complement of a regular language is regular? (referring to Hw# 3, 4 on p.47) 60
  • 61. Another Example  The language L  awa : w  a, b* is regular a b since we can find a DFA M such that b a L  LM  q0 q2 q3 b a q4 L*=L {} a,b 61
  • 62. Another Example  The language L  awa : w  a, b* is regular. How about L2 ? Can you show L* is a regular language? Try Hw # 20, 21, 22 62
  • 63. Is L?  If there is a DFA M for L, can you tell if L?  If L is regular, then how about L-{}?  How can you construct a DFA for L-{} from the DFA of L?  How can you construct a DFA for L{} from the DFA of L? Try hw #17 & 18 p.48 63
  • 64. Homework 2.1 p.47  Try: 1 ~7, 9, 11~25  Hand in: 2bd, 4, 6, 7e, 9bf, 18  For hw18, state the general method then use the example to illustrate the method where L  {a,b}* L= {w: w= or w contains a substring “ab”} 64