Lecture 03

Establishing regularity

\(L=\{w_1, w_2, ...,w_n: n\geq 2, w_{n-1} = 1\}\)

Proposition: \(L\) is regular Proof:

Aside:

First, \(M\) does not accept \(\epsilon\) because \(q_{00}\not\in\epsilon\).

The only states that can be reached with one transition are \(q_{00}, q_{01}\), neither of which is in \(F\), so \(M\) correctly does not accept them.

Let \(W=w_1,...,w_n\), \(n\geq 2\) where \(n_{n-1}=1\). For any state \(q\in Q\), \(\delta(q,1)\in\{q_{00}, q_{01}\}\), so the state \(r_{n-1}\) reached after reading \(n-1\) symbols is \(q_{01}\) or \(q_{11}\). For any \(\sigma\in\{0,1\}\) \(\delta(q_{01}, \sigma)\in\{q_{10}, q_{11}\}\) and \(\delta(q_{11}, \sigma)\in\{q_{10}, q_{11}\}\). In all these cases, we end up in a state in \(F\) and \(M\) correctly accepts.

When \(W=w_1,...,w_n\), \(n\geq 2\) where \(n_{n-1}=0\), (similar argument shows that \(M\) never accepts).

Regular Expressions

Theorem If \(L\) is a language over \(\Sigma\) that satisfies

then \(L\) is regular

Proof:

Definition: A string \(R\) over \(\Sigma\cup\{\bar\epsilon,|,*,(,)\}\) is regular expression if

Definition \(L(R)\) is the language represented by regular expression \(R\)

exercise Define a regular expression that represents the language

  1. All strings that end with \(1\)
  2. All strings that with even number of \(1\)s
  3. All string with even number of \(0\)s and even number of \(1\)s

Kleene's Theorem

Theorem The language \(L\) is regular if and only if it can be represented by a regular expression.

Proof Sketch

  1. RE \(\rightarrow\) NFA, we already saw (Thompson's algorithm 1968).
  2. DFA \(\rightarrow\) RE (via generalized NFAs)
    1. Add start, end
    2. Replace \(a,b\) transition
    3. Remove states of \(M\) one at a time