SlideShare a Scribd company logo
1 of 50
Download to read offline
Finite Automata

                                   .




Source: Chapter 1.1 - Introduction to the Theory of Computation by Michael Sipser   1
?
                                 :
?
                           ?



                   (computational model).


    finite state machine       finite automaton.



                                                   2
Finite Automata
 finite automata


            ?


    -




                   3
(1)

              front          rear
               pad           pad


                      door

2
OPEN    CLOSED (                    )
    4
FRONT, REAR, BOTH,       NEITHER

                                        4
(2)
                   FRONT

 REAR                                  FRONT
 BOTH     CLOSED            OPEN        REAR
NETHER                                  BOTH
                   NETHER




          NETHER     FRONT     REAR      BOTH
 CLOSED   CLOSED     OPEN     CLOSED    CLOSED
  OPEN    CLOSED     OPEN      OPEN      OPEN


                                                 5
(3)

(         )




              6
Finite Automata
             finite automata
                               finite
 automata




                                        7
Finite Automata
                   0                 1
                                                 0

                          1
              q1                     q2                       q3

                                                0,1
         A finite automaton called M1 that has three states

 The start state is q1
 The accept state is q2
 The arrows going from one state to another are
 called transitions
 The output is either accept or reject.
                                                                   8
Finite Automata
                       0               1
                                                 0

                            1
                  q1                  q2                  q3

                                                0,1



                 “1101”,
 1.   Start in state q1.
 2.   Read 1, follow transition from q1 to q2.
 3.   Read 1, follow transition from q2 to q2.
 4.   Read 0, follow transition from q2 to q3.
 5.   Read 1, follow transition from q3 to q2.
 6.   Accept because M1 is in an accept state q2 at the end of the input.
                                                                      9
Finite Automata
                0            1
                                       0

                    1
           q1                q2            q3

                                   0,1



                        strings   M1
            ?
  1,01,11, and 0101010101.
  100, 0100, 110000, and 0101000000.

                                                10
Formal Definition
          state diagrams
          ,
       (formal definition)
           formal definition
                               finite automata

             formal definition
          (notation)         .


                                                 11
Formal Definition
 formal definition    finite automaton
                           5
   set of state
   input alphabet
   rules for moving
   start state
   accept states



                                         12
Formal Definition
A finite automaton is a 5-tuple (Q, Σ, δ, q0, F),
    where
1. Q is a finite set called the states,
2. Σ is a finite set called the alphabet,
3. δ : Q x Σ → Q is the transition function,
4. q0 ∈ Q is the start state, and
5. F ⊆ Q is the set of accept states.

                                                    13
Formal Definition
                        0                   1
                                                        0

                                   1
                   q1                       q2                   q3

                                                       0,1

    We can describe M1 formally by writing M1 = (Q, Σ, δ, q1, F), where

 Q = { q1, q2, q3 }
 Σ = { 0, 1 }                 0        1
 δ is described as      q1    q1       q2        δ(q1,0) = q1   δ(q1,1) = q2
                        q2    q3       q2        δ(q2,0) = q3   δ(q2,1) = q2
                        q3    q2       q2        δ(q3,0) = q2   δ(q3,1) = q2

 q1 is the start state, and
 F = { q2 }.
                                                                               14
Formal Definition
   A                                  M
       ,            A                        M
                L(M) = A
           M recognizes A    M accepts A.
                                 ,

                                  ,
                        (empty language ∅)


                                                 15
Extended Transition Function
δ : Q x Σ → Q is the transition function
   δ(q, a) = “the state to which the machine M
  goes if it is in state q and receives input symbol
  a”

δ*: Q x Σ* → Q is the extended transition function
  δ*(q, w) = “the state in which M ends up, if it
  begin in state q, and receives the string w of
  several symbols”
                                                   16
Extended Transition Function
    :

              δ*(q0,w) = q6
          a    b              a
     q0               ……..        q6



                   w = ab…a




                                       17
Extended Transition Function
Definition: Let M = (Q, Σ, δ, q0, F) be a DFA.
 Define the function

                 δ*: Q x Σ* → Q

recursively as follows.

When q ∈ Q, w ∈ Σ*, and a ∈ Σ,
    1. δ*(q, ε) = q
    2. δ*(q, wa) = δ(δ*(q, w), a)
                                                 18
Extended Transition Function
                  0       1
                                 0

                      1
             q1           q2           q3

                                 0,1

δ*(q1,010)
 δ*(q1, 010) = δ(δ*(q1,01), 0)
 δ*(q1, 01) = δ(δ*(q1,0), 1)
 δ*(q1,0) = δ(δ*(q1,ε), 0)
 δ*(q1,ε) = q1
                                            19
Formal Definition of Computation

 FA
          FA




                                   20
Formal Definition of Computation
 Let M = (Q, Σ, δ, q0, F) be a finite automaton
 Let w = w1w2…wn be a string where each wi is a
 member of the alphabet Σ.
 Then M accepts w if δ*(q0, w) ∈ F.
 We say that M recognizes language A if
      A = {w I M accepts w }.
 A language is called a regular language if some
 finite automaton recognizes it.


                                               21
Finite Automata
         automata




                 automata         ☺
                       automata

"reader as automaton" method

                                      22
(1)
alphabet   {0, 1}        FA
                        1


                    ?
                              1




                                  23
Example (2)




         qeven   qodd




                        24
Example (3)



    1         0




                  25
Example (3)



        0           1
                                   0


            qeven           qodd


                        1




                                       26
Example (4)

              0   (
 ε)




                      27
Example (5)



        0           1
                                   0


            qeven           qodd


                        1




                                       28
The Regular Operations
Definition
   Let A and B be languages. We define the regular
   operations union, concatenation, and star as
   follows.
   Union: A ∪ B = {x | x ∈ A or x ∈ B}
   Concatenation: A○B = {xy | x ∈ A and y ∈ B}
   Star: A* = {x1x2…xk | k ≥ 0 and each xi ∈ A}.



                                                     29
(alphabet) Σ
                       26    {a, b,..., z}.
   A = {good, bad}      B = {boy, girl}, then
A ∪ B = {good, bad, boy, girl}
A ○ B = {goodboy, goodgirl, badboy, badgirl}
A* = {ε, good, bad, goodgood, goodbad,
badgood, badbad, goodgoodgood,
goodgoodbad, goodbadgood, goodbadbad, ...}

                                                30
The Regular Operations
                              (closed)




          regular languages
 regular operations



                                         31
The Regular Operations
Theorem
           regular languages
             union
      A1     A2    regular languages,    A1 ∪ A2
       regular languages
Proof Idea:
 A1       A2    regular
      finite automaton M1      A1
      finite automaton M2      A2
               finite automaton M       A1 ∪ A2
 M               M1      M2
                                                   32
The Regular Operations
Proof Idea (   ):
 M                                 M1         M2
 M                                       M1          M2

                                                M1         M2
 (M1 x M2)
                           M
                                 M1         M2
                M
 M1     M2
                                                                33
                46: Introduction to the Theory of Computation
0               1                                            1               0
M1                                                            M2
               1                                                            0
      q0               q1                                          q0           q1
               0                                                        1

           0       1                      M1 ∪ M2                       0       1
     q0 q0 q1                                  0                   q0 q1 q0
     q1 q0 q1                                                      q1 q1 q0
                                  0                     0
                                              q01

                            q00           1         0       q11
                                      1                 1
                                              q10

                                                                                        34
                                              1
The Regular Operations
 Theorem
           regular languages
             concatenation
     A1      A2      regular languages       A1 ○ A2
        regular
 Proof Idea:
                                         union
        finite automata M1      M2           regular
  languages A1      A 2.
                                                       35
The Regular Operations
 Proof Idea: (cont.)
          M
      2              M1   M2




   nondeterminism.



                               36
FA
FA
                                           FA
                       0,1

                  1                                   M2
         0   q1        q3                        0         0,1
                                 M1        0,1        1
q0            0                       q0         q1        q2
                      0,1         0
     1            1          1
             q2       q4         q5



                      M1         M2                              37
FA
   :
        p    q    FA
indistinguishable

       δ*(p, w) ∈ F implies δ*(q, w) ∈ F

       δ*(p, w) ∉ F implies δ*(q, w) ∉ F
   for all w ∈ Σ*.

                                           38
FA
                    w ∈ Σ*
   δ*(p, w) ∈ F     δ*(q, w) ∉ F,
                             p          q
distinguishable          w


                    indistinguishable
   u   p   w

   v       w      δ*(p, w) ∈ F implies δ*(q, w) ∈ F
       q
                                                      39
FA
Indistinguishability                equivalence
  relations:
  1. p R p
  2. if p R q then q R p
  3. if p R q then q R r then p R r




                                                  40
FA
                             FA

    indistinguishable



distinguishable



                                  41
FA
Procedure: mark
  1.
  2.                           (p, q)     p∈F       q∉
  F             mark (p, q)          distinguishable
  3.                                       mark

                   (p, q)         a ∈ Σ,
             δ(p, a) = pa    δ(q, a) = qa
        (pa, qa)    mark        distinguishable
        mark (p, q)       distinguishable.
                                                     42
FA
             mark                               Q
     FA                          (disjoint
subsets)
      :
Q = {0,1,2,3,4,5,6,7}
unmarked pairs = (1,2), (1,4), (2,4), (3,5),
(3,7), (5,7) (                )
disjoint subsets = {0}, {1,2,4}, {3,5,7}, {6}
                                                    43
FA
Procedure: reduce
      FA M = (Q, Σ, δ, q0, F),                        FA
           M' = (Q', Σ, δ', q'0, F')
1.                   mark
   indistinguishable (                          ).
2.                            M'
   indistinguishable
                              q'124      {1,2,4}.
3.      δ' (ij..k, a) = lm…n        qr ∈ {qi,qj,…,qk}      qp ∈
   {ql,qm,…,qn}        δ (qr, a) = qp.
4. q'0                      M'                             0
5. F'                                       i        qi ∈ F.
                                                                  44
FA


                q1
                              1
       0
            0        0                 0,1
                         1
q0              q2                q4
                0        1
                                             j
       1
                q3                           q1
                                             q2
mark                         q4              q3
                                             q4   1   1   1   1
 1: (q0,q4), (q1,q4), (q2,q4), (q3,q4)
                                                  q0 q1 q2 q3     i
                                                                      45
FA
                                            0    1
                                                         marked
                                         q0 q1 q3        (q0,q4)
                                         q1 q2 q4        (q1,q4)
             q1                                          (q2,q4)
                          1              q2 q1 q4
     0                                                   (q3,q4)
         0        0                0,1   q3 q2 q4
                      1
q0           q2               q4         q4 q4 q4     → (q0,q4), (q2,q4)

             0        1
                                            j
     1
             q3                             q1
                                            q2
                                            q3
                                            q4   1   1    1   1
                                                 q0 q1 q2 q3       i
                                                                           46
FA
                                                 0    1
                                                              marked
                                              q0 q1 q3        (q0,q4)
                                              q1 q2 q4        (q1,q4)
                  q1                                          (q2,q4)
                               1              q2 q1 q4
       0                                                      (q3,q4)
              0        0                0,1   q3 q2 q4
                           1
q0                q2               q4         q4 q4 q4     → (q1,q4), (q3,q4)

                  0        1
                                                 j
        1
                  q3                             q1
                                                 q2
                                                 q3
                                                 q4   1   1    1   1
     2: (q0,q1), (q0,q2), (q0,q3)                     q0 q1 q2 q3       i
                                                                                47
FA
                                                 0    1
                                                              marked
                                              q0 q1 q3        (q0,q4)
                                              q1 q2 q4        (q1,q4)
                  q1                                          (q2,q4)
                               1              q2 q1 q4
       0                                                      (q3,q4)
              0        0                0,1   q3 q2 q4
                           1
q0                q2               q4         q4 q4 q4     → (q0,q1), (q0,q2),
                                                           (q0,q3), (q0,q4)
                  0        1
                                                 j
        1
                  q3                             q1   2
                                                 q2   2
                                                 q3   2
                                                 q4   1   1    1   1
     2: (q0,q1), (q0,q2), (q0,q3)                     q0 q1 q2 q3       i
                                                                                 48
FA
                                                      0       1
                                              q0 q1 q3
                                              q1 q2 q4
                q1
                             1                q2 q1 q4
     0
            0        0                0,1     q3 q2 q4
                         1
q0              q2               q4           q4 q4 q4

                0        1
      1
                q3                           q1   2
                                             q2   2       x
                                             q3   2       x       x
Unmarked pairs = (q1,q2), (q1,q3), (q2,q3)   q4   1       1       1   1
                                                  q0 q1 q2 q3
                                                                          49
FA
Q = {q0, q1, q2, q3, q4}
Unmarked pairs = (q1,q2), (q1,q3), (q2,q3)
The disjoint subsets = {q0}, {q1,q2,q3}, {q4}

                                           0   1
                  0          0,1
                                        q0 q1 q3
                                        q1 q2 q4
           0,1          1
     q0          q123        q4         q2 q1 q4
                                        q3 q2 q4
                                        q4 q4 q4
                                                   50

More Related Content

What's hot

Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata parmeet834
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramAbdullah Jan
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFAkunj desai
 
NFA DFA Equivalence theorem
NFA DFA Equivalence theorem NFA DFA Equivalence theorem
NFA DFA Equivalence theorem niveditJain
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite AutomatAdel Al-Ofairi
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)Naman Joshi
 
1.3.2 non deterministic finite automaton
1.3.2 non deterministic finite automaton1.3.2 non deterministic finite automaton
1.3.2 non deterministic finite automatonSampath Kumar S
 
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikNFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikMudsaraliKhushik
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Akila Krishnamoorthy
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Abhimanyu Mishra
 
Finite Automata
Finite AutomataFinite Automata
Finite Automataparmeet834
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020Avishek Sarkar
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Mohammad Ilyas Malik
 

What's hot (20)

Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
NFA DFA Equivalence theorem
NFA DFA Equivalence theorem NFA DFA Equivalence theorem
NFA DFA Equivalence theorem
 
Nfa to-dfa
Nfa to-dfaNfa to-dfa
Nfa to-dfa
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
Automata
AutomataAutomata
Automata
 
1.3.2 non deterministic finite automaton
1.3.2 non deterministic finite automaton1.3.2 non deterministic finite automaton
1.3.2 non deterministic finite automaton
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
 
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikNFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushik
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
 
DFA Minimization
DFA MinimizationDFA Minimization
DFA Minimization
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Theory of Computation Unit 4
Theory of Computation Unit 4Theory of Computation Unit 4
Theory of Computation Unit 4
 
Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
 

Viewers also liked

Finite Automata
Finite AutomataFinite Automata
Finite AutomataShiraz316
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata introlavishka_anuj
 
Automata
AutomataAutomata
AutomataGaditek
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of AutomataFarooq Mian
 
Nfa presentation
Nfa presentationNfa presentation
Nfa presentationannholtz
 
Nfa presentation
Nfa presentationNfa presentation
Nfa presentationannholtz
 
Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...
Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...
Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...Jurgen Riedel
 
online payment system using Steganography and Visual cryptography
online payment system using Steganography and Visual cryptographyonline payment system using Steganography and Visual cryptography
online payment system using Steganography and Visual cryptographyShahrukh Ali
 
Visual Cryptography Industrial Training Report
Visual Cryptography Industrial Training ReportVisual Cryptography Industrial Training Report
Visual Cryptography Industrial Training ReportMohit Kumar
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theoryNYversity
 
Scene Text Detection on Images using Cellular Automata
Scene Text Detection on Images using Cellular AutomataScene Text Detection on Images using Cellular Automata
Scene Text Detection on Images using Cellular AutomataKonstantinos Zagoris
 
String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,8neutron8
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 

Viewers also liked (20)

Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Finite automata
Finite automataFinite automata
Finite automata
 
Finite automata
Finite automataFinite automata
Finite automata
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
 
Deterministic Finite Automata
Deterministic Finite AutomataDeterministic Finite Automata
Deterministic Finite Automata
 
Automata
AutomataAutomata
Automata
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
1.1
1.11.1
1.1
 
Nfa presentation
Nfa presentationNfa presentation
Nfa presentation
 
Nfa presentation
Nfa presentationNfa presentation
Nfa presentation
 
Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...
Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...
Block Emulation and Computation in One-dimensional Cellular Automata: Breakin...
 
Automata Invasion
Automata InvasionAutomata Invasion
Automata Invasion
 
online payment system using Steganography and Visual cryptography
online payment system using Steganography and Visual cryptographyonline payment system using Steganography and Visual cryptography
online payment system using Steganography and Visual cryptography
 
Visual Cryptography Industrial Training Report
Visual Cryptography Industrial Training ReportVisual Cryptography Industrial Training Report
Visual Cryptography Industrial Training Report
 
Visual cryptography
Visual cryptographyVisual cryptography
Visual cryptography
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
 
Scene Text Detection on Images using Cellular Automata
Scene Text Detection on Images using Cellular AutomataScene Text Detection on Images using Cellular Automata
Scene Text Detection on Images using Cellular Automata
 
String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 

Similar to Finite automata

FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).pptssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.pptRohitPaul71
 
0227 regularlanguages
 0227 regularlanguages 0227 regularlanguages
0227 regularlanguagesissbp
 
Materi 3 Finite State Automata
Materi 3   Finite State AutomataMateri 3   Finite State Automata
Materi 3 Finite State Automataahmad haidaroh
 
Finite state machine without output
Finite state machine without outputFinite state machine without output
Finite state machine without outputTayyab Rajput
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxamara jyothi
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxranjan317165
 
Pushdown Automaton (1).ppt
Pushdown Automaton (1).pptPushdown Automaton (1).ppt
Pushdown Automaton (1).pptviswanath kani
 
Graph representation of DFA’s Da
Graph representation of DFA’s DaGraph representation of DFA’s Da
Graph representation of DFA’s Daparmeet834
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machineslavishka_anuj
 
Deterministic finite automata
Deterministic finite automata Deterministic finite automata
Deterministic finite automata Muhammad Love Kian
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
Class3
 Class3 Class3
Class3issbp
 
1. finite_automata_new.ppt
1. finite_automata_new.ppt1. finite_automata_new.ppt
1. finite_automata_new.pptSanthoshS508159
 

Similar to Finite automata (20)

FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
 
0227 regularlanguages
 0227 regularlanguages 0227 regularlanguages
0227 regularlanguages
 
Dfa
DfaDfa
Dfa
 
Materi 3 Finite State Automata
Materi 3   Finite State AutomataMateri 3   Finite State Automata
Materi 3 Finite State Automata
 
Finite state machine without output
Finite state machine without outputFinite state machine without output
Finite state machine without output
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
O2
O2O2
O2
 
Fsa
FsaFsa
Fsa
 
Chapter7
Chapter7Chapter7
Chapter7
 
Pushdown Automaton (1).ppt
Pushdown Automaton (1).pptPushdown Automaton (1).ppt
Pushdown Automaton (1).ppt
 
Graph representation of DFA’s Da
Graph representation of DFA’s DaGraph representation of DFA’s Da
Graph representation of DFA’s Da
 
Teori automata lengkap
Teori automata lengkapTeori automata lengkap
Teori automata lengkap
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machines
 
TuringMachines.ppt
TuringMachines.pptTuringMachines.ppt
TuringMachines.ppt
 
Deterministic finite automata
Deterministic finite automata Deterministic finite automata
Deterministic finite automata
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Class3
 Class3 Class3
Class3
 
1. finite_automata_new.ppt
1. finite_automata_new.ppt1. finite_automata_new.ppt
1. finite_automata_new.ppt
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

Finite automata

  • 1. Finite Automata . Source: Chapter 1.1 - Introduction to the Theory of Computation by Michael Sipser 1
  • 2. ? : ? ? (computational model). finite state machine finite automaton. 2
  • 3. Finite Automata finite automata ? - 3
  • 4. (1) front rear pad pad door 2 OPEN CLOSED ( ) 4 FRONT, REAR, BOTH, NEITHER 4
  • 5. (2) FRONT REAR FRONT BOTH CLOSED OPEN REAR NETHER BOTH NETHER NETHER FRONT REAR BOTH CLOSED CLOSED OPEN CLOSED CLOSED OPEN CLOSED OPEN OPEN OPEN 5
  • 6. (3) ( ) 6
  • 7. Finite Automata finite automata finite automata 7
  • 8. Finite Automata 0 1 0 1 q1 q2 q3 0,1 A finite automaton called M1 that has three states The start state is q1 The accept state is q2 The arrows going from one state to another are called transitions The output is either accept or reject. 8
  • 9. Finite Automata 0 1 0 1 q1 q2 q3 0,1 “1101”, 1. Start in state q1. 2. Read 1, follow transition from q1 to q2. 3. Read 1, follow transition from q2 to q2. 4. Read 0, follow transition from q2 to q3. 5. Read 1, follow transition from q3 to q2. 6. Accept because M1 is in an accept state q2 at the end of the input. 9
  • 10. Finite Automata 0 1 0 1 q1 q2 q3 0,1 strings M1 ? 1,01,11, and 0101010101. 100, 0100, 110000, and 0101000000. 10
  • 11. Formal Definition state diagrams , (formal definition) formal definition finite automata formal definition (notation) . 11
  • 12. Formal Definition formal definition finite automaton 5 set of state input alphabet rules for moving start state accept states 12
  • 13. Formal Definition A finite automaton is a 5-tuple (Q, Σ, δ, q0, F), where 1. Q is a finite set called the states, 2. Σ is a finite set called the alphabet, 3. δ : Q x Σ → Q is the transition function, 4. q0 ∈ Q is the start state, and 5. F ⊆ Q is the set of accept states. 13
  • 14. Formal Definition 0 1 0 1 q1 q2 q3 0,1 We can describe M1 formally by writing M1 = (Q, Σ, δ, q1, F), where Q = { q1, q2, q3 } Σ = { 0, 1 } 0 1 δ is described as q1 q1 q2 δ(q1,0) = q1 δ(q1,1) = q2 q2 q3 q2 δ(q2,0) = q3 δ(q2,1) = q2 q3 q2 q2 δ(q3,0) = q2 δ(q3,1) = q2 q1 is the start state, and F = { q2 }. 14
  • 15. Formal Definition A M , A M L(M) = A M recognizes A M accepts A. , , (empty language ∅) 15
  • 16. Extended Transition Function δ : Q x Σ → Q is the transition function δ(q, a) = “the state to which the machine M goes if it is in state q and receives input symbol a” δ*: Q x Σ* → Q is the extended transition function δ*(q, w) = “the state in which M ends up, if it begin in state q, and receives the string w of several symbols” 16
  • 17. Extended Transition Function : δ*(q0,w) = q6 a b a q0 …….. q6 w = ab…a 17
  • 18. Extended Transition Function Definition: Let M = (Q, Σ, δ, q0, F) be a DFA. Define the function δ*: Q x Σ* → Q recursively as follows. When q ∈ Q, w ∈ Σ*, and a ∈ Σ, 1. δ*(q, ε) = q 2. δ*(q, wa) = δ(δ*(q, w), a) 18
  • 19. Extended Transition Function 0 1 0 1 q1 q2 q3 0,1 δ*(q1,010) δ*(q1, 010) = δ(δ*(q1,01), 0) δ*(q1, 01) = δ(δ*(q1,0), 1) δ*(q1,0) = δ(δ*(q1,ε), 0) δ*(q1,ε) = q1 19
  • 20. Formal Definition of Computation FA FA 20
  • 21. Formal Definition of Computation Let M = (Q, Σ, δ, q0, F) be a finite automaton Let w = w1w2…wn be a string where each wi is a member of the alphabet Σ. Then M accepts w if δ*(q0, w) ∈ F. We say that M recognizes language A if A = {w I M accepts w }. A language is called a regular language if some finite automaton recognizes it. 21
  • 22. Finite Automata automata automata ☺ automata "reader as automaton" method 22
  • 23. (1) alphabet {0, 1} FA 1 ? 1 23
  • 24. Example (2) qeven qodd 24
  • 25. Example (3) 1 0 25
  • 26. Example (3) 0 1 0 qeven qodd 1 26
  • 27. Example (4) 0 ( ε) 27
  • 28. Example (5) 0 1 0 qeven qodd 1 28
  • 29. The Regular Operations Definition Let A and B be languages. We define the regular operations union, concatenation, and star as follows. Union: A ∪ B = {x | x ∈ A or x ∈ B} Concatenation: A○B = {xy | x ∈ A and y ∈ B} Star: A* = {x1x2…xk | k ≥ 0 and each xi ∈ A}. 29
  • 30. (alphabet) Σ 26 {a, b,..., z}. A = {good, bad} B = {boy, girl}, then A ∪ B = {good, bad, boy, girl} A ○ B = {goodboy, goodgirl, badboy, badgirl} A* = {ε, good, bad, goodgood, goodbad, badgood, badbad, goodgoodgood, goodgoodbad, goodbadgood, goodbadbad, ...} 30
  • 31. The Regular Operations (closed) regular languages regular operations 31
  • 32. The Regular Operations Theorem regular languages union A1 A2 regular languages, A1 ∪ A2 regular languages Proof Idea: A1 A2 regular finite automaton M1 A1 finite automaton M2 A2 finite automaton M A1 ∪ A2 M M1 M2 32
  • 33. The Regular Operations Proof Idea ( ): M M1 M2 M M1 M2 M1 M2 (M1 x M2) M M1 M2 M M1 M2 33 46: Introduction to the Theory of Computation
  • 34. 0 1 1 0 M1 M2 1 0 q0 q1 q0 q1 0 1 0 1 M1 ∪ M2 0 1 q0 q0 q1 0 q0 q1 q0 q1 q0 q1 q1 q1 q0 0 0 q01 q00 1 0 q11 1 1 q10 34 1
  • 35. The Regular Operations Theorem regular languages concatenation A1 A2 regular languages A1 ○ A2 regular Proof Idea: union finite automata M1 M2 regular languages A1 A 2. 35
  • 36. The Regular Operations Proof Idea: (cont.) M 2 M1 M2 nondeterminism. 36
  • 37. FA FA FA 0,1 1 M2 0 q1 q3 0 0,1 M1 0,1 1 q0 0 q0 q1 q2 0,1 0 1 1 1 q2 q4 q5 M1 M2 37
  • 38. FA : p q FA indistinguishable δ*(p, w) ∈ F implies δ*(q, w) ∈ F δ*(p, w) ∉ F implies δ*(q, w) ∉ F for all w ∈ Σ*. 38
  • 39. FA w ∈ Σ* δ*(p, w) ∈ F δ*(q, w) ∉ F, p q distinguishable w indistinguishable u p w v w δ*(p, w) ∈ F implies δ*(q, w) ∈ F q 39
  • 40. FA Indistinguishability equivalence relations: 1. p R p 2. if p R q then q R p 3. if p R q then q R r then p R r 40
  • 41. FA FA indistinguishable distinguishable 41
  • 42. FA Procedure: mark 1. 2. (p, q) p∈F q∉ F mark (p, q) distinguishable 3. mark (p, q) a ∈ Σ, δ(p, a) = pa δ(q, a) = qa (pa, qa) mark distinguishable mark (p, q) distinguishable. 42
  • 43. FA mark Q FA (disjoint subsets) : Q = {0,1,2,3,4,5,6,7} unmarked pairs = (1,2), (1,4), (2,4), (3,5), (3,7), (5,7) ( ) disjoint subsets = {0}, {1,2,4}, {3,5,7}, {6} 43
  • 44. FA Procedure: reduce FA M = (Q, Σ, δ, q0, F), FA M' = (Q', Σ, δ', q'0, F') 1. mark indistinguishable ( ). 2. M' indistinguishable q'124 {1,2,4}. 3. δ' (ij..k, a) = lm…n qr ∈ {qi,qj,…,qk} qp ∈ {ql,qm,…,qn} δ (qr, a) = qp. 4. q'0 M' 0 5. F' i qi ∈ F. 44
  • 45. FA q1 1 0 0 0 0,1 1 q0 q2 q4 0 1 j 1 q3 q1 q2 mark q4 q3 q4 1 1 1 1 1: (q0,q4), (q1,q4), (q2,q4), (q3,q4) q0 q1 q2 q3 i 45
  • 46. FA 0 1 marked q0 q1 q3 (q0,q4) q1 q2 q4 (q1,q4) q1 (q2,q4) 1 q2 q1 q4 0 (q3,q4) 0 0 0,1 q3 q2 q4 1 q0 q2 q4 q4 q4 q4 → (q0,q4), (q2,q4) 0 1 j 1 q3 q1 q2 q3 q4 1 1 1 1 q0 q1 q2 q3 i 46
  • 47. FA 0 1 marked q0 q1 q3 (q0,q4) q1 q2 q4 (q1,q4) q1 (q2,q4) 1 q2 q1 q4 0 (q3,q4) 0 0 0,1 q3 q2 q4 1 q0 q2 q4 q4 q4 q4 → (q1,q4), (q3,q4) 0 1 j 1 q3 q1 q2 q3 q4 1 1 1 1 2: (q0,q1), (q0,q2), (q0,q3) q0 q1 q2 q3 i 47
  • 48. FA 0 1 marked q0 q1 q3 (q0,q4) q1 q2 q4 (q1,q4) q1 (q2,q4) 1 q2 q1 q4 0 (q3,q4) 0 0 0,1 q3 q2 q4 1 q0 q2 q4 q4 q4 q4 → (q0,q1), (q0,q2), (q0,q3), (q0,q4) 0 1 j 1 q3 q1 2 q2 2 q3 2 q4 1 1 1 1 2: (q0,q1), (q0,q2), (q0,q3) q0 q1 q2 q3 i 48
  • 49. FA 0 1 q0 q1 q3 q1 q2 q4 q1 1 q2 q1 q4 0 0 0 0,1 q3 q2 q4 1 q0 q2 q4 q4 q4 q4 0 1 1 q3 q1 2 q2 2 x q3 2 x x Unmarked pairs = (q1,q2), (q1,q3), (q2,q3) q4 1 1 1 1 q0 q1 q2 q3 49
  • 50. FA Q = {q0, q1, q2, q3, q4} Unmarked pairs = (q1,q2), (q1,q3), (q2,q3) The disjoint subsets = {q0}, {q1,q2,q3}, {q4} 0 1 0 0,1 q0 q1 q3 q1 q2 q4 0,1 1 q0 q123 q4 q2 q1 q4 q3 q2 q4 q4 q4 q4 50