Skip to content

2. DFAs

Jan 13, 2022

Deterministic Finite Automata

1
Input tape (str)   =>  [ DFA ]  =>   Output: accept/reject
  • for every state there is a transition for every symbol, in the alphabet
  • machine cannot change memory, only read from it
  • to accept: all input is scanned and last state is accepting
  • to reject: all input is scanned and the last state is non-accepting

Formal definition

  • M=(Q,Σ,δ,q0,F) where
    • Q is set of states
    • Σ is input alphabet and ϵΣ (never contains empty string)
    • δ is transition function
    • q0 is initial state
    • F is set of accepting states (0 or more)

Transition function

  • δ:Q×ΣQ
  • describes the result of a transition from state q with symbol x: δ(q,x)=q
  • can be represented as a transition table, for example:

    δ a b
    q0 q1 q2
    q1 q0 q2
    q2 q2 q0

Extended transition function

  • δ:Q×ΣQ
  • δ(q,x)=q
  • describes the resulting state after scanning string w from state q
  • example: δ(q0,abbba)=q2
  • special case, for any state q: δ(q,ϵ)=q
  • in general: implies there is a walk of transitions w=σ1σ2...σk from q to q'

Language accepted by DFA

  • L(M) denotes and contains all strings accepted by M, i.e. M recognizes L(M)
  • for a DFA, M=(Q,Σ,δ,q0,F)   =>   L(M)={wΣ:δ(q0,w)F}
  • language rejected by M: L(M)={wΣ:δ(q0,w)F}
  • language L is regular is there is a DFA M that accepts it L(M)=L
  • the languages accepted by DFAs form the family of regular languages