Lec 3 ---- dfa

of 57/57
Fall 2006 Costas Busch - RPI 1 Deterministic Finite Automata And Regular Languages
  • date post

    11-Apr-2017
  • Category

    Education

  • view

    35
  • download

    0

Embed Size (px)

Transcript of Lec 3 ---- dfa

  • Deterministic Finite Automata

    And Regular Languages

    Costas Busch - RPI

  • Deterministic Finite Automaton (DFA) Input TapeAccept orRejectStringFiniteAutomatonOutput

    Costas Busch - RPI

  • Transition Graph initialstate accepting statestatetransition

    Costas Busch - RPI

  • For every state, there is a transitionfor every symbol in the alphabetAlphabet

    Costas Busch - RPI

  • Initial Configuration Input StringInitial stateInput Tapehead

    Costas Busch - RPI

  • Scanning the Input

    Costas Busch - RPI

  • Costas Busch - RPI

  • Costas Busch - RPI

  • acceptInput finished

    Costas Busch - RPI

  • A Rejection CaseInput String

    Costas Busch - RPI

  • Costas Busch - RPI

  • Costas Busch - RPI

  • rejectInput finished

    Costas Busch - RPI

  • Another Rejection CaseTape is emptyrejectInput Finished

    Costas Busch - RPI

  • Language Accepted:

    Costas Busch - RPI

  • To accept a string:all the input string is scanned and the last state is acceptingTo reject a string:all the input string is scanned and the last state is non-accepting

    Costas Busch - RPI

  • Another Example AcceptstateAcceptstateAcceptstate

    Costas Busch - RPI

  • Empty TapeacceptInput Finished

    Costas Busch - RPI

  • Another ExampleAccept statetrap state

    Costas Busch - RPI

  • Input String

    Costas Busch - RPI

  • Costas Busch - RPI

  • Costas Busch - RPI

  • acceptInput finished

    Costas Busch - RPI

  • A rejection caseInput String

    Costas Busch - RPI

  • Costas Busch - RPI

  • Costas Busch - RPI

  • rejectInput finished

    Costas Busch - RPI

  • Language Accepted:

    Costas Busch - RPI

  • Another ExampleAlphabet:Language Accepted:

    Costas Busch - RPI

  • Formal Definition Deterministic Finite Automaton (DFA): set of states: input alphabet: transition function: initial state: set of accepting states

    Costas Busch - RPI

  • Set of States Example

    Costas Busch - RPI

  • Input Alphabet :the input alphabet never contains Example

    Costas Busch - RPI

  • Initial State Example

    Costas Busch - RPI

  • Set of Accepting States Example

    Costas Busch - RPI

  • Transition Function Describes the result of a transitionfrom state with symbol

    Costas Busch - RPI

  • Example:

    Costas Busch - RPI

  • Costas Busch - RPI

  • Costas Busch - RPI

  • Transition Table for statessymbols

    Costas Busch - RPI

  • Extended Transition Function Describes the resulting state after scanning string from state

    Costas Busch - RPI

  • Example:

    Costas Busch - RPI

  • Costas Busch - RPI

  • Costas Busch - RPI

  • Special case:for any state

    Costas Busch - RPI

  • states may be repeatedIn general:implies that there is a walk of transitions

    Costas Busch - RPI

  • Language Accepted by DFA

    it is denoted as and containsall the strings accepted by Language of DFA :We say that a language is accepted (or recognized) by DFA if

    Costas Busch - RPI

  • For a DFA

    Language accepted by :

    Costas Busch - RPI

  • Language rejected by :

    Costas Busch - RPI

  • More DFA ExamplesEmpty languageAll strings

    Costas Busch - RPI

  • Language of the empty string

    Costas Busch - RPI

  • = { all strings with prefix }accept

    Costas Busch - RPI

  • = { all binary strings containing substring }

    Costas Busch - RPI

  • = { all binary strings without substring }

    Costas Busch - RPI

  • Costas Busch - RPI

  • Regular LanguagesDefinition:A language is regular if there is a DFA that accepts it ( )

    The languages accepted by all DFAs form the family of regular languages

    Costas Busch - RPI

  • { all strings in {a,b}* with prefix }{ all binary strings without substring }Example regular languages:There exist automata that accept theselanguages (see previous slides).

    Costas Busch - RPI

  • There exist languages which are not Regular:There is no DFA that accepts these languages(we will prove this in a later class)

    Costas Busch - RPI