Highschool assignment on this stuff for historical purposes :)

Regular Languages

An alphabet is denoted as , and is the set of all strings formed with
We denote a language as
The power set (the set of all subsets) of is denoted as , so

Regular languages are languages that can be determined by deterministic finite automata
DFA are good models for machines with extremely limited memory
A finite automaton is a 5-tuple ,

  • is a finite set of states
  • is a finite alphabet
  • is a transition function
  • is a start state
  • is a set of accept states

The finite automaton determines a language if only “processing” a string (and all strings) results in an accept state . This is a fairly self-explanatory process, we start at and repeatedly run the transition function over the next symbol in .

A non-deterministic finite automata (NFA) can be in multiple states at once. Funky!
Additionally, a state can lack a transition for a symbol, or even transition without a symbol ()

The NFA computes like the multi-verse (it follows all different possibilities in parallel). This can be viewed as guessing the future, and then verifying it as the rest of the input is read in. If a machine’s guess is not verifiable, it dies! If any copy is in an accept state, then the string is accepted.

An NFA is still a 5-tuple , but now where ( is sometimes written )

Interestingly, NFAs have the same computational power as DFAs. That is, any NFA can be converted to a DFA. However, they let you express a lot of interesting languages more concisely, so it’s a good showcase of the power of DFAs.

This isn’t as strange as it sounds. Our DFA will have a state for every possible subset of states in our NFA, with a transition function modified appropriately. Of course, this will not necessarily be the minimum DFA for the language (on the contrary).

We say regular languages are closed under three regular operations,

These aren’t too difficult to see. These regular operations help us show other closure properties,

  • (use )
  • (start at each of the end states, flip the transitions)
  • (construct with De Morgan’s law)

Non-Regular Languages

Given a language , how do we check it is not regular? Having trouble constructing a DFA is not sufficient…

Let be a DFA with states. Any string that has length at least must visit some state more than once. That means the substring of between a revisited state can be removed or multiplied without changing the string’s acceptance.

In other words, for any regular language , there is a pumping length , such that for any string , where , we can write with , , and for all

So to show something is not a regular language, we show that we can break the pumping lemma for any choice of , as a proof by contradiction.

Example:
Assume is regular and let be the pumping length. Consider the string .

Because and , the pumping lemma guarantees that can be split into pieces such that , , and for all .

But since , consists solely of , we have