Examples for Finite Automata - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Examples for Finite Automata

Description:

dead state. 0,1. absorbing state. q4. 0. 0,1. Strings With Common Suffix ... All strings that contain eat or sea or easy. start. q2. a. q3. t. q1. e. q4. all ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 13
Provided by: cseCu
Category:

less

Transcript and Presenter's Notes

Title: Examples for Finite Automata


1
Examples for Finite Automata
Fall 2009
  • CSC3130 Tutorial One

Xiao Linfu
lfxiao_at_cse.cuhk.edu.hk
Department of Computer Science Engineering
2
Outline
  • DFA example
  • NFA example
  • NFA to DFA conversion
  • Regular Expressions

3
DFA
  • For every string x, there is a unique path from
    initial state and associated with x.
  • x is accepted if and only if this path ends at a
    accept state.

x
4
NFA
  • For any string x, there may exist none or more
    than one path from initial state and associated
    with x.
  • x is accepted if there is some path that ends at
    a accept state.

5
Strings With Common Prefix
  • Construct a DFA that accepts a language L over ?
    0, 1 such that L is the set of all strings
    starting with 101.

absorbing state
dead state
6
Strings With Common Suffix
  • Construct a DFA that accepts a language L over ?
    0, 1 such that L is the set of all strings
    ending with 101.

7
NFA for Common Suffix
  • We can have a simpler representation for common
    suffix language using NFA
  • Use subset construction to convert it to a DFA.

compare with previous DFA
8
NFA Example
  • Construct NFAs for the following languages over
    the alphabet a, b, , z
  • All strings that contain eat or sea or easy

9
NFA Example
  • Construct NFA for the language over the alphabet
    a, b, , z such that every string doesnt
    contain fool.

dead state
10
Regular Expressions
  • - Alphabet X a, b, c, d
  • (a b)
  • all strings containing only a and b
  • c(a b c)c2
  • all strings containing only a, b, and c that
    begin with c and end with cc
  • 3) all strings containing only one b
  • (acd)b(acd)

11
Regular Expressions
  • - Alphabet X 0, 1
  • (0 1)
  • the set of all binary strings
  • 03104
  • all strings consisting of three 0s, followed
    by any number of 1s, followed by four 0s
  • 01001
  • all strings starting with any number of
    0s, followed by 100, followed by and number of
    1s

12
  • Thank you!
Write a Comment
User Comments (0)
About PowerShow.com