retagged by
7,873 views
6 votes
6 votes
Alphabet : {a, b}

Language : Set of all strings which start and end with same symbol

Doubt : Can $\epsilon$ be considered as part of the language ?

Edit: I can see several people have answered my question in the comments. Perhaps I should have mentioned that I need an explanation for it.

The reason I think $\epsilon$ should NOT be part of the language is that it begins and ends with $\epsilon$, which is not a symbol of the given alphabet. Moreover if we do consider strings starting and ending with empty string, then even "ab" could be thought of as starting and ending with an empty string, because any number of empty strings could be assumed to be present at the beginning and end of "ab" or even between a and b.

If you disagree with me please give some explanation.
retagged by

1 Answer

Best answer
8 votes
8 votes
Language : Set of all strings which start and end with same symbol

So, the condition is, if a string start with an alphabet symbol, it should end with the same symbol. This is like $a \implies b$. And as we all know $a \implies b$ is TRUE when $a$ is false. That is, if a string is not starting with any character- it need not finish with the same character. Such a string is $\epsilon$ and by definition $L$ should contain it. But it gets excluded if we say non-empty or non-emptiness is implied based on the situation of use.
edited by

Related questions

0 votes
0 votes
1 answer
1
Deepak9000 asked Nov 27, 2023
201 views
Why is C is regular as it non regular as?Please help me with this confusion
0 votes
0 votes
1 answer
2
M_Umair_Khan42900 asked Dec 29, 2022
749 views
Show that the following pairs of regular expressions define the same language over the alphabet I = [a, b].s(a) p(pp)*( A + p)q + q and p*q(b) A +0(0+1)* + (0+1)* 00(0+1)...
0 votes
0 votes
2 answers
4