Algorithm
Input: machine M = (Q,Σ,δ,s,W)
Output: string w' such that either w' ∈ L but w' ∉ L(M), or w' ∉ L but w' ∈ L(M).Note: it is not at all obvious that this algorithm meets its specification! We will discuss later!
- let $w = a^{(|Q|+1)^2}$
- if M doesn't accept w then
else
- set w' = w
- let x, y and z be the strings guaranteed to exist by the Pumping Lemma Version 2.0.
- set w' = xy0z
Question:
What string does the proceeding algorithm/proof produce for
input machine
Prove that the language $L = \left\{ u \in \{a,b\}^*\ \middle|\ |\text{# of $a$'s in $u$ - # of $b$'s in $u$}| \leq 2 \right\}$. is not regular, i.e. is not accepted by any finite automaton.
Note: This will require producing an algorithm that takes a machine as input and produces a string that the machinge mischaracterizes by either accepting it when it's not in L, or rejecting it when it is.