Example: Examples of Languages

(related to Definition: Language)

We continue with the above examples of strings over alphabets and define for them languages.

Example 1

Let $\Sigma:=\{a,b,c\}$ be our alphabet. A formal language $L\subseteq (\Sigma^*,\cdot)$ could be the subset containing only the words beginning with an $a$ and ending with a $c$, e.g.

"$acc$", "$aabbcc$" are words of $L$, but "$a,$", "$aa$", "$aaaa$", "$bca$", and "$bbbaaa$" are not words of $L$.

Example 2

Let $\Sigma$ be the set of all Capital and lowercase Latin letters, including the empty space, the comma, the point, the question mark, and the exclamation mark. A language $L\subseteq (\Sigma^*,\cdot)$ containing all English words is a formal language. Thus

"Socrates is a man." $\in L$


"DLdfa hidb!zw. alsei?" $\not\in L$.

Please note that $L$ is not the natural English language. For instance, the following sentence would belong to the formal language $L$:

"Is man Socrates run." $\in L$

because all the words are English words. However, the sentence does not make any sense in the natural English language.

Example 3

Let $\Sigma:=\{0,1,2,3,4,5,6,7,8,9,+,=\}$. Let $L\subseteq (\Sigma^*,\cdot)$ be the formal language containing all words starting with some letter(s) except "=", then containing the letter "$=$" only once and then ending some letter(s) except "=".


$"1=1",$ $"1=0",$ and $"1+1=2" \in L,$


$"30014",$ $"2222=333=+++",$ $"=32",$ and $"==="\not\in L.$

Definitions: 1
Examples: 2

Thank you to the contributors under CC BY-SA 4.0!