Book: pdf

Q1: T/F, if F explain why. Q4: regular expression, 5 separate q Q2/Q3: DFAs and NFAs

  • Product construction: of DFAs
  • Subset construction: NFA to DFA
  • Quotient construction: State minimization

Set theory

Complement in :

associative:

commutative:

null set

null set is the identity for and annihilator for set concatenation

and

set is an identity for set concatenation

Set union and intersection are distributive over set concatenation

Set concatenation distributes over union

DFA

definition

examples

Ex: . Creates a DFA that accepts all strings that contains at least three a’s.

Transition function:

representation:

stateDiagram-v2
  direction LR

  [*] --> 1
  1 --> 1 : b
  1 --> 2 : a
  2 --> 2 : b
  2 --> 3 : a
  3 --> 3 : b
  3 --> 4 : a
  4 --> 4 : a, b
  4 --> [*]

if in final string then accept, otherwise reject the string

Lien vers l'original

Let , thus

therefore

regularity

Important

Important

a subset is regular if and only if there exists a DFA such that

Important

All finite languages are regular, but not all regular languages are finite

examples

Show is regular where , with

Three states, , where denotes the string mod 3 is 0, denotes the string mod 3 is 1, and denotes the string mod 3 is 2.

, ,

stateDiagram-v2
  direction LR

  [*] --> q0
  q0 --> q1 : 1
  q0 --> q0 : 0
  q1 --> q2 : 0
  q1 --> q0 : 1
  q2 --> q1 : 0
  q2 --> q2 : 1
  q0 --> [*]

product construction

Assume that A, B are regular, there are automata

Thus

where , , , and

with and , then is regular.

Lemma 4.1

Complement set:

Trivial machine , ,

De Morgan laws

Theorem 4.2

is regular

is regular

is regular


NFA

definition

Lien vers l'original

transition function

subset construction

acceptance

accepts if

Define

Theorem 4.3

Every DFA is equvalent to an NFA where

Lemma 6.1

For any ,

Lemma 6.2

commutes with set union:

Let be arbitrary NFA. Let M be DFA where:

Lemma 6.3

For any

Theorem 6.4

The automata M and N accept the same sets.

regex

atomic patterns are:

  • : matched by any symbols
  • : matched by any string

compound patterns are formed by combining binary operators and unary operators.

redundancy

,

if and are patterns, then so are

The following holds for x matches:

Theorem 7.1

Singleton set

Finite set:

Theorem 9

quotient automata

also known as DFA state minimization

definition

Define

where (13.1)

Lemma 13.5

If , then equivalently, if , then

Lemma 13.6

Lemma 13.7

Theorem 13.8

algorithm

  1. Table of all pairs
  2. Mark all pairs if
  3. If there exists unmarked pair , such that is marked, then mark
  4. is not marked