Alphabet, Strings, and Languages
🔠 Alphabet, Strings, and Languages
📘 1. Alphabet (Σ)
Definition :
Examples:
-
Σ = {0, 1} → binary alphabet
-
Σ = {a, b} → common for regular languages
-
Σ = {0, 1, 2, ..., 9} → decimal digits
-
Σ = set of all ASCII characters → for programming languages
📌 Note: The alphabet must be finite.
Teaching Tip:
Think of the alphabet as the set of building blocks—like letters in a language or keys on a keyboard.
📄 2. String (or Word)
Definition:
-
If Σ = {a, b}, then:
-
a,ab,bba,aaabbare all strings over Σ. -
The string
xyzis not a string over Σ.
-
Special Case – Empty String (ε):
-
The empty string, denoted ε, is the string with zero symbols.
-
It is not the same as a string containing a space or "null".
-
Every alphabet has ε as a valid string.
Operations on Strings:
-
Concatenation: Combining two strings
Ifx = abandy = ba, thenxy = abba -
Length: Denoted
|w|for a stringw
Ifw = aba, then|w| = 3, and|ε| = 0
🌐 3. Language
Definition:
A language is a set of strings formed from an alphabet Σ.
-
So:
A language is a subset of Σ*
(Where Σ* is the set of all possible finite-length strings over Σ)
Examples:
-
Σ = {0, 1}
-
L = {ε, 0, 1, 00, 11} → A finite language
-
L = {w ∈ Σ* | w has even number of 0s} → An infinite language
-
-
Σ = {a, b}
-
L = {a^nb^n | n ≥ 0} → L = {ε, ab, aabb, aaabbb, ...}
-
Common Notations:
-
Σ*: Set of all strings over Σ (including ε)
-
Σ⁺: Set of all non-empty strings over Σ
(i.e., Σ⁺ = Σ* − {ε})
🔁 4. Key Theoretical Properties
-
Languages are the input/output for automata.
-
We classify languages based on complexity and recognizability:
-
Regular languages (finite automata)
-
Context-free languages (pushdown automata)
-
Recursively enumerable (Turing machines)
-
-
Every string belongs to exactly one of: a language or its complement (Σ* − L)
🎓 Summary:
| Term | Description | Example (Σ = {a, b}) |
|---|---|---|
| Alphabet | Finite set of symbol | {a, b} |
| String | Finite sequence from Σ | abba, ε |
| Σ* | All strings over Σ | ε, a, b, aa, ab... |
| Language | Subset of Σ* | {ab, ba, aab} |
Understanding alphabet, strings, and languages is essential before moving to:
-
Regular expressions and finite automata
-
Grammar derivations
-
Decidability and Turing machines
They form the foundation of all theoretical models of computation.
Comments
Post a Comment