It is interesting to note that we can use the pumping lemma to determine whether the language accepted by a DFA is empty or infinite. The following theorem states this result.
Theorem : If M is a DFA with n states, than the language accepted by M (i.e. L(M)) is
- non empty if, and only if, M accepts some string w with

- infinite if, and only if, M accepts some string w such that

Proof:
- If M accepts a string w with
, then L(M) is clearly non empty. Conversely, let L(M) be non empty, and let w be the shortest string accepted by M. Then it must be the case that
. Otherwise, according to the pumping lemma w can be decomposed as w=xyz satisfying all the three constraints of the pumping lemma. So,
For the case i=0, the string
is a string which is shorter than w (since
)