A fooling set is a set of strings where any two elements form a distinguishable pair, i.e. it is pair-wise distinguishable. Fooling sets provide a lower bound to the number of states a finite state automaton (FSA) requires to recognise a language.
Definition
Fooling Set ^definition
Let be a language. Then a set of formulae, , is a fooling set for iff:
- This is usually shortened to saying is a pairwise distinguishable set in
Warning does not need to be in !!!
Strategies For Constructing Fooling Sets
-
Construct fooling set using prefixes of strings in .
-
To construct , consider strings for which it seems a counter that can count up to at least is needed to distinguish between them.
-
Often, it is possible to construct a fooling set such that for every string , there is a string such that distinguishes from the other strings in , i.e. either is in but is not in for every other in , or vice versa.
Theorem
T1: The fooling set for a language is a lower bound for the states of a DFA that recognises that language ^t1
Let be a language, and let be a fooling set for of size (i.e. ). Then:
= Some DFA that recognises
Proof: proof by contradiction:
We can use a
- Let be a DFA that recognises having less than states, say states.
- Let be the fooling set for of size
- Since we have more strings in than states in , we will, by the pigeonhole principle, have at least one state which two strings have the same computation path to.
- This is the same as saying for some and in . Here, is notation for the extended transition function.
- By the memorylessness lemma, this means for every suffix string , we have
- But by the definition of a fooling set, and needs to be a distinguishable pair, and by a theorem relating it to DFAs, we must have
- This leads to a contradiction
Hence, needs at least states.
C1: If the fooling set for a language is infinite, then the language is non-regular ^c1
This follows from the previous theorem. Let be a language and be a fooling set for . Then:
Another way of saying that is infinite is saying that for every natural number , there is a fooling set of size . Mathematically, this is:
Equivalently, has no finite state automaton that recognises it.
Proof:
This proof is very simple:
- If is infinite, then that means (by theorem 1) any DFA that recognises must have infinite states
- But a DFA is a finite state automata, so it cannot have finite states
- Therefore, no such DFA exists.
- Since a regular language requires a DFA to recognise it, if one does not exist, the language is non-regular.
C2: Myhill–Nerode Theorem ^c2
This is simply the contrapositive of the previous corollary. If a language is regular, then it must have a fooling set of finite length. Let be a language, and be a fooling set for . Then:
Examples
1: Simple Fooling Set
Construct a fooling set of size 3 for the given language below:
Solution finite language, by just taking the elements of the language itself. However, to show that this is a fooling set, we need to find a distinguishable suffix for each pair of elements:
First off, note that we can always take the ‘trivial’ fooling set of a
- : We take . Appending , which is in , while , which is not in .
- : Again, just take . Appending , which is in , while , which is not in .
- : Slightly harder, because the second string has the first string as a prefix. We can’t take because that would result in the pair , both of which are in the language. Instead take . This makes which is in , while which is not in
Thus, we have taken every combination of pairs of elements and shown that each pair is a distinguishable pair, thus satisfying the definition of a fooling set.
So we have:
being a fooling set of size 3 for .
2: Fooling Set for a non-regular language ^e2
Find the infinite fooling set for the language below:
Solution
We can start by finding a small fooling set, then looking at patterns to try to create a generalised, infinite version.
Take the fooling set :
- : We take , while
- : We take , while
- : Notice that the second string has the first string as a prefix. We can take , but
If we draw this as a graph, we get a complete graph:
%%🖋 Edit in Excalidraw, and the dark exported image%%
The obvious next step would be to see if we can add another string of zero’s: . If we do, the graph becomes:
%%🖋 Edit in Excalidraw, and the dark exported image%%
Notice that any pair just uses a distinguishing suffix consisting of ‘s. When we compair two pairs of zero’s, i.e. where then we take as many 1’s as the least number of zeroes:
- (,): This pair has as the distinguishing suffix, where is the smaller of the counts of zeroes. Here, we have , so is the distinguishing suffix.
- The exception is when we compare a pair with , we take the larger count of zeroes. For example, has the distinguishing suffix
Then we can construct an infinite fooling set:
#todo example for fooling set for language of palindromes.