https://scribbletogether.com/whiteboard/4B9CDEC9-9D0D-4D64-B328-0CEEC3F3C321
Last class:
Today:
Example: $L = \{1^{n^2}:n\geq 1\}$
(All strings with only 1s and the number of 1s is a perfect square)
Suppose that $L$ is regular. Then, there is some number $p$ such that the pumping lemma holds.
Let $x$ be a string with 1s $p^2$ times.
By the PL, we can write $x=abc$ such that $abbc\in L$.
$|abbc| = p^2 = |b| \leq p^2 + p$
There is a DFA $D$ that computes some $L$.
Let $p =$ number of states in the DFA $D$.
Let $x$ have length $\geq p$.
We have $S_0, S_1,…,S_p$ is a sequence of $p+1$ state indices.
However, since the DFA has $p$ states, there are only $p$ state indices.
By the pigeonhole principle, we must have repeated a state.
Let’s say these repeated states are $S_i$ to $S_j$.
$x=\underset{\mathrm{a}}{S_0…,}\;\underset{\mathrm{b}}{S_i…,\,S_j...,}\; \underset{\mathrm{c}}{S_p,\,S_{p+1}}$
Let $S_0 = 0$ as the starting state.