# Regular of language of all words of length 3

Consider the language $$L = \{ x \in \{0,1\}^* \mid |x| = 3 \}.$$

I think the above language is regular. A DFA can be used to determine the above language.

Am I correct? Is the above language regular?

If this language $$L$$ is regular, then it should satisfy the pumping lemma. Then there exist $$w = xyz$$, where $$xy^nz \in L$$ for all $$n \ge 0$$.

But on the other hand, if we pump more letters then the resulting string will not be in the language. The language $$L$$ only contains words of length 3.

The pumping lemma states that for every regular language there exists an integer $$p$$, such that string $$w$$ of length at least $$p$$ can be written as $$w = xyz$$ and $$y$$ can be pumped.

Here are my doubts.

1. Is this language $$L$$ regular?
2. If so, does it satisfy the pumping lemma?
3. The pumping lemma states that every regular language has a pumping length $$p \ge 1$$. Does this language not have one?
• I don't understand your notation. Is x a finite word over the alphabet {0,1} (meaning that it is a word consisting of these letters), or is it a one letter word which can either be the word "0" or the word "1"? What is your "/" notation? Jun 24 '20 at 12:09
• The language consists of all the 3 length words made over the alphabet {0,1}. E.g 000, 111, 010 etc. This is what i tried to convey. Here x is a finite word over the alphabet {0,1} which is of length 3 Jun 24 '20 at 12:35

Every finite language is regular. If $$L$$ is a finite language and $$p$$ is larger than the length of all words in $$L$$, then $$L$$ satisfies the pumping lemma with the constant $$p$$. Indeed, every word in $$L$$ of length at least $$p$$ can be pumped (vacuously).
• I wrote that if $p$ is larger than the length of all words in $L$, then $L$ satisfies the pumping lemma with the constant $p$. I'm not sure how you concluded that $L$ doesn't have any pumping constant. What I wrote is exactly the opposite. Jun 24 '20 at 13:02
• The proof of the pumping lemma shows that you can take $p$ to be the number of states in a DFA for $L$. Your language can be accepted by a DFA having 4 states. So you can take $p = 4$. Jun 24 '20 at 13:05