Formal Languages (Alphabets, Words, Languages)
Context: FIT2014_MOC · computation is done with strings of symbols, so the whole unit is built on this vocabulary · foundation for regular languages, automata and grammars later
Quick Revision
- 🎯 Objective: alphabet (finite symbol set) ➔ word (finite string over ) ➔ language (a set of words over ).
- ⚡ Key Constraint: distinguish the empty language from the language containing the empty word — the first has elements, the second has .
📝 Core definitions
- Alphabet ➔ a finite set of symbols, denoted ; members are letters/characters. E.g. , , .
- Word ➔ a finite string of symbols; a word over draws all symbols from . The empty word has length , written (sometimes ).
- Language ➔ a set of words over — note a language is a set, not a string.
- Default convention ➔ unless stated otherwise, .
🔢 Special languages & notation
- Empty language ➔ — contains no words.
- Language of the empty word ➔ — contains exactly one word.
- Fixed length ➔ , e.g. .
- Universal language ➔ .
- Repetition ➔ concatenates copies of : , , . Note for any (so ).
📚 Three worked example languages
| Language | Definition | Members (sample) |
|---|---|---|
| EVEN-EVEN | each of occurs an even number of times | |
| DOUBLEWORD | — a word concatenated with itself | |
| PALINDROMES | reads the same forwards and backwards |
- Remember is even ➔ EVEN-EVEN.
- ➔ so DOUBLEWORD (take ).
🧮 Formal Proof Blueprint —
Theorem. .
Strategy (subset proof). To prove : take a general member of , name things, use the definitions, and derive membership of .
Derivation.
Q.E.D.
- Why “proof by example” fails here ➔ listing members of DOUBLEWORD that happen to be in EVEN-EVEN is a non-proof; a universal claim needs an argument covering every case.
- The exception ➔ an existential theorem (“English has a palindrome”) is settled by one witness (
rotator) — see Quantifiers (Existential and Universal).
⚠️ Common Mistakes
- 💡 ➔ the empty language contains nothing; contains one (empty) word. Sizes vs .
- 💡 Language = set of words, word = string ➔ a language is not itself a string; conflating the two breaks every later definition.
- 💡 Proof by example is not a proof ➔ except when the theorem only asserts existence. Universal statements need a general argument (Proof Techniques).
🧠 Active Recall
Why is a member of both EVEN-EVEN and DOUBLEWORD?
Answer
- Short answer: contains zero times and zero times, and is even, so EVEN-EVEN. Taking gives , so DOUBLEWORD.
- Why: Degenerate cases satisfy definitions ➔ the definitions quantify over counts and decompositions that are vacuously/trivially met at length — a standard exam trap.
Why does exhibiting many DOUBLEWORD members inside EVEN-EVEN fail to prove ?
Answer
- Short answer: the claim is universal (every member of DOUBLEWORD lies in EVEN-EVEN); examples cover finitely many cases while the language is infinite, so they only illustrate.
- Why: Arbitrary-element argument ➔ take a general and show and are even; this reasoning applies to all cases at once.