Lecture 18: Nonregular Languages

Date
Regular languages correspond to problems that can be solved with finite memory.

On the contrary, we have non-regular languages:

Nonregular languages, in a sense, correspond to problems that cannot be solved with finite memory.

(i.e. problems NOT solvable by a computer).


Finding nonregular languages

For regular languages, it was theoretically easier to prove since it was existential: all we needed to do was find one NFA/DFA/regex.

However for NRL's, it is a universal statement. You might think that we'd need to prove that there exists no NFA or DFA or regex. But actually, we can leverage some intuition and realize that we only need to prove that there exist no DFA which subsequently covers all the other cases.

Drawing DFAs and proof routes

In general, there are two proof routes:

Distinguishability

Formalizing the above intuition essentially.

This setting guideline for what is accepted (exactly one) and not (if both are in the language, that would be impossible given our intuition).

Even more generalizable, we say that any two input strings that are distinguishable, must end up in different states (meaning one is rejected by the language and the other is accepted):

Proof by distinguishability (contradiction)

This is the "gold-standard" proof example for nonregular languages:

Another proof

Note on automaton construction: an underlying question you should keep in your mind (for all machine constructions for that matter) is "what do you need to remember" regarding the language.

Use the distinguishability property as a Lemma:

Then, we get:


Proof template

As you can see, this second proof is nearly identical to the first proof. This means we can generalize this form via the following proof template:

Generalizing this

We can now actually generalize this by introducing the notion of the distinguished sets implication:

Myhill-Nerode Theorem

Since we have introduced the above, we get the following theorem:

This has two meanings:

  1. The set is infinite in cardinality
  1. Each string in the set is different (constituting a distinguishing set)

We can now use this tool to prove what we just did earlier, but much more elegantly:

Intution in using the theorem: