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

LanguageDefinitionMembers (sample)
EVEN-EVENeach of occurs an even number of times
DOUBLEWORD — a word concatenated with itself
PALINDROMESreads 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